{"openapi":"3.1.0","info":{"title":"Kaptbase API","description":"Backend API for building AI chatbots with knowledge bases and actions","version":"1.0.0"},"paths":{"/readiness":{"get":{"summary":"Readiness Check","description":"Readiness check endpoint (public, no authentication required).\n\nThis endpoint is used by load balancers and health checks to verify:\n1. The backend is reachable and responding\n2. The service is ready to handle requests\n\nUsage:\n    GET /readiness\n\nReturns:\n    JSON with status and version","operationId":"readiness_check_readiness_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health Check","description":"Deep health check for the public status page (public, no auth).\n\n``/readiness`` only proves the process answers; this one also reaches\nPostgres and Redis, which every conversation turn needs. 503 names what is\ndown. Keep it cheap: Better Stack calls it from several regions.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/sami":{"get":{"summary":"Sami Health Check","description":"Sami's dependency for the status page (public, no auth): the Anthropic\nManaged Agents API answers for our agent with our key.\n\nThe probe is a metadata read (no session, no tokens) and its result is\ncached for a minute so the status checks never hammer Anthropic.","operationId":"sami_health_check_health_sami_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/knowledge-bases":{"get":{"summary":"Knowledge Bases Health Check","description":"Knowledge-base search for the status page (public, no auth).\n\nThe vector store is a private service, so the status page cannot reach it: this endpoint does.\nIt probes the store that serves the accounts' collections (the self-hosted one when CHROMA_HOST\nis set, else the default database) with a heartbeat plus a collection count, bounded by a\ntimeout, and caches the result for 30 s so the status checks never hammer it. The body never\nnames the provider.","operationId":"knowledge_bases_health_check_health_knowledge_bases_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/test/sample-urls":{"get":{"summary":"Get Sample Urls","description":"Test endpoint that returns sample URLs for testing URL shortening in tool results.\n\nThis endpoint simulates an API tool that returns content with URLs.\n\nUsage:\n    GET /test/sample-urls?query=products\n\nReturns:\n    JSON with sample results containing URLs","operationId":"get_sample_urls_test_sample_urls_get","parameters":[{"name":"query","in":"query","required":false,"schema":{"type":"string","default":"","title":"Query"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/personality-tones":{"get":{"summary":"Get Personality Tones","description":"Get available personality tones with localized names, descriptions, and examples.\n\nThis is an unauthenticated endpoint that returns the list of personality tones\navailable for assistants. The response is localized based on the language parameter.\n\nUsage:\n    GET /personality-tones?language=en\n    GET /personality-tones?language=es\n    GET /personality-tones?language=pt\n\nArgs:\n    language: Language code (en, es, or pt). Defaults to 'en'.\n\nReturns:\n    PersonalityTonesResponse with list of personality tones and the language used.\n\nRaises:\n    HTTPException: 400 if language is not supported.","operationId":"get_personality_tones_personality_tones_get","parameters":[{"name":"language","in":"query","required":false,"schema":{"type":"string","default":"en","title":"Language"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalityTonesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account-management/accounts":{"post":{"tags":["account-management"],"summary":"Create Account","description":"Create a new standalone account with an admin user.\n\nCreates the account and a default admin user with a temporary password.\nThe password is returned once and must be changed by the user.","operationId":"create_account_account_management_accounts_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account-management/accounts/{account_id}":{"get":{"tags":["account-management"],"summary":"Get Account","description":"Get account details by ID.","operationId":"get_account_account_management_accounts__account_id__get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account-management/accounts/{account_id}/users":{"post":{"tags":["account-management"],"summary":"Add User","description":"Add a user to an existing standalone account.\n\nCreates a new user with a temporary password.\nThe password is returned once and must be changed by the user.","operationId":"add_user_account_management_accounts__account_id__users_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddUserRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddUserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["account-management"],"summary":"List Users","description":"List all users in a standalone account.","operationId":"list_users_account_management_accounts__account_id__users_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/app__routers__account_management__UserResponse"},"title":"Response List Users Account Management Accounts  Account Id  Users Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account-management/accounts/{account_id}/users/{username}/reset-password":{"post":{"tags":["account-management"],"summary":"Reset Password","description":"Reset the password for a user in a standalone account.\n\nGenerates a new temporary password for the user.\nThe password is returned once and must be changed by the user.","operationId":"reset_password_account_management_accounts__account_id__users__username__reset_password_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest","default":{"send_email":false}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account-management/accounts/{account_id}/activity":{"get":{"tags":["account-management"],"summary":"Account Activity","description":"Who in the account signed in, and when they last used it.\n\nRead-only, and the one thing an ``accounts:create`` agent may read about an\naccount after its window closes: whether the people it built a demo for\never came in. Only on accounts that agent created (``minted_by`` on the\nprovisioning row); the full tier reads any standalone account.","operationId":"account_activity_account_management_accounts__account_id__activity_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountActivityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account-management/accounts/{account_id}/logo":{"post":{"tags":["account-management"],"summary":"Upload Logo","description":"Upload a logo for a standalone account.\n\nAccepts PNG, JPEG, GIF, or WebP images up to 2MB. An ``accounts:create``\ncaller can only do this while the account's provisioning window is open.","operationId":"upload_logo_account_management_accounts__account_id__logo_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_logo_account_management_accounts__account_id__logo_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account-management/accounts/{account_id}/provisioning":{"delete":{"tags":["account-management"],"summary":"Close Provisioning","description":"Close an account's provisioning window now, instead of waiting for it to expire.\n\nDeactivates the provisioning row, which is the authority behind both forms\nof the credential: the ``sbs_`` key stops authenticating and the MCP token is\nrefused on its next request. Whoever set the account up calls this when it\nis done, so a credential that skips the approval queue does not outlive the\nwork it was for. Idempotent, and it never touches an ordinary key.","operationId":"close_provisioning_account_management_accounts__account_id__provisioning_delete","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseProvisioningResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account-management/accounts/{account_id}/projects":{"get":{"tags":["account-management"],"summary":"List Projects","description":"List all projects in an account.","operationId":"list_projects_account_management_accounts__account_id__projects_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectResponse"},"title":"Response List Projects Account Management Accounts  Account Id  Projects Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/logo":{"get":{"tags":["accounts"],"summary":"Get Logo Info","description":"Get logo information for the current account.\n\nArgs:\n    current_user: Current authenticated user\n    include_data: If True, include base64-encoded logo data in response\n\nReturns:\n    LogoResponse with logo information","operationId":"get_logo_info_accounts_logo_get","parameters":[{"name":"include_data","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Data"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["accounts"],"summary":"Upload Logo","description":"Upload a new logo for the current standalone account.\n\nArgs:\n    current_user: Current authenticated user\n    file: The logo image file (PNG, JPEG, GIF, or WebP)\n\nReturns:\n    LogoResponse with updated logo information\n\nRaises:\n    HTTPException: 400 if file is invalid or too large\n    HTTPException: 403 if user is not an admin","operationId":"upload_logo_accounts_logo_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_logo_accounts_logo_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["accounts"],"summary":"Delete Logo","description":"Delete the logo for the current standalone account.\n\nArgs:\n    current_user: Current authenticated user\n\nReturns:\n    Success message\n\nRaises:\n    HTTPException: 403 if user is not an admin\n    HTTPException: 404 if account not found","operationId":"delete_logo_accounts_logo_delete","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/accounts/logo/image":{"get":{"tags":["accounts"],"summary":"Get Logo Image","description":"Get the actual logo image for the current account.\n\nReturns:\n    The logo image as a binary response","operationId":"get_logo_image_accounts_logo_image_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/accounts/feature-flags":{"get":{"tags":["accounts"],"summary":"Get My Feature Flags","description":"The feature flags in force for the caller's own account.\n\nOnly the client-visible ones: operator knobs like the Sami spend cap are\nours to set, not the product's to read. Returns resolved values — the app\nwants to know what applies, not whether an override exists.","operationId":"get_my_feature_flags_accounts_feature_flags_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/projects/{project_id}/task-runs":{"get":{"tags":["activity"],"summary":"List Project Task Runs","description":"Every task a conversation in this project was assigned, newest first.\n\nThe conversation row only holds the task it is pursuing right now, so this\nis the only place a finished run — or a conversation's second task — can be\nseen at all.\n\nArgs:\n    task_id: only runs of this task.\n    conversation_id: substring match, so a pasted (and often truncated) id works.\n    playbook_base_id: only runs of this assistant.\n    status: in_progress | done | failed.\n    start_date / end_date: window on assigned_at, end exclusive; a date-only\n        or naive bound is read in `timezone`.","operationId":"list_project_task_runs_projects__project_id__task_runs_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"task_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"}},{"name":"conversation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"}},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires.","default":"UTC","title":"Timezone"},"description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskRunsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/task-runs/stats":{"get":{"tags":["activity"],"summary":"Get Project Task Run Stats","description":"The task log's summary: tiles, a series, the open backlog and a per-task split.\n\nCounts cover the runs ASSIGNED in the window (end exclusive), by their\ncurrent status — the same runs the list shows under the same filters.\n`open_age` and `tasks` ignore the window on purpose (see\n`task_runs.run_stats`).\n\nArgs:\n    granularity: hour | day | week, cut in `timezone`.","operationId":"get_project_task_run_stats_projects__project_id__task_runs_stats_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"task_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Id"}},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires.","default":"UTC","title":"Timezone"},"description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires."},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","default":"day","title":"Granularity"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskRunStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations":{"get":{"tags":["activity"],"summary":"List Project Conversations","description":"Get all conversations for a project with optional filters and pagination.\n\nReturns a list of conversations with metadata (inbox name, playbook info, message count, last activity)\nplus pagination information (total count, limit, offset).\nOnly returns conversations from webhook interactions (preview chats are excluded).\nSupports pagination for lazy loading in the UI.\n\nArgs:\n    project_id: UUID of the project (assistant)\n    current_user: Authenticated user\n    playbook_id: Optional UUID of specific playbook version to filter by\n    playbook_base_id: Optional UUID of playbook base (all versions) to filter by\n    inbox_id: Optional UUID of inbox to filter by\n    limit: Maximum number of conversations to return (default: 20, max: 100)\n    offset: Number of conversations to skip (default: 0)\n    search: Optional search query to filter by conversation ID or user ID\n    start_date: Optional start date filter (ISO format, e.g., 2024-01-01T00:00:00Z)\n    end_date: Optional end date filter (ISO format, e.g., 2024-01-31T23:59:59Z)\n    has_handoff: Optional filter for conversations with/without handoff (true/false)\n    has_winback: Optional filter for conversations with/without winback sent (true/false)\n    tags: Optional comma-separated list of tags to filter by (AND logic - must have ALL tags)\n    sentiment: Optional comma-separated sentiment filter (negative,neutral,positive)\n    resources: Optional comma-separated resources filter (irrelevant,partial,relevant)\n    min_messages: Optional minimum message count\n    max_messages: Optional maximum message count\n    sort_by: Optional sort field (last_message_at, first_message_at, message_count)\n    sort_order: Optional sort direction (desc, asc)\n    external_user_id: Optional exact match on the bound user (that person's conversations)\n    external_organization_id: Optional exact match on the bound organization\n        (every conversation of that company, by any of its people)\n    timezone: IANA zone a date-only start_date/end_date is read in (default UTC)\n\nReturns:\n    PlaybookConversationsResponse: Conversations list with pagination metadata\n\nExample:\n    - All conversations: GET /projects/{id}/conversations?limit=20&offset=0\n    - Filter by playbook version: GET /projects/{id}/conversations?playbook_id={playbook_id}\n    - Filter by playbook base: GET /projects/{id}/conversations?playbook_base_id={base_id}\n    - Filter by inbox: GET /projects/{id}/conversations?inbox_id={inbox_id}\n    - Filter by date: GET /projects/{id}/conversations?start_date=2024-01-01T00:00:00Z\n    - Filter by handoff: GET /projects/{id}/conversations?has_handoff=true\n    - Filter by winback: GET /projects/{id}/conversations?has_winback=true\n    - Filter by tags: GET /projects/{id}/conversations?tags=urgent,support\n    - Multiple filters: GET /projects/{id}/conversations?playbook_base_id={base}&inbox_id={inbox}\n    - Second page: GET /projects/{id}/conversations?limit=20&offset=20","operationId":"list_project_conversations_projects__project_id__conversations_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"playbook_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Id"}},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"}},{"name":"inbox_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbox Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"date_field","in":"query","required":false,"schema":{"enum":["last_message_at","first_message_at"],"type":"string","default":"last_message_at","title":"Date Field"}},{"name":"has_handoff","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Handoff"}},{"name":"has_winback","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Winback"}},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tags"}},{"name":"sentiment","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"}},{"name":"resources","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resources"}},{"name":"sentiment_shift","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Shift"}},{"name":"deflection_quality","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deflection Quality"}},{"name":"handoff_reason","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handoff Reason"}},{"name":"recontact_risk","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recontact Risk"}},{"name":"min_messages","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Min Messages"}},{"name":"max_messages","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Messages"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort Order"}},{"name":"skill_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skill Name"}},{"name":"tag_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag Filter"}},{"name":"external_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id"}},{"name":"external_organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Organization Id"}},{"name":"ctx_lookup","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ctx Lookup"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires.","default":"UTC","title":"Timezone"},"description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookConversationsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/summaries":{"get":{"tags":["activity"],"summary":"List Conversation Summaries","description":"Get lightweight conversation summaries for batch scanning.\n\nReturns a slim list with summary, sentiment, resources, tags, and basic metadata.\nUseful for scanning many conversations without loading full objects.\n\nArgs:\n    project_id: UUID of the project (assistant)\n    current_user: Authenticated user\n    start_date: Optional start date filter (ISO format)\n    end_date: Optional end date filter (ISO format)\n    sentiment: Optional comma-separated sentiment filter (negative,neutral,positive)\n    resources: Optional comma-separated resources filter (irrelevant,partial,relevant)\n    tags: Optional comma-separated tags (AND logic)\n    playbook_base_id: Optional playbook base UUID filter\n    has_handoff: Optional handoff filter\n    limit: Max summaries to return (default: 50, max: 100)\n    offset: Pagination offset\n    sort_by: Optional sort field (last_message_at, first_message_at, message_count)\n    sort_order: Optional sort direction (desc, asc)\n    timezone: IANA zone a date-only start_date/end_date is read in (default UTC)","operationId":"list_conversation_summaries_projects__project_id__conversations_summaries_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"sentiment","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"}},{"name":"resources","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resources"}},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tags"}},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"}},{"name":"has_handoff","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Handoff"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort Order"}},{"name":"tag_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag Filter"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires.","default":"UTC","title":"Timezone"},"description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationSummariesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/tags":{"get":{"tags":["activity"],"summary":"List Project Tags","description":"Return the distinct tags applied to conversations in the project (union\nof `tags` and `external_tags`, sorted alphabetically), with how many\nconversations carry each one.\n\nUsed by the smart tag filter UI to populate its combobox without forcing\nthe caller to paginate through every conversation, and (with `days`) by the\nfollow-up editor to suggest the tags in current use.\n\nAnswered through app.dashboard_cache for a few minutes: the all-time list\nreads every conversation's tags (3.8 s p50 on the largest project, Nov\n2026) and is fetched on every chatlog visit, while tags change slowly.","operationId":"list_project_tags_projects__project_id__conversations_tags_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":365,"minimum":1},{"type":"null"}],"description":"Only conversations with a message in the last N days. Omitted: all of them.","title":"Days"},"description":"Only conversations with a message in the last N days. Omitted: all of them."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectTagsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/inboxes":{"get":{"tags":["activity"],"summary":"List Project Inboxes","description":"Return the distinct ``(inbox_id, inbox_name)`` pairs that have ever\nappeared on conversations in the project.\n\nUsed to populate the inbox dropdown on the monitors form so an operator\ncan scope a rule to a specific channel without having to know the inbox\nid by hand.","operationId":"list_project_inboxes_projects__project_id__conversations_inboxes_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectInboxesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/{conversation_id}/messages":{"get":{"tags":["activity"],"summary":"Get Project Conversation Messages","description":"Get all messages for a specific conversation in a project.\n\nReturns the full message history with role, content, timestamp, metadata,\nand citations extracted from KB search tool calls.\n\nArgs:\n    project_id: UUID of the project (assistant)\n    conversation_id: ID of the conversation\n    current_user: Authenticated user\n\nReturns:\n    ConversationMessagesResponse: Messages and citations","operationId":"get_project_conversation_messages_projects__project_id__conversations__conversation_id__messages_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationMessagesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/{conversation_id}/messages/{message_index}/attachments/{attachment_index}/file":{"get":{"tags":["activity"],"summary":"Get Conversation Attachment File","description":"Serve a base64-encoded message attachment as raw bytes.\n\nUsed by the FE to render document attachments (PDF, etc.) in an iframe.\nMirrors the KB file serving pattern (/knowledgebases/{id}/file).","operationId":"get_conversation_attachment_file_projects__project_id__conversations__conversation_id__messages__message_index__attachments__attachment_index__file_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"message_index","in":"path","required":true,"schema":{"type":"integer","title":"Message Index"}},{"name":"attachment_index","in":"path","required":true,"schema":{"type":"integer","title":"Attachment Index"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/{conversation_id}/call-recordings/{recording_id}":{"get":{"tags":["activity"],"summary":"Get Call Recording Audio","description":"A recorded call's audio (stereo MP3: the person left, the assistant right), for the Chat Log's player.\n\nThe recording must belong to this conversation of this account's project; the audio is\nread from private storage with the platform's read key under the recording's own\naccount. 404 once past its retention date or deleted, and when it is not this account's.","operationId":"get_call_recording_audio_projects__project_id__conversations__conversation_id__call_recordings__recording_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"recording_id","in":"path","required":true,"schema":{"type":"string","title":"Recording Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/attachments/manifest":{"post":{"tags":["activity"],"summary":"List Conversation Attachments","description":"Inventory the files people sent, without returning any of them.\n\nThe counterpart of the per-file endpoint above: that one answers \"render\nthis image\", this one answers \"what images are there\". Deliberately split,\nbecause the bytes live inside the message row and a caller that only wants\nsizes and senders should not have to move megabytes to learn them.","operationId":"list_conversation_attachments_projects__project_id__conversations_attachments_manifest_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationAttachmentManifestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationAttachmentManifestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/attachments/export":{"post":{"tags":["activity"],"summary":"Export Conversation Attachments","description":"Stream the refs as one ZIP, with a manifest.json inside it.\n\nThe archive is the response body rather than a stored artifact: it is\nreproducible from the refs, so persisting it would only add a copy of\ncustomer data with its own retention question. `X-Attachment-Export` carries\nthe same report the archive's manifest holds, so a caller that streamed the\nbody straight to disk still learns what was skipped.","operationId":"export_conversation_attachments_projects__project_id__conversations_attachments_export_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationAttachmentExportRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/analytics":{"get":{"tags":["activity"],"summary":"Get Project Conversation Analytics","description":"Get aggregated analytics for conversations in a project.\n\nReturns deflection rates, message counts, and breakdowns by playbook and tag.\nUseful for dashboard visualizations and performance metrics.\n\nArgs:\n    project_id: UUID of the project (assistant)\n    current_user: Authenticated user\n    playbook_id: Optional UUID of specific playbook version to filter by\n    playbook_base_ids: Optional comma-separated list of playbook base UUIDs to filter by (multi-select)\n    start_date: Optional start date filter (ISO format, e.g., 2024-01-01T00:00:00Z)\n    end_date: Optional end date filter (ISO format, e.g., 2024-01-31T23:59:59Z)\n    tags: Optional comma-separated list of tags to filter by (AND logic)\n    timezone: IANA zone for the window AND the time_series buckets (default UTC).\n        time_series[].timestamp comes back as a naive wall clock in this zone —\n        a bucket key to render verbatim, not an instant to convert.\n    include_breakdowns: false skips by_playbook and by_tag (they come back\n        empty) — two of the four passes over the window. For callers that\n        only show the totals and the time series, like the Home dashboard.\n\nReturns:\n    ConversationAnalytics: Aggregated analytics data including:\n        - total_conversations: Total number of conversations\n        - total_messages: Total messages across all conversations\n        - deflection_rate: Percentage of AI-resolved conversations (0-100)\n        - by_playbook: Metrics breakdown by playbook\n        - by_tag: Metrics breakdown by tag\n        - time_series: Conversation counts over time","operationId":"get_project_conversation_analytics_projects__project_id__conversations_analytics_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"playbook_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Id"}},{"name":"playbook_base_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Ids"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tags"}},{"name":"tag_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag Filter"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires.","default":"UTC","title":"Timezone"},"description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires."},{"name":"include_breakdowns","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Breakdowns"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationAnalytics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/account/conversations/analytics":{"get":{"tags":["activity"],"summary":"Get Account Conversation Analytics","description":"Get aggregated analytics for all conversations across all assistants in the account.\n\nUsed for the Home view to show account-wide metrics and the yearly deflection mosaic.\nIncludes total AI messages for time-saved calculation (5 min per AI message).\n\nArgs:\n    current_user: Authenticated user\n    start_date: Optional start date filter (ISO format, e.g., 2024-01-01T00:00:00Z)\n    end_date: Optional end date filter (ISO format, e.g., 2024-12-31T23:59:59Z)\n    timezone: IANA zone for the window AND the daily buckets (default UTC).\n        This is the mosaic where a 21:00 ART conversation used to land on\n        tomorrow's tile.\n\nReturns:\n    AccountAnalytics: Account-wide analytics data including:\n        - total_conversations: Total conversations across all assistants\n        - total_messages: Total messages across all conversations\n        - total_ai_messages: AI messages sent (for time saved calculation)\n        - deflection_rate: Percentage of AI-resolved conversations (0-100)\n        - by_assistant: Metrics breakdown by assistant\n        - time_series: Daily conversation counts for the date range","operationId":"get_account_conversation_analytics_account_conversations_analytics_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires.","default":"UTC","title":"Timezone"},"description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountAnalytics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/{conversation_id}/metrics":{"get":{"tags":["activity"],"summary":"Get Conversation Metrics","description":"Get quality metrics for a specific conversation.\n\nReturns metrics if available, or null if conversation hasn't been scored yet.\nMetrics include sentiment, coherence, and resources effectiveness.\n\nArgs:\n    project_id: UUID of the project (assistant)\n    conversation_id: ID of the conversation\n    current_user: Authenticated user\n\nReturns:\n    ConversationMetricsResponse if scored, null otherwise","operationId":"get_conversation_metrics_projects__project_id__conversations__conversation_id__metrics_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ConversationMetricsResponse"},{"type":"null"}],"title":"Response Get Conversation Metrics Projects  Project Id  Conversations  Conversation Id  Metrics Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/aggregate":{"get":{"tags":["activity"],"summary":"Aggregate Project Conversations","description":"Count conversations (and handoffs) per value of ``group_by``.\n\nThe deterministic group-by a report used to compute by downloading every\nconversation into a sandbox: \"derivaciones por tag\", \"conversaciones por\ndía\", \"distribución de sentiment para este filtro\". One SQL statement,\nexact, the same answer on every run — see ``app/metrics/aggregate_groups``.\n\n``filter`` is the monitors' conversation-filter AST as a JSON string\n(tag / skill / handoff leaves combined with AND/OR/NOT). ``group_by`` is one\nof: tag, handoff, sentiment, sentiment_shift, deflection_quality,\nhandoff_reason, recontact_risk, day, playbook, organization, user.","operationId":"aggregate_project_conversations_projects__project_id__conversations_aggregate_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"group_by","in":"query","required":true,"schema":{"type":"string","title":"Group By"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"date_field","in":"query","required":false,"schema":{"type":"string","default":"last_message_at","title":"Date Field"}},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"}},{"name":"filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter"}},{"name":"top_n","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":25,"title":"Top N"}},{"name":"min_count","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Min Count"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires.","default":"UTC","title":"Timezone"},"description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/metrics/aggregate":{"get":{"tags":["activity"],"summary":"Get Project Metrics Aggregate","description":"Get aggregated quality metrics for conversations in a project.\n\nReturns distributions for each metric category (sentiment, resources)\nalong with coverage percentage.\n\nArgs:\n    project_id: UUID of the project (assistant)\n    current_user: Authenticated user\n    start_date: Optional start date filter (ISO format)\n    end_date: Optional end date filter (ISO format)\n    playbook_id: Optional playbook version ID filter\n    playbook_base_id: Optional playbook base ID filter\n    tags: Optional comma-separated tags (AND logic)\n    inbox_id: Optional inbox UUID filter\n    timezone: IANA zone a date-only start_date/end_date is read in (default UTC)\n\nReturns:\n    AggregateMetricsResponse with distributions and coverage","operationId":"get_project_metrics_aggregate_projects__project_id__conversations_metrics_aggregate_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"playbook_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Id"}},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"}},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tags"}},{"name":"inbox_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbox Id"}},{"name":"tag_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag Filter"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires.","default":"UTC","title":"Timezone"},"description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AggregateMetricsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/{conversation_id}/metrics/analyze":{"post":{"tags":["activity"],"summary":"Analyze Conversation Metrics","description":"Trigger manual metrics analysis for a specific conversation.\n\nThis endpoint allows users to trigger immediate metrics analysis without\nwaiting for the scheduled cron job. Useful for newly completed conversations\nor when users want to see metrics immediately.\n\nThe analysis uses the same LLM-based scoring as the cron job:\n- Sentiment: Customer emotional state (negative/neutral/positive)\n- Resources: KB/tools effectiveness (only if tool calls were used)\n- Summary: Brief description of the conversation\n\nArgs:\n    project_id: UUID of the project (assistant)\n    conversation_id: ID of the conversation to analyze\n    current_user: Authenticated user\n\nReturns:\n    ConversationMetricsResponse with the computed metrics\n\nRaises:\n    404: If project or conversation not found\n    400: If conversation has insufficient messages\n    500: If analysis fails (e.g., LLM API error)","operationId":"analyze_conversation_metrics_projects__project_id__conversations__conversation_id__metrics_analyze_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationMetricsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/{conversation_id}":{"get":{"tags":["activity"],"summary":"Get Project Conversation Detail","description":"Get full detail for a single conversation.\n\nReturns all metadata (summary, sentiment, resources, skills, tags, etc.)\nplus the complete message history with tool calls and KB citations.","operationId":"get_project_conversation_detail_projects__project_id__conversations__conversation_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/batch":{"post":{"tags":["activity"],"summary":"Get Project Conversations Batch","description":"Get full detail for multiple conversations in a single request.\n\nAccepts up to 50 conversation IDs and returns all metadata plus\ncomplete message history for each.","operationId":"get_project_conversations_batch_projects__project_id__conversations_batch_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationBatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationBatchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/insights/trending-topics":{"post":{"tags":["activity"],"summary":"Generate Trending Topics","description":"Generate AI-powered trending topics analysis for conversations.\n\nAnalyzes conversations from the last 7 days and identifies the most\ncommon topics customers are asking about, with links to example conversations.\n\nThis is an on-demand analysis that calls LLM APIs. It is NOT cached.\n\nArgs:\n    project_id: UUID of the project (assistant)\n    current_user: Authenticated user\n    playbook_base_ids: Optional filter by playbook base IDs (comma-separated for multi-select)\n    tags: Optional filter by tags (comma-separated)\n    timezone: IANA zone that decides where \"the last 7 COMPLETE days\" ends\n        (default UTC). Only this uncached route takes it — the job-based\n        sibling is deduped by a persisted UTC analysis_date and stays on UTC.\n\nReturns:\n    TrendingTopicsResponse with topics and conversation examples","operationId":"generate_trending_topics_projects__project_id__conversations_insights_trending_topics_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"playbook_base_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by playbook base IDs (comma-separated)","title":"Playbook Base Ids"},"description":"Filter by playbook base IDs (comma-separated)"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by tags (comma-separated, AND logic)","title":"Tags"},"description":"Filter by tags (comma-separated, AND logic)"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires.","default":"UTC","title":"Timezone"},"description":"IANA timezone for date windows and bucket boundaries, e.g. America/Argentina/Buenos_Aires."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrendingTopicsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/insights/trending-topics/status":{"get":{"tags":["activity"],"summary":"Get Trending Topics Status","description":"Check status of trending topics analysis for today.","operationId":"get_trending_topics_status_projects__project_id__conversations_insights_trending_topics_status_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"playbook_base_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by playbook base IDs (comma-separated)","title":"Playbook Base Ids"},"description":"Filter by playbook base IDs (comma-separated)"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by tags (comma-separated, AND logic)","title":"Tags"},"description":"Filter by tags (comma-separated, AND logic)"},{"name":"time_window_days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Time window in days","default":7,"title":"Time Window Days"},"description":"Time window in days"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrendingTopicsStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/insights/trending-topics/generate":{"post":{"tags":["activity"],"summary":"Start Trending Topics Job","description":"Start a new trending topics analysis job.\n\nCreates a background job that will analyze conversations and identify\ntrending topics. Poll the job status endpoint to track progress.\n\nWill return 409 Conflict if:\n- Analysis already exists for today with this configuration\n- A job is already running for this configuration\n\nArgs:\n    project_id: UUID of the project (assistant)\n    current_user: Authenticated user\n    request: Optional configuration (playbook_base_ids, tags)\n\nReturns:\n    TrendingTopicsGenerateResponse with job_id to poll","operationId":"start_trending_topics_job_projects__project_id__conversations_insights_trending_topics_generate_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/TrendingTopicsGenerateRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrendingTopicsGenerateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/insights/trending-topics/job/{job_id}":{"get":{"tags":["activity"],"summary":"Get Trending Topics Job Status","description":"Poll the status of a trending topics analysis job.\n\nUse this endpoint to track progress of a running job. Poll every 2 seconds.\nWhen status is \"completed\", use the analysis_id to fetch the results.\n\nArgs:\n    project_id: UUID of the project (assistant)\n    job_id: UUID of the job to check\n    current_user: Authenticated user\n\nReturns:\n    TrendingTopicsJobStatusResponse with current job state","operationId":"get_trending_topics_job_status_projects__project_id__conversations_insights_trending_topics_job__job_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrendingTopicsJobStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/insights/trending-topics/analysis/{analysis_id}":{"get":{"tags":["activity"],"summary":"Get Trending Topics Analysis","description":"Get a specific trending topics analysis by ID.\n\nUse this endpoint to fetch the full analysis results after a job completes.\n\nArgs:\n    project_id: UUID of the project (assistant)\n    analysis_id: UUID of the analysis\n    current_user: Authenticated user\n\nReturns:\n    TrendingTopicsAnalysisInfo with full analysis data","operationId":"get_trending_topics_analysis_projects__project_id__conversations_insights_trending_topics_analysis__analysis_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrendingTopicsAnalysisInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/insights/trending-topics/analyses":{"get":{"tags":["activity"],"summary":"List Trending Topics Analyses","description":"List past trending topics analyses for a project, newest first.","operationId":"list_trending_topics_analyses_projects__project_id__conversations_insights_trending_topics_analyses_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrendingTopicsAnalysesListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/insights/trending-topics/analysis/{analysis_id}/pdf":{"get":{"tags":["activity"],"summary":"Get Trending Topics Pdf","description":"Generate and return PDF for a trending topics analysis.","operationId":"get_trending_topics_pdf_projects__project_id__conversations_insights_trending_topics_analysis__analysis_id__pdf_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversations/{conversation_id}/handoff-request":{"get":{"tags":["activity"],"summary":"Get Manual Handoff Availability","description":"Whether this conversation can be handed to a person from the Chat Log.\n\nTrue only when its assistant has handoff on, it arrived through a channel\nthat declares ``handoff_request`` (the adapter serves ``POST\n/adapter/v1/handoff``), it is not already with people, and it had a message\nin the last 24 hours. The dashboard shows the button only then.","operationId":"get_manual_handoff_availability_projects__project_id__conversations__conversation_id__handoff_request_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualHandoffAvailability"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["activity"],"summary":"Request Manual Handoff","description":"Hand this conversation to a person now: the channel runs its assistant's configured handoff.\n\nThe assistant stops answering it the same way it does after handing off on\nits own — the channel's handoff lock, and ``has_handoff`` here (a channel with\nsticky handoff keeps the conversation with people from then on). Admin-only\n(``role_policy``: production traffic is not a member's call).\n\n409 with ``detail.error`` when it is not available (see the GET) or the\nchannel declined; 502 when the channel failed.","operationId":"request_manual_handoff_projects__project_id__conversations__conversation_id__handoff_request_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ManualHandoffRequestBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualHandoffResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/balance":{"get":{"tags":["billing"],"summary":"Get My Balance","description":"The logged-in account's prepaid balance + refill ledger + monthly usage.\n\n404s unless the account is allowlisted for client visibility AND funded —\nthat's the only barrier; the FE allowlist just hides the nav item to match.","operationId":"get_my_balance_billing_balance_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientBalanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["authentication"],"summary":"Login","description":"Login with account_name/username/password for standalone accounts.\n\nThis endpoint is only for standalone accounts (username/password auth).\nKaption accounts use JWT tokens from the external system.\n\nArgs:\n    login_request: Account name, username, and password\n\nReturns:\n    LoginResponse with session token, or LoginTotpRequiredResponse\n    (pending token, no session) when the user has 2FA enrolled\n\nRaises:\n    HTTPException: 401 if credentials are invalid or account is inactive","operationId":"login_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/LoginResponse"},{"$ref":"#/components/schemas/LoginTotpRequiredResponse"}],"title":"Response Login Auth Login Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login/totp":{"post":{"tags":["authentication"],"summary":"Login Totp","description":"Second login step for users with 2FA enrolled (unauthenticated).\n\nExchanges the pending token from POST /auth/login plus a valid\n6-digit code for a real session token. This is where the session is\nminted and last_login updated.\n\nEvery failure mode (bad/expired/forged pending token, replayed or\nsuperseded pending token, active lockout, wrong code, user or account\ndeactivated since step 1) collapses into the same 401 so nothing can\nbe enumerated. Wrong codes count toward a DB-backed lockout\n(TOTP_MAX_FAILED_ATTEMPTS wrong codes → locked for TOTP_LOCKOUT), and\neach pending token is single-use (its jti must match the one stored at\nstep 1, which success and lockout both clear).\n\nArgs:\n    request: Pending token and TOTP code\n\nReturns:\n    LoginResponse with session token\n\nRaises:\n    HTTPException: 401 on any failure (uniform message)","operationId":"login_totp_auth_login_totp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginTotpRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/logout":{"post":{"tags":["authentication"],"summary":"Logout","description":"Logout (invalidate session token).\n\nThis endpoint invalidates the current session token.\nWorks only for standalone accounts (session tokens).\n\nArgs:\n    current_user: Current authenticated user\n    authorization: Authorization header with session token\n\nReturns:\n    Success message\n\nRaises:\n    HTTPException: 400 if not a session token or if logout fails","operationId":"logout_auth_logout_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/auth/session":{"get":{"tags":["authentication"],"summary":"Check Session","description":"Check if a session token is valid (unauthenticated endpoint).\n\nThis is an unauthenticated endpoint that checks if a session token is valid.\nUsed by frontend to check if user is logged in before making authenticated requests.\n\nArgs:\n    authorization: Optional authorization header with session token\n\nReturns:\n    SessionCheckResponse with validity status and account info","operationId":"check_session_auth_session_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionCheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/password":{"put":{"tags":["authentication"],"summary":"Change Password","description":"Change password for the current standalone user.\n\nRequires the user to provide their current password for verification.\nOnly works for standalone accounts (session tokens).\n\nArgs:\n    request: Current and new password\n    current_user: Current authenticated user\n\nReturns:\n    Success message\n\nRaises:\n    HTTPException: 400 if not a standalone user or current password is wrong\n    HTTPException: 500 if password update fails","operationId":"change_password_auth_password_put","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/2fa":{"get":{"tags":["authentication"],"summary":"Get 2Fa Status","description":"Report the current user's 2FA state.\n\nNever errors for non-standalone sessions (kaption/embedded users have\nno standalone user row) — they just get supported=false so the FE can\nhide the whole section.\n\nReturns:\n    TwoFactorStatusResponse with supported/enabled/pending flags","operationId":"get_2fa_status_auth_2fa_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/2fa/setup":{"post":{"tags":["authentication"],"summary":"Setup 2Fa","description":"Start 2FA enrollment for the current standalone user.\n\nRequires the current password (a hijacked session must not be able to\nenroll its own authenticator). Generates a fresh TOTP secret, stores\nit encrypted, and returns the QR material. 2FA is NOT active yet —\nthe user must confirm a code at POST /auth/2fa/verify first. Calling\nsetup again while pending regenerates the secret.\n\nArgs:\n    request: Current password\n    current_user: Current authenticated user\n\nReturns:\n    TwoFactorSetupResponse with secret and otpauth URI\n\nRaises:\n    HTTPException: 400 if not a standalone session, already enabled,\n        or the password is wrong","operationId":"setup_2fa_auth_2fa_setup_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorSetupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorSetupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/2fa/verify":{"post":{"tags":["authentication"],"summary":"Verify 2Fa","description":"Confirm a pending 2FA setup with a code from the authenticator app.\n\nOn success, sets totp_enrolled_at — from the next login on, this user\nmust complete the /auth/login/totp step.\n\nArgs:\n    request: TOTP code\n    current_user: Current authenticated user\n\nReturns:\n    {\"enabled\": true}\n\nRaises:\n    HTTPException: 400 if there is no pending setup or the code is wrong","operationId":"verify_2fa_auth_2fa_verify_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorVerifyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/2fa/disable":{"post":{"tags":["authentication"],"summary":"Disable 2Fa","description":"Disable 2FA for the current standalone user.\n\nRequires BOTH factors (password + a valid code) so neither a stolen\nsession nor a stolen password alone can turn the protection off.\nLocked-out users go through an account admin instead\n(POST /users/{id}/reset-2fa).\n\nArgs:\n    request: Current password and TOTP code\n    current_user: Current authenticated user\n\nReturns:\n    {\"enabled\": false}\n\nRaises:\n    HTTPException: 400 if 2FA is not enabled, or either factor is wrong","operationId":"disable_2fa_auth_2fa_disable_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorDisableRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/mcp-sso-ticket":{"post":{"tags":["authentication"],"summary":"Mint Mcp Sso Ticket","description":"Mint a one-time SSO ticket so the MCP /authorize flow can skip its login.\n\nDashboard sessions only: the ticket proves \"this browser holds a live\ndashboard session for this user\". The MCP AS redeems it once, re-validates\nuser/account liveness, and lands the user on the consent page. Any active\nmember may connect; their account role narrows the connection per request\n(app/mcp_server/roles.py). It grants no API access by itself.","operationId":"mint_mcp_sso_ticket_auth_mcp_sso_ticket_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpSsoTicketResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["authentication"],"summary":"Get Me","description":"Who the caller is and what their account can do — for the dashboard to gate on.\n\nThe frontend used to infer all of this from the SHAPE of the token (\"it is\na Rumo JWT, so everyone is an admin\"). That stopped being true the day a\nstandalone account could be opened from inside Rumo: same token shape,\ndifferent account type, real roles. So the answers are given here, by the\nside that knows.\n\nEvery answer comes from our own database. No adapter is contacted — this is\ncalled on every dashboard load, and a bridge that is down must not make it\nslow or wrong. ``rumo_channel`` is therefore \"the account has a channel on\n``RUMO_ADAPTER_URL`` with a tenant\", which is the registration itself, not\nsomething the adapter has to confirm.","operationId":"get_me_auth_me_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users":{"get":{"tags":["users"],"summary":"List Users","description":"List all users in the current account.\n\nOnly admin users of standalone accounts can access this endpoint.\n\nReturns:\n    List of users in the account","operationId":"list_users_users_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/app__routers__users__UserResponse"},"title":"Response List Users Users Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["users"],"summary":"Create User","description":"Create a new user in the current account.\n\nOnly admin users of standalone accounts can access this endpoint.\nA random temporary password is generated and returned (shown only once).\nThe user should change their password after first login.\n\nArgs:\n    request: Username and admin status for the new user\n\nReturns:\n    Created user with temporary password","operationId":"create_user_users_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}":{"delete":{"tags":["users"],"summary":"Delete User","description":"Delete a user from the current account.\n\nOnly admin users of standalone accounts can access this endpoint.\nCannot delete yourself or the last admin user.\n\nArgs:\n    user_id: ID of the user to delete\n\nReturns:\n    204 No Content on success","operationId":"delete_user_users__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["users"],"summary":"Update User","description":"Update a user's admin status.\n\nOnly admin users of standalone accounts can access this endpoint.\nCannot remove admin from yourself or the last admin user.\n\nArgs:\n    user_id: ID of the user to update\n    request: New admin status\n\nReturns:\n    Updated user","operationId":"update_user_users__user_id__patch","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__users__UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/{user_id}/reset-2fa":{"post":{"tags":["users"],"summary":"Reset User 2Fa","description":"Reset (clear) a user's 2FA enrollment — lockout recovery.\n\nOnly admin users of standalone accounts can access this endpoint.\nThere are no backup codes by design: a user who lost their\nauthenticator asks an account admin to reset, then re-enrolls via\n/auth/2fa/setup. Mirrors the superadmin `reset-totp` CLI.\n\nArgs:\n    user_id: ID of the user whose 2FA to reset\n\nReturns:\n    Success message\n\nRaises:\n    HTTPException: 403 if not admin, 400 if targeting yourself,\n        404 if user not in this account","operationId":"reset_user_2fa_users__user_id__reset_2fa_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/projects":{"post":{"tags":["projects"],"summary":"Create Project","description":"Create a new project and initialize its Chatwoot user atomically.","operationId":"create_project_projects_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["projects"],"summary":"List Projects","description":"List all projects with retraining status.","operationId":"list_projects_projects_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectWithStatus"},"title":"Response List Projects Projects Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}":{"get":{"tags":["projects"],"summary":"Get Assistant","description":"Get a specific project with retraining status.","operationId":"get_assistant_projects__project_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectWithStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["projects"],"summary":"Update Assistant","description":"Update a project.","operationId":"update_assistant_projects__project_id__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["projects"],"summary":"Delete Assistant","description":"Delete a project and its project_user. Custom projects can only be deleted via admin API.","operationId":"delete_assistant_projects__project_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/contacts/search":{"get":{"tags":["projects"],"summary":"Search Contacts","description":"Search for contacts in Chatwoot for a given project.\n\nThis endpoint uses the assistant's Chatwoot user credentials to search contacts.\n\nArgs:\n    project_id: The project ID\n    q: Search query string (searches name, email, phone number)\n    current_user: Authenticated user (from JWT)\n\nReturns:\n    dict: {\"contacts\": list[dict]} with contact objects (id, name, email, phone_number, etc.)","operationId":"search_contacts_projects__project_id__contacts_search_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/settings":{"get":{"tags":["projects"],"summary":"Get Assistant Settings","description":"Get settings for an project.\n\nArgs:\n    project_id: The project ID\n    current_user: Current authenticated user\n\nReturns:\n    ProjectSettingsResponse with current settings\n\nRaises:\n    HTTPException: If assistant not found or access denied","operationId":"get_assistant_settings_projects__project_id__settings_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["projects"],"summary":"Update Assistant Settings","description":"Update settings for an project.\n\nArgs:\n    project_id: The project ID\n    request: Settings to update\n    current_user: Current authenticated user\n\nReturns:\n    ProjectSettingsResponse with updated settings\n\nRaises:\n    HTTPException: If assistant not found or access denied","operationId":"update_assistant_settings_projects__project_id__settings_patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSettingsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/knowledgebases/text":{"post":{"tags":["knowledgebases"],"summary":"Create Text Knowledgebase","description":"Create a new TEXT knowledge base for an project. Status will be ADDED until manual training.","operationId":"create_text_knowledgebase_projects__project_id__knowledgebases_text_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextKnowledgeBaseCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/knowledgebases/faq":{"post":{"tags":["knowledgebases"],"summary":"Create Faq Knowledgebase","description":"Create a new FAQ knowledge base for an project. Status will be ADDED until manual training.","operationId":"create_faq_knowledgebase_projects__project_id__knowledgebases_faq_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FAQKnowledgeBaseCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/knowledgebases/snippets":{"post":{"tags":["knowledgebases"],"summary":"Create Snippets Knowledgebase","description":"Create a new SNIPPETS knowledge base for a project.\n\nSnippets are ideal for catalogs, collections, product lists, etc.\nEach snippet has its own title and content, and becomes a separate vector node during training.\nStatus will be ADDED until manual training.","operationId":"create_snippets_knowledgebase_projects__project_id__knowledgebases_snippets_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnippetsKnowledgeBaseCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/knowledgebases/file":{"post":{"tags":["knowledgebases"],"summary":"Create File Knowledgebase","description":"Upload a file and create a FILE knowledge base for an project.\n\nThe file is stored as a binary blob and will be processed during training.\nSupported file types:\n- Text files (.txt, .md): processed directly as UTF-8\n- Documents (.pdf, .docx, .xlsx, .pptx): converted to markdown via LlamaParse\n\nStatus will be ADDED until manual training.","operationId":"create_file_knowledgebase_projects__project_id__knowledgebases_file_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_file_knowledgebase_projects__project_id__knowledgebases_file_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/knowledgebases":{"get":{"tags":["knowledgebases"],"summary":"List Knowledgebases","description":"List all knowledge bases for an assistant.\n\nArchived KBs are excluded by default — pass ``include_archived=true`` to see them\n(the read model carries ``is_archived``). ``GET /knowledgebases/{id}`` always resolves\nan archived KB.\n\n``include_playbook_usage=true`` is the one place usage is exposed for both archivable\nresource types (API tools use the identical flag on ``GET /projects/{id}/api-tools``):\neach item becomes a ``KnowledgeBaseWithUsage`` carrying ``used_by_playbooks``, the\nassistants whose active or latest version references the KB. The archive dialog reads\nit to say \"N assistants use this — they keep using it\"; combine it with\n``include_archived=true`` to get usage for an already-archived KB too.\n\nArgs:\n    project_id: The assistant/project ID\n    include_final_delete: Include permanently deleted KBs (for playbook editor warnings)\n    include_playbook_usage: Include which assistants (active or latest version) use each KB\n    include_archived: Include archived KBs","operationId":"list_knowledgebases_projects__project_id__knowledgebases_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"include_final_delete","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Final Delete"}},{"name":"include_playbook_usage","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Playbook Usage"}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBase"}},{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBaseWithUsage-Output"}}],"title":"Response List Knowledgebases Projects  Project Id  Knowledgebases Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{knowledgebase_id}":{"get":{"tags":["knowledgebases"],"summary":"Get Knowledgebase","description":"Get a specific knowledge base. Accepts full UUID or last-5 short id.","operationId":"get_knowledgebase_knowledgebases__knowledgebase_id__get","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["knowledgebases"],"summary":"Update Knowledgebase","description":"Update a knowledge base (TEXT or FAQ only, FILE not allowed). Creates backup and sets status to EDITED.\n\nA rename to a title a live sibling already holds answers 409 — enforced in\n``storage.update_knowledgebase``, and only when the normalized title actually\nchanges, so the editor re-sending the current title is always a plain content\nedit even for the duplicate titles production already has.","operationId":"update_knowledgebase_knowledgebases__knowledgebase_id__patch","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["knowledgebases"],"summary":"Delete Knowledgebase","description":"Deprecated alias of POST /knowledgebases/{knowledgebase_id}/archive.\n\nKept so existing integrations do not 404. It archives — it no longer marks\nthe KB DELETED for the next sync to purge its embeddings, and it no longer\nrefuses while an active assistant uses the KB, because archiving leaves that\nassistant's retrieval untouched.","operationId":"delete_knowledgebase_knowledgebases__knowledgebase_id__delete","deprecated":true,"parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{knowledgebase_id}/file":{"get":{"tags":["knowledgebases"],"summary":"Get Knowledgebase File","description":"Serve the original uploaded file for a FILE knowledge base.","operationId":"get_knowledgebase_file_knowledgebases__knowledgebase_id__file_get","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{knowledgebase_id}/items":{"patch":{"tags":["knowledgebases"],"summary":"Patch Knowledgebase Items","description":"Add, update or delete single FAQ / snippet items without resending the rest.\n\n``PATCH /knowledgebases/{id}`` replaces the whole item list, so editing one FAQ\nmeans resending all of them — and whatever a caller leaves out is deleted.\nHere ``add`` items carry no id (the server assigns it), ``update`` items name an\nexisting id plus only the fields to change (correction notes are kept), and\n``delete`` names existing ids. The patch is validated as a whole and applied\nunder a row lock: any invalid part refuses everything (400/404/422). Same guards\nand side effects as a full PATCH: admin only, archived → 409, training → 409,\nbackup + status EDITED, and it needs a sync to go live.","operationId":"patch_knowledgebase_items_knowledgebases__knowledgebase_id__items_patch","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBItemsPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBItemsPatchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{knowledgebase_id}/archive":{"post":{"tags":["knowledgebases"],"summary":"Archive Knowledgebase","description":"Archive a knowledge base — hide it from the list without deleting anything.\n\nKnowledge bases are never deleted: the row, its content, its notes and its\nembeddings all survive, and the archive is reversible from POST /unarchive.\nNothing is re-indexed and no training is queued.\n\nArchiving does NOT pull the KB out of retrieval: assistant versions that\nalready reference it keep searching it, including the active one. What changes\nis that NEW references are refused (409 on playbook create/update) and the KB is\nfrozen for editing (PATCH, rollback, re-imports and notes answer 409).\n\nAn in-use KB archives like any other — there is no \"used by\" refusal, because\narchiving changes nothing at runtime. To stop an assistant from using a KB,\nremove the reference from the assistant (that is versioned and reversible).\nIdempotent.","operationId":"archive_knowledgebase_knowledgebases__knowledgebase_id__archive_post","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{knowledgebase_id}/unarchive":{"post":{"tags":["knowledgebases"],"summary":"Unarchive Knowledgebase","description":"Un-archive a knowledge base — bring it back to the list. Idempotent.\n\nAlso brings back a legacy pre-sync soft-deleted KB (status DELETED) by\nclearing the flag and restoring its previous status.\n\nRefused with 409 when another live KB of the project now holds this one's\ntitle: titles are unique among the live KBs of a project so the assistant\neditor's picker is unambiguous, and one of the two has to be renamed first.","operationId":"unarchive_knowledgebase_knowledgebases__knowledgebase_id__unarchive_post","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{knowledgebase_id}/restore":{"post":{"tags":["knowledgebases"],"summary":"Restore Knowledgebase Endpoint","description":"Deprecated alias of POST /knowledgebases/{knowledgebase_id}/unarchive.","operationId":"restore_knowledgebase_endpoint_knowledgebases__knowledgebase_id__restore_post","deprecated":true,"parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{knowledgebase_id}/rollback":{"post":{"tags":["knowledgebases"],"summary":"Rollback Knowledgebase Endpoint","description":"Undo the last unsynced change. For ADDED: discards the never-indexed draft row\n(the one discard the workspace keeps). For EDITED: restores the previous version.","operationId":"rollback_knowledgebase_endpoint_knowledgebases__knowledgebase_id__rollback_post","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{knowledgebase_id}/download":{"get":{"tags":["knowledgebases"],"summary":"Download Knowledgebase","description":"Download a knowledge base as JSON.","operationId":"download_knowledgebase_knowledgebases__knowledgebase_id__download_get","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{knowledgebase_id}/items/{item_id}":{"get":{"tags":["knowledgebases"],"summary":"Get Knowledgebase Item","description":"Get metadata for a specific item within a knowledge base.\n\nUsed by frontend to resolve item titles from item_ids returned in KB search results.\nSupports: snippets, FAQ, Notion pages, and Intercom articles.","operationId":"get_knowledgebase_item_knowledgebases__knowledgebase_id__items__item_id__get","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBItemMetadata"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{knowledgebase_id}/pending-changes":{"get":{"tags":["knowledgebases"],"summary":"Get Pending Changes","description":"Return the item-level diff for a knowledge base pending training.\n\nFor item-based KBs (snippets, FAQ, Notion, Intercom, GDrive), compares\nthe current items against the backup stored in ``previous_version_id``\nand buckets differences into added / edited / deleted lists. This lets\nthe UI surface which specific articles will change before the user\nsubmits the next training job.\n\nReturns an empty response when the KB is not item-based, has no backup\n(e.g. was never trained since creation), or is not in the EDITED state.","operationId":"get_pending_changes_knowledgebases__knowledgebase_id__pending_changes_get","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingChangesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/notes":{"get":{"tags":["knowledgebases"],"summary":"List Project Notes","description":"List all correction notes across all KBs in a project (archived KBs on request).","operationId":"list_project_notes_projects__project_id__notes_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/correction-log":{"get":{"tags":["knowledgebases"],"summary":"Get Correction Log","description":"Flat, newest-first feed of correction notes across every KB in the project\n(archived KBs on request).","operationId":"get_correction_log_projects__project_id__correction_log_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CorrectionLogEntry"},"title":"Response Get Correction Log Projects  Project Id  Correction Log Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{knowledgebase_id}/notes":{"get":{"tags":["knowledgebases"],"summary":"Get Kb Notes","description":"Get the KB-level correction notes (TEXT / FILE KBs only).","operationId":"get_kb_notes_knowledgebases__knowledgebase_id__notes_get","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["knowledgebases"],"summary":"Add Kb Note","description":"Append a correction note on the KB itself. Applied to every retrieved chunk.","operationId":"add_kb_note_knowledgebases__knowledgebase_id__notes_post","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddNoteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["knowledgebases"],"summary":"Delete Kb Note","description":"Remove a KB-level note by exact text match.","operationId":"delete_kb_note_knowledgebases__knowledgebase_id__notes_delete","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveNoteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["knowledgebases"],"summary":"Edit Kb Note","description":"Replace a KB-level note's text — matches on `old_note`, writes `new_note`.","operationId":"edit_kb_note_knowledgebases__knowledgebase_id__notes_put","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditNoteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{knowledgebase_id}/items/{item_id}/notes":{"get":{"tags":["knowledgebases"],"summary":"Get Item Notes","description":"Get correction notes for a specific KB item.","operationId":"get_item_notes_knowledgebases__knowledgebase_id__items__item_id__notes_get","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["knowledgebases"],"summary":"Add Item Note","description":"Add a correction note to a KB item.","operationId":"add_item_note_knowledgebases__knowledgebase_id__items__item_id__notes_post","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddNoteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["knowledgebases"],"summary":"Delete Item Note","description":"Remove a correction note from a KB item by matching text.","operationId":"delete_item_note_knowledgebases__knowledgebase_id__items__item_id__notes_delete","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveNoteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["knowledgebases"],"summary":"Edit Item Note","description":"Edit a correction note — replace old text with new text.","operationId":"edit_item_note_knowledgebases__knowledgebase_id__items__item_id__notes_put","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditNoteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["knowledgebases"],"summary":"Update Item Notes","description":"Add, update, or remove correction notes on a KB item.\n\nSetting notes to null removes them. Notes are injected into RAG search\nresults at query time — no retraining needed.","operationId":"update_item_notes_knowledgebases__knowledgebase_id__items__item_id__notes_patch","parameters":[{"name":"knowledgebase_id","in":"path","required":true,"schema":{"type":"string","title":"Knowledgebase Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemNotesUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/kb-uploads":{"post":{"tags":["knowledgebases"],"summary":"Create Kb Upload Slot","description":"Mint a short-lived, single-use URL for uploading one knowledge-base file.","operationId":"create_kb_upload_slot_projects__project_id__kb_uploads_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBUploadCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBUploadCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kb-uploads/{upload_id}":{"post":{"tags":["knowledgebases"],"summary":"Upload To Slot","description":"Receive the file for a slot, authorised by the Authorization header alone.","operationId":"upload_to_slot_kb_uploads__upload_id__post","parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string","title":"Upload Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBUploadReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/knowledgebases/from-upload":{"post":{"tags":["knowledgebases"],"summary":"Create Knowledgebase From Upload","description":"Turn an uploaded JSON file into a SNIPPETS knowledge base.\n\nThe upload token is not sufficient on its own: this step takes normal admin auth too, and\nchecks that the slot was minted for this project. A token that leaks can therefore write\na file nobody can turn into anything.","operationId":"create_knowledgebase_from_upload_projects__project_id__knowledgebases_from_upload_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBaseFromUpload"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/media":{"get":{"tags":["media"],"summary":"List Media","operationId":"list_media_projects__project_id__media_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(image|document|video|audio)$"},{"type":"null"}],"title":"Kind"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"Substring of title, filename or description","title":"Q"},"description":"Substring of title, filename or description"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated; every tag must be present","title":"Tags"},"description":"Comma-separated; every tag must be present"},{"name":"attributes","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JSON object; every key must hold that value, e.g. {\"location\": \"Palermo\"}","title":"Attributes"},"description":"JSON object; every key must hold that value, e.g. {\"location\": \"Palermo\"}"},{"name":"index_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(pending|ready|failed)$"},{"type":"null"}],"title":"Index Status"}},{"name":"include_facets","in":"query","required":false,"schema":{"type":"boolean","description":"Also return the facet catalog","default":false,"title":"Include Facets"},"description":"Also return the facet catalog"},{"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"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAssetList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["media"],"summary":"Upload Media","description":"Upload one file with whatever is already known about it. Nothing is written by\nAI unless ``generate`` is true; ``index_status`` is ``pending`` only while AI writes it.","operationId":"upload_media_projects__project_id__media_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_media_projects__project_id__media_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaCreateReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/media/facets":{"get":{"tags":["media"],"summary":"List Facets","operationId":"list_facets_projects__project_id__media_facets_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaFacets"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/media/search":{"post":{"tags":["media"],"summary":"Search Media","description":"Search the library in two model calls: filters chosen from the project's attributes\nand kinds of file (tags only as hints), then the files whose description, title, tags\nor attributes match. Filters in\nthe request skip the first call; an empty query skips both.","operationId":"search_media_projects__project_id__media_search_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaSearchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/media/from-url":{"post":{"tags":["media"],"summary":"Import Media From Url","description":"Import a public file by URL, with whatever is already known about it.","operationId":"import_media_from_url_projects__project_id__media_from_url_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaFromUrl"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaCreateReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/media/{asset_id}":{"get":{"tags":["media"],"summary":"Get Media","operationId":"get_media_projects__project_id__media__asset_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"asset_id","in":"path","required":true,"schema":{"type":"string","title":"Asset Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAssetOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["media"],"summary":"Update Media","operationId":"update_media_projects__project_id__media__asset_id__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"asset_id","in":"path","required":true,"schema":{"type":"string","title":"Asset Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAssetPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAssetOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["media"],"summary":"Delete Media","operationId":"delete_media_projects__project_id__media__asset_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"asset_id","in":"path","required":true,"schema":{"type":"string","title":"Asset Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/media/bulk":{"post":{"tags":["media"],"summary":"Bulk Update Media","description":"Set the same facets/tags on many files at once.","operationId":"bulk_update_media_projects__project_id__media_bulk_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaBulkPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAssetList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/media/{asset_id}/generate":{"post":{"tags":["media"],"summary":"Generate Media Metadata","description":"Write title, description and tags with AI, now. Only empty fields are filled\nunless ``overwrite`` is true. Takes a few seconds: the model reads the file.","operationId":"generate_media_metadata_projects__project_id__media__asset_id__generate_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"asset_id","in":"path","required":true,"schema":{"type":"string","title":"Asset Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/MediaGenerateRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaGenerateResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/media/bulk-generate":{"post":{"tags":["media"],"summary":"Bulk Generate Media Metadata","description":"Queue AI generation for many files. Each shows ``index_status=pending`` until done.","operationId":"bulk_generate_media_metadata_projects__project_id__media_bulk_generate_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaBulkGenerate"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaBulkGenerateResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/media/uploads":{"post":{"tags":["media"],"summary":"Create Media Upload","description":"Mint a single-use URL to upload one file of any size (up to the limit), with its\nmetadata fixed now. POST the raw bytes to ``upload_url`` with ``upload_headers``.","operationId":"create_media_upload_projects__project_id__media_uploads_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUploadCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUploadCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/media-uploads/{upload_id}":{"post":{"tags":["media"],"summary":"Upload To Media Slot","description":"Receive the file for a slot minted with ``POST /projects/{id}/media/uploads``.\n\nAuthorised by the slot's bearer token in the Authorization header, and nothing\nelse. One upload per slot: a second POST, a wrong token and an expired slot all\nanswer the same 401.","operationId":"upload_to_media_slot_media_uploads__upload_id__post","parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string","title":"Upload Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaCreateReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases":{"get":{"tags":["bases"],"summary":"List Bases","description":"The bases of the account's space, in Bases' order: the live ones unless ``archived`` says\n``include`` (all) or ``only``.","operationId":"list_bases_bases_get","parameters":[{"name":"archived","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(exclude|include|only)$"},{"type":"null"}],"title":"Archived"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}},"post":{"tags":["bases"],"summary":"Create Base","description":"A base from a template (``crm`` makes three, related), or blank. 201; 200 with ``dryRun``.","operationId":"create_base_bases_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/people":{"get":{"tags":["bases"],"summary":"List People","description":"The account's users: the values a ``person`` property takes.","operationId":"list_people_bases_people_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/bases/query":{"post":{"tags":["bases"],"summary":"Sql Query","description":"``{query, params?, dryRun?}``: one ``SELECT`` (or ``EXPLAIN``) → ``{columns, rows, rowCount, truncated}``.","operationId":"sql_query_bases_query_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/execute":{"post":{"tags":["bases"],"summary":"Sql Execute","description":"``{query, params?, dryRun?}``: one INSERT, UPDATE, ARCHIVE, UNARCHIVE or upsert →\n``{statement, count, ids, dryRun}``.","operationId":"sql_execute_bases_execute_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/schema":{"post":{"tags":["bases"],"summary":"Sql Schema","description":"``{query, dryRun?}``: DDL (CREATE/ALTER/ARCHIVE TABLE, indexes), admins only → ``{base, summary}``.","operationId":"sql_schema_bases_schema_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}":{"get":{"tags":["bases"],"summary":"Get Base","description":"The base, its views and counts; ``archivedProperties=true`` adds the archived columns.","operationId":"get_base_bases__table_id__get","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"archivedProperties","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Archivedproperties"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/bases/{table_id}/archive":{"post":{"tags":["bases"],"summary":"Archive Base","description":"Archive the base: it reads as before and refuses every write (409 ``base_archived``) until it is\nunarchived. Never purged.","operationId":"archive_base_bases__table_id__archive_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/unarchive":{"post":{"tags":["bases"],"summary":"Unarchive Base","operationId":"unarchive_base_bases__table_id__unarchive_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/schema":{"post":{"tags":["bases"],"summary":"Change Schema","description":"Every schema edit: add, rename, options, defaults, archive or restore properties; rename the\nbase; its icon. Removing a property archives it (``restore_property`` brings it back).","operationId":"change_schema_bases__table_id__schema_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/views":{"post":{"tags":["bases"],"summary":"Create View","operationId":"create_view_bases__table_id__views_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/views/{view_id}":{"put":{"tags":["bases"],"summary":"Replace View","description":"Replaces the whole view: what the body leaves out goes back to its default.","operationId":"replace_view_bases__table_id__views__view_id__put","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"view_id","in":"path","required":true,"schema":{"type":"string","title":"View Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["bases"],"summary":"Delete View","description":"A saved view is a way of looking at the records, not data: it is removed, not archived.","operationId":"delete_view_bases__table_id__views__view_id__delete","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"view_id","in":"path","required":true,"schema":{"type":"string","title":"View Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/bases/{table_id}/records/search":{"post":{"tags":["bases"],"summary":"Search Records","description":"Bases' search body; ``archived`` (exclude by default, include, only) passes through.","operationId":"search_records_bases__table_id__records_search_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/records/count":{"post":{"tags":["bases"],"summary":"Count Records","operationId":"count_records_bases__table_id__records_count_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/records/aggregate":{"post":{"tags":["bases"],"summary":"Aggregate Records","operationId":"aggregate_records_bases__table_id__records_aggregate_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/records/batch":{"post":{"tags":["bases"],"summary":"Batch Records","description":"``{records: [{props}]}``, up to 500, created in one transaction → ``{records}``.","operationId":"batch_records_bases__table_id__records_batch_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/records/update":{"post":{"tags":["bases"],"summary":"Update Records","description":"``{ids?|filter?, q?, props, dryRun?}``: the same props on up to 500 records → ``{count, ids}``.","operationId":"update_records_bases__table_id__records_update_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/records/upsert":{"post":{"tags":["bases"],"summary":"Upsert Records","description":"``{key, records: [{props}], dryRun?}``: update the match by key, create the rest → ``{created, updated}``.","operationId":"upsert_records_bases__table_id__records_upsert_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/records/archive":{"post":{"tags":["bases"],"summary":"Archive Records","description":"``{ids?, filter?, q?, dryRun?}``: up to 500, all or nothing → ``{count, ids}``.","operationId":"archive_records_bases__table_id__records_archive_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/records/unarchive":{"post":{"tags":["bases"],"summary":"Unarchive Records","operationId":"unarchive_records_bases__table_id__records_unarchive_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/records":{"post":{"tags":["bases"],"summary":"Create Record","operationId":"create_record_bases__table_id__records_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/records/{record_id}":{"get":{"tags":["bases"],"summary":"Get Record","operationId":"get_record_bases__table_id__records__record_id__get","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}},{"name":"expand","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^relations$"},{"type":"null"}],"title":"Expand"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}},"patch":{"tags":["bases"],"summary":"Update Record","description":"``{props, version?}``; a stale ``version`` is Bases' 409 ``version_conflict`` with ``current``;\nan archived record is 409 ``record_archived``.","operationId":"update_record_bases__table_id__records__record_id__patch","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/records/{record_id}/archive":{"post":{"tags":["bases"],"summary":"Archive Record","description":"``{version?}`` → ``{record, changes}``. An archived record keeps its comments and history.","operationId":"archive_record_bases__table_id__records__record_id__archive_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/records/{record_id}/unarchive":{"post":{"tags":["bases"],"summary":"Unarchive Record","operationId":"unarchive_record_bases__table_id__records__record_id__unarchive_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/records/{record_id}/history":{"get":{"tags":["bases"],"summary":"Record History","operationId":"record_history_bases__table_id__records__record_id__history_get","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":500,"minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/bases/{table_id}/records/{record_id}/comments":{"post":{"tags":["bases"],"summary":"Comment Record","operationId":"comment_record_bases__table_id__records__record_id__comments_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/records/{record_id}/undo":{"post":{"tags":["bases"],"summary":"Undo Record","description":"Reverts the record's last change.","operationId":"undo_record_bases__table_id__records__record_id__undo_post","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"record_id","in":"path","required":true,"schema":{"type":"string","title":"Record Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"type":"object","additionalProperties":true},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/bases/{table_id}/export":{"get":{"tags":["bases"],"summary":"Export Base","description":"The base as a file, streamed (what existed when the export started); live records unless\n``archived`` says otherwise.","operationId":"export_base_bases__table_id__export_get","parameters":[{"name":"table_id","in":"path","required":true,"schema":{"type":"string","title":"Table Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(csv|json)$","default":"csv","title":"Format"}},{"name":"archived","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(exclude|include|only)$"},{"type":"null"}],"title":"Archived"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/projects/{project_id}/knowledgebases/notion":{"post":{"tags":["notion"],"summary":"Create Notion Knowledgebase","description":"Create a new Notion knowledge base and import pages.\n\nThis endpoint:\n1. Validates the Notion API key\n2. Validates access to the specified page\n3. Imports the page and all its subpages recursively\n4. Stores encrypted API key for future re-imports","operationId":"create_notion_knowledgebase_projects__project_id__knowledgebases_notion_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotionKnowledgeBaseCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{kb_id}/notion/reimport":{"post":{"tags":["notion"],"summary":"Reimport Notion Knowledgebase","description":"Re-import pages from Notion, overwriting existing content.\n\nReturns list of manually edited pages that were overwritten as a warning.","operationId":"reimport_notion_knowledgebase_knowledgebases__kb_id__notion_reimport_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotionReimportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{kb_id}/notion/credentials":{"patch":{"tags":["notion"],"summary":"Update Notion Credentials","description":"Update the Notion API key for a knowledge base.","operationId":"update_notion_credentials_knowledgebases__kb_id__notion_credentials_patch","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotionCredentialsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{kb_id}/notion/items/{item_id}":{"patch":{"tags":["notion"],"summary":"Update Notion Item","description":"Update a single Notion page's content.\n\nMarks the item as manually edited so we can warn before overwriting on reimport.","operationId":"update_notion_item_knowledgebases__kb_id__notion_items__item_id__patch","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotionItemUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotionItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/notion/validate":{"post":{"tags":["notion"],"summary":"Validate Notion Credentials","description":"Validate Notion API key and optionally page/database access.\n\nThis endpoint can be used to test credentials before creating a knowledge base.\nIt will detect whether the provided ID refers to a page or a database.","operationId":"validate_notion_credentials_notion_validate_post","parameters":[{"name":"api_key","in":"query","required":true,"schema":{"type":"string","title":"Api Key"}},{"name":"page_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotionValidateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/notion/preview-job":{"post":{"tags":["notion"],"summary":"Start Notion Preview Job","description":"Start an async preview job for Notion import.\n\nThis creates a job that fetches all pages in the background.\nPoll GET /import-jobs/{job_id} for progress until status is 'completed'.\n\nIn reimport mode (kb_id provided), api_key and page_id are optional.\nMissing values will be fetched from the existing KB's stored credentials.","operationId":"start_notion_preview_job_notion_preview_job_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotionPreviewJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotionPreviewJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gdrive/config":{"get":{"tags":["gdrive"],"summary":"Get Gdrive Config","description":"Get Google Drive integration configuration.\n\nReturns the service account email that users need to share their folders with.","operationId":"get_gdrive_config_gdrive_config_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GDriveConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/knowledgebases/gdrive":{"post":{"tags":["gdrive"],"summary":"Create Gdrive Knowledgebase","description":"Create a new Google Drive knowledge base and import files.\n\nUses server-side service account credentials.\n\nThis endpoint:\n1. Validates access to the specified folder/file\n2. Imports all files recursively (for folders)","operationId":"create_gdrive_knowledgebase_projects__project_id__knowledgebases_gdrive_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GDriveKBCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{kb_id}/gdrive/reimport":{"post":{"tags":["gdrive"],"summary":"Reimport Gdrive Knowledgebase","description":"Re-import files from Google Drive, overwriting existing content.\n\nUses server-side service account credentials.\nReturns list of manually edited files that were overwritten as a warning.","operationId":"reimport_gdrive_knowledgebase_knowledgebases__kb_id__gdrive_reimport_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GDriveReimportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{kb_id}/gdrive/items/{item_id}":{"patch":{"tags":["gdrive"],"summary":"Update Gdrive Item","description":"Update a single Google Drive file's content.\n\nMarks the item as manually edited so we can warn before overwriting on reimport.","operationId":"update_gdrive_item_knowledgebases__kb_id__gdrive_items__item_id__patch","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GDriveItemUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GDriveItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gdrive/validate":{"post":{"tags":["gdrive"],"summary":"Validate Gdrive Folder","description":"Validate folder/file access using server-side service account credentials.\n\nThis endpoint is used to verify that the service account has access to the\nspecified folder or file before creating a knowledge base.","operationId":"validate_gdrive_folder_gdrive_validate_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GDriveValidateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GDriveValidateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/gdrive/preview-job":{"post":{"tags":["gdrive"],"summary":"Start Gdrive Preview Job","description":"Start an async preview job for Google Drive import.\n\nThis creates a job that fetches all files in the background.\nPoll GET /import-jobs/{job_id} for progress until status is 'completed'.\n\nNote: Uses server-side service account credentials. The folder must be\nshared with the service account email.","operationId":"start_gdrive_preview_job_gdrive_preview_job_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GDrivePreviewJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GDrivePreviewJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/intercom/validate":{"post":{"tags":["intercom"],"summary":"Validate Intercom Credentials","description":"Validate Intercom API key.\n\nThis endpoint can be used to test credentials before creating a knowledge base.","operationId":"validate_intercom_credentials_intercom_validate_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomValidateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomValidateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/intercom/preview":{"post":{"tags":["intercom"],"summary":"Get Intercom Preview","description":"Get a preview of Intercom articles grouped by collection.\n\nThis is Stage 1 of the two-stage import process. Returns articles\ngrouped by collection so users can select which ones to import.","operationId":"get_intercom_preview_intercom_preview_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomPreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/knowledgebases/intercom":{"post":{"tags":["intercom"],"summary":"Create Intercom Knowledgebase","description":"Create a new Intercom knowledge base and import articles.\n\nThis endpoint:\n1. Validates the Intercom API key\n2. Imports selected articles (or all if none specified)\n3. Stores encrypted API key for future re-imports","operationId":"create_intercom_knowledgebase_projects__project_id__knowledgebases_intercom_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomKnowledgeBaseCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{kb_id}/intercom/reimport":{"post":{"tags":["intercom"],"summary":"Reimport Intercom Knowledgebase","description":"Re-import articles from Intercom, overwriting existing content.\n\nReturns list of manually edited articles that were overwritten as a warning.","operationId":"reimport_intercom_knowledgebase_knowledgebases__kb_id__intercom_reimport_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomReimportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{kb_id}/intercom/credentials":{"patch":{"tags":["intercom"],"summary":"Update Intercom Credentials","description":"Update the Intercom API key for a knowledge base.","operationId":"update_intercom_credentials_knowledgebases__kb_id__intercom_credentials_patch","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomCredentialsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{kb_id}/intercom/items/{item_id}":{"patch":{"tags":["intercom"],"summary":"Update Intercom Item","description":"Update a single Intercom article's content.\n\nMarks the item as manually edited so we can warn before overwriting on reimport.","operationId":"update_intercom_item_knowledgebases__kb_id__intercom_items__item_id__patch","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomItemUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/intercom/preview-job":{"post":{"tags":["intercom"],"summary":"Start Intercom Preview Job","description":"Start an async preview job for Intercom import.\n\nThis creates a job that fetches all articles in the background.\nPoll GET /import-jobs/{job_id} for progress until status is 'completed'.\n\nIntercom API provides total article count, so progress will show percentage.\n\nIn reimport mode (kb_id provided), access_token is optional.\nMissing value will be fetched from the existing KB's stored credentials.","operationId":"start_intercom_preview_job_intercom_preview_job_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomPreviewJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomPreviewJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pylon/validate":{"post":{"tags":["pylon"],"summary":"Validate Pylon Credentials","description":"Validate a Pylon API key by listing accessible knowledge bases.","operationId":"validate_pylon_credentials_pylon_validate_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PylonValidateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PylonValidateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pylon/preview":{"post":{"tags":["pylon"],"summary":"Get Pylon Preview","description":"Synchronous preview of Pylon articles grouped by collection (legacy).","operationId":"get_pylon_preview_pylon_preview_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PylonPreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PylonPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/knowledgebases/pylon":{"post":{"tags":["pylon"],"summary":"Create Pylon Knowledgebase","description":"Create a new Pylon knowledge base and import articles (legacy synchronous path).","operationId":"create_pylon_knowledgebase_projects__project_id__knowledgebases_pylon_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PylonKnowledgeBaseCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{kb_id}/pylon/reimport":{"post":{"tags":["pylon"],"summary":"Reimport Pylon Knowledgebase","description":"Re-import articles from Pylon, overwriting existing content.","operationId":"reimport_pylon_knowledgebase_knowledgebases__kb_id__pylon_reimport_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PylonReimportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{kb_id}/pylon/credentials":{"patch":{"tags":["pylon"],"summary":"Update Pylon Credentials","description":"Update the Pylon API key for a knowledge base.","operationId":"update_pylon_credentials_knowledgebases__kb_id__pylon_credentials_patch","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PylonCredentialsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/knowledgebases/{kb_id}/pylon/items/{item_id}":{"patch":{"tags":["pylon"],"summary":"Update Pylon Item","description":"Update a single Pylon article's content (marks it manually edited).","operationId":"update_pylon_item_knowledgebases__kb_id__pylon_items__item_id__patch","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","title":"Item Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PylonItemUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PylonItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pylon/preview-job":{"post":{"tags":["pylon"],"summary":"Start Pylon Preview Job","description":"Start an async preview job for Pylon import.\n\nCreates a job that fetches all KBs + articles in the background.\nPoll GET /import-jobs/{job_id} for progress until status is 'completed'.","operationId":"start_pylon_preview_job_pylon_preview_job_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PylonPreviewJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PylonPreviewJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/import-jobs/{job_id}":{"get":{"tags":["import-jobs"],"summary":"Get Import Job","description":"Get import job status and progress.\n\nUse this endpoint to poll for progress during the preview phase.\nPoll every 1 second until status is 'completed' or 'failed'.","operationId":"get_import_job_import_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["import-jobs"],"summary":"Cancel Import Job","description":"Cancel and delete an import job.\n\nThis deletes the job and all staged items.","operationId":"cancel_import_job_import_jobs__job_id__delete","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/import-jobs/{job_id}/items":{"get":{"tags":["import-jobs"],"summary":"Get Import Job Items","description":"Get all staged items for an import job.\n\nUse this to display the selection tree after preview completes.\nItems are returned sorted by depth and title.","operationId":"get_import_job_items_import_jobs__job_id__items_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ImportJobItemResponse"},"title":"Response Get Import Job Items Import Jobs  Job Id  Items Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["import-jobs"],"summary":"Update Item Selection","description":"Update selection state for import job items.\n\nUse this to toggle which items will be imported.","operationId":"update_item_selection_import_jobs__job_id__items_patch","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateItemSelectionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/import-jobs/{job_id}/import":{"post":{"tags":["import-jobs"],"summary":"Import From Job","description":"Create a knowledge base from staged import job items.\n\nThis is the fast import step - no network calls, just DB writes.\nOnly selected items are imported.","operationId":"import_from_job_import_jobs__job_id__import_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportFromJobRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportFromJobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/playbooks":{"post":{"tags":["playbooks"],"summary":"Create Playbook","description":"Create a new playbook for an assistant.\n\nFor KAPTION accounts: Creates a Chatwoot user with admin permissions.\nFor STANDALONE accounts: Only creates the playbook in the database.\n\nA brand-new playbook has no active/deployed version yet, so it can't\nreach production — no approval needed for sandbox tokens.","operationId":"create_playbook_projects__project_id__playbooks_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["playbooks"],"summary":"List Playbooks","description":"Get all playbooks for an assistant with inbox deployment information.","operationId":"list_playbooks_projects__project_id__playbooks_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Deleted"}},{"name":"include_versions","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Versions"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PlaybookWithInboxes-Output"},"title":"Response List Playbooks Projects  Project Id  Playbooks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/playbooks/attachments":{"get":{"tags":["playbooks"],"summary":"List Playbook Attachments","description":"kb_ids/api_tools/enrichment_tool_ids for every playbook in the project (latest version each).\n\nBatched counterpart to get_playbook_attachments, for screens listing many\nassistants at once (e.g. the deleted-KB badge on the assistants dashboard).","operationId":"list_playbook_attachments_projects__project_id__playbooks_attachments_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Deleted"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PlaybookAttachments"},"title":"Response List Playbook Attachments Projects  Project Id  Playbooks Attachments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}":{"get":{"tags":["playbooks"],"summary":"Get Playbook","description":"Get a specific playbook by ID.","operationId":"get_playbook_playbooks__playbook_id__get","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["playbooks"],"summary":"Update Playbook","description":"Update a playbook. Creates a version backup automatically and updates Chatwoot user if name changed.","operationId":"update_playbook_playbooks__playbook_id__patch","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["playbooks"],"summary":"Delete Playbook","description":"Deprecated alias of POST /playbooks/{playbook_id}/archive.\n\nKept so existing integrations (and approvals queued before the rename) do\nnot 404. It archives — it has never hard-deleted, and now it does not even\ndrop the inbox deployments.","operationId":"delete_playbook_playbooks__playbook_id__delete","deprecated":true,"parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/latest-version":{"get":{"tags":["playbooks"],"summary":"Get Latest Version Header","description":"The latest non-deleted version's id, number and save time, without the version itself.\n\nCheap enough to poll: the editor asks it when its tab comes back into focus\nand warns when someone saved a newer version meanwhile.","operationId":"get_latest_version_header_playbooks__base_id__latest_version_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LatestVersionHeader"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/latest":{"get":{"tags":["playbooks"],"summary":"Get Latest Playbook","description":"Get the latest version of a playbook by base_id.","operationId":"get_latest_playbook_playbooks__base_id__latest_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["playbooks"],"summary":"Update Latest Playbook","description":"Update the latest version of a playbook by base_id.\n\nSame as PATCH /playbooks/{playbook_id} but always resolves to the\nmost recent version, so callers don't need to fetch the latest ID first.","operationId":"update_latest_playbook_playbooks__base_id__latest_patch","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/button-sets/channels":{"get":{"tags":["playbooks"],"summary":"Get Button Set Channels","description":"How each channel shows a button set: counts, title limits, navigation, chips, how a tap comes back.\n\nThe same table the server applies when it sends a set (app/channel_capabilities.py),\nfor the editor's per-channel preview and its character counters.","operationId":"get_button_set_channels_button_sets_channels_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/button-sets/destinations":{"get":{"tags":["playbooks"],"summary":"Get Button Set Destinations","description":"The Widget Studio destinations a button set item can open, for the editor's picker.\n\nThe union of the published catalogues of the inboxes this assistant is\ndeployed to (ids, labels, kinds and param names only — never a route or a\nURL). Empty without the account's navigation_buttons flag, for standalone\naccounts, or when no inbox publishes one. Never fails on Chatwoot errors.","operationId":"get_button_set_destinations_playbooks__playbook_id__button_sets_destinations_get","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/settings":{"get":{"tags":["playbooks"],"summary":"Get Playbook Settings","description":"Get settings for a playbook.\n\nReturns settings for the playbook (keyed by base_id), or None if no settings exist.","operationId":"get_playbook_settings_playbooks__playbook_id__settings_get","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PlaybookSettings"},{"type":"null"}],"title":"Response Get Playbook Settings Playbooks  Playbook Id  Settings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["playbooks"],"summary":"Update Playbook Settings","description":"Update settings for a playbook.\n\nSettings are stored at the playbook level (keyed by base_id) and apply across all versions.\nThis endpoint creates settings if they don't exist, or updates them if they do.","operationId":"update_playbook_settings_playbooks__playbook_id__settings_patch","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookSettingsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookSettings"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/conversations/{conversation_id}/watches":{"get":{"tags":["playbooks"],"summary":"Get Conversation Watches","description":"Every watch scheduled on a conversation, with every check it made.\n\nThe transcript shows each step as a marker; this is the whole record —\nverdict, every tool call with arguments and result, cost, duration — for\nthe chat log's watch panel and for anyone reading over the API.","operationId":"get_conversation_watches_playbooks__base_id__conversations__conversation_id__watches_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationWatchesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/default-messages":{"get":{"tags":["playbooks"],"summary":"Get Playbook Default Messages","description":"The assistant's canned replies, for the channel that has to send them.\n\nKeyed by base_id — the same id a bridge already uses to talk to\n``/playbooks/{base_id}/active/chat`` — because these are playbook-level\nsettings that apply to every version. Editing them does not cut a new\nversion of the assistant.\n\nA slot that comes back null is one nobody configured: the channel keeps\nwhatever default it shipped with. That is what lets an already-deployed\nbridge start reading this endpoint without changing how it behaves.\n\nAuthentication:\n- JWT token via Authorization header: Bearer <token>\n- API key via X-API-Key header (bridges use this)","operationId":"get_playbook_default_messages_playbooks__base_id__default_messages_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantDefaultMessagesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/settings/webhook-secret":{"post":{"tags":["playbooks"],"summary":"Generate Webhook Secret","description":"Generate a new webhook secret for HMAC signing of winback webhooks.\n\nThis generates a cryptographically secure secret that will be used to sign\nwebhook payloads. The secret is shown only once - copy it immediately.\n\nIf a secret already exists, it will be replaced with a new one.","operationId":"generate_webhook_secret_playbooks__playbook_id__settings_webhook_secret_post","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSecretResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["playbooks"],"summary":"Delete Webhook Secret","description":"Delete the webhook secret for a playbook.\n\nAfter deletion, webhooks will be sent without HMAC signature.","operationId":"delete_webhook_secret_playbooks__playbook_id__settings_webhook_secret_delete","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/archive":{"post":{"tags":["playbooks"],"summary":"Archive Playbook","description":"Archive an assistant — hide it from the list without deleting anything.\n\nAssistants are never deleted: every version, conversation, skill and eval\nsurvives, and the archive is reversible from POST /unarchive.\n\nArchiving does NOT stop production traffic. Callers hitting\n/playbooks/{base_id}/active/chat keep getting answers, because the active\nversion pointer and the inbox deployments are left untouched on purpose. To\nactually stop an assistant from answering, use the kill switch\n(PATCH /playbooks/{playbook_id}/settings with is_disabled=true).","operationId":"archive_playbook_playbooks__playbook_id__archive_post","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/unarchive":{"post":{"tags":["playbooks"],"summary":"Unarchive Playbook","description":"Un-archive an assistant and return its latest version.\n\nClears the archived flag on every version of the base_id, not just the one\naddressed — a half-restored assistant cannot be pinned to an older active\nversion and shows an incomplete version list.","operationId":"unarchive_playbook_playbooks__playbook_id__unarchive_post","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/restore":{"post":{"tags":["playbooks"],"summary":"Restore Playbook","description":"Deprecated alias of POST /playbooks/{playbook_id}/unarchive.","operationId":"restore_playbook_playbooks__playbook_id__restore_post","deprecated":true,"parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/rollback":{"post":{"tags":["playbooks"],"summary":"Rollback Playbook","description":"Rollback a playbook to its previous version.","operationId":"rollback_playbook_playbooks__playbook_id__rollback_post","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/history":{"get":{"tags":["playbooks"],"summary":"Get Playbook History","description":"Get version history for a playbook (without content).","operationId":"get_playbook_history_playbooks__playbook_id__history_get","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PlaybookHistoryItem"},"title":"Response Get Playbook History Playbooks  Playbook Id  History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/versions/{version_number}":{"get":{"tags":["playbooks"],"summary":"Get Playbook Version","description":"Get the full content of a specific version of a playbook.","operationId":"get_playbook_version_playbooks__playbook_id__versions__version_number__get","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"version_number","in":"path","required":true,"schema":{"type":"integer","title":"Version Number"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/attachments":{"get":{"tags":["playbooks"],"summary":"Get Playbook Attachments","description":"Get kb_ids/api_tools/enrichment_tool_ids for one exact playbook version.\n\nThe regular playbook GETs (list/get/latest/active/versions) no longer\ncarry these three fields — dedicated for the handful of UI screens\n(deleted-KB badge, version diff, enrichment-tools dialog) that need them.","operationId":"get_playbook_attachments_playbooks__playbook_id__attachments_get","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookAttachments"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/playbooks/{base_id}/skills":{"get":{"tags":["playbooks"],"summary":"List Playbook Skills","description":"List skills, optionally paginated or selected by exact name.\n\n``include_content=false`` returns the catalog with every ``content`` null\n(``content_chars`` still carries the real size), small enough for an agent to\nenumerate a large catalog before fetching one body by name. Null rather than a\nplaceholder string on purpose: a caller that echoes a listing back into an\nupdate writes null — which SkillUpdate ignores — instead of persisting the\nomission notice as the skill's text.","operationId":"list_playbook_skills_projects__project_id__playbooks__base_id__skills_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":200,"minimum":1},{"type":"null"}],"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"name","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Name"}},{"name":"include_content","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Content"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SkillListItem-Output"},"title":"Response List Playbook Skills Projects  Project Id  Playbooks  Base Id  Skills Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["playbooks"],"summary":"Create Playbook Skill","description":"Create a new skill. Creates a new playbook version.","operationId":"create_playbook_skill_projects__project_id__playbooks__base_id__skills_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/platform-tools":{"get":{"tags":["playbooks"],"summary":"List Platform Tools","description":"The tools the PLATFORM provides, referenced with `{{ platform_tool: slug }}`.\n\nUnlike toolkits there is nothing to connect and nothing to configure, which\nis exactly why they were invisible: no connection row, no pill, no list —\nthe only description of them lived inside the write tools' own text. An\noperator writing a rule needs the slug AND the shape of what comes back,\nbecause the rule branches on that shape.","operationId":"list_platform_tools_projects__project_id__platform_tools_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/playbooks/{base_id}/macro-check":{"get":{"tags":["playbooks"],"summary":"Check Playbook Macros","description":"Resolve every `{{ ... }}` macro in this assistant and report the broken ones.\n\nMacros fail open: one whose target is missing stays in the prompt as literal\ntext, and the assistant answers without the knowledge base, tool or examples\nit was supposed to have. Nothing validates them at save time and the runtime\nwarning is a log line, so this read is the only way to find out before a\ncustomer does.","operationId":"check_playbook_macros_projects__project_id__playbooks__base_id__macro_check_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/playbooks/{base_id}/skills/{skill_name}":{"patch":{"tags":["playbooks"],"summary":"Update Playbook Skill Endpoint","description":"Update a skill. Creates a new playbook version.","operationId":"update_playbook_skill_endpoint_projects__project_id__playbooks__base_id__skills__skill_name__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"skill_name","in":"path","required":true,"schema":{"type":"string","title":"Skill Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["playbooks"],"summary":"Delete Playbook Skill Endpoint","description":"Delete a skill. Creates a new playbook version without the skill.","operationId":"delete_playbook_skill_endpoint_projects__project_id__playbooks__base_id__skills__skill_name__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"skill_name","in":"path","required":true,"schema":{"type":"string","title":"Skill Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/playbooks/{base_id}/skills/condition-check":{"post":{"tags":["playbooks"],"summary":"Check Skill Condition","description":"Dry-run a skill enable_condition: validate it and optionally evaluate it against a sample context.\n\nRead-only (no version is created, no approval is queued for sandbox keys) —\nintended for inline validation in the condition editor and for testing a\ncondition against a real context pasted from the ChatLog context timeline.","operationId":"check_skill_condition_projects__project_id__playbooks__base_id__skills_condition_check_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillConditionCheckRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillConditionCheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/context-keys":{"get":{"tags":["playbooks"],"summary":"List Context Keys","description":"Which keys this assistant's conversation context actually carries, how often, and with which values.\n\nRead-only. Feeds the suggestions in the skill-condition editor and the\n`{{ context: … }}` pill: a condition on a key that never arrives, or on a\nvalue spelled differently from what the channel sends, is a skill silently\noff (conditions fail closed) — so the editor shows what recent production\ntraffic sent instead of leaving the path to memory. Sample = the latest\ncontext snapshot of the most recent `limit` conversations of the last\n`days` days, previews and evals excluded.\n\nA channel can also *declare* keys: the Rumo bridge names, per inbox, the\ncontext paths its route produces. Those are merged in with ``declared_by``\nset, so the editor suggests them before any conversation carried them;\n``coverage`` still counts what actually arrived.","operationId":"list_context_keys_projects__project_id__context_keys_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":90,"title":"Days"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextKeysResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/playbooks/{base_id}/skills/reorder":{"put":{"tags":["playbooks"],"summary":"Reorder Playbook Skills","description":"Reorder skills. Creates a new playbook version with updated order.","operationId":"reorder_playbook_skills_projects__project_id__playbooks__base_id__skills_reorder_put","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"string"},"title":"Skill Names"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/deploy":{"post":{"tags":["playbooks"],"summary":"Deploy Playbook","description":"Deploy a playbook to an inbox.","operationId":"deploy_playbook_playbooks__playbook_id__deploy_post","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookDeploymentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookDeployment"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/deploy/{inbox_id}":{"delete":{"tags":["playbooks"],"summary":"Undeploy Playbook","description":"Remove a playbook deployment from an inbox.","operationId":"undeploy_playbook_playbooks__playbook_id__deploy__inbox_id__delete","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","title":"Inbox Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inboxes/{inbox_id}/playbook":{"get":{"tags":["playbooks"],"summary":"Get Playbook For Inbox","description":"Get the active playbook for an inbox. Only available for KAPTION accounts.","operationId":"get_playbook_for_inbox_inboxes__inbox_id__playbook_get","parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","title":"Inbox Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Playbook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/deployments":{"get":{"tags":["playbooks"],"summary":"List Playbook Deployments","description":"List all deployments for a playbook. Only available for KAPTION accounts.","operationId":"list_playbook_deployments_playbooks__playbook_id__deployments_get","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PlaybookDeployment"},"title":"Response List Playbook Deployments Playbooks  Playbook Id  Deployments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/versions/{version}/chat":{"post":{"tags":["playbooks"],"summary":"Playbook Chat By Version","description":"Chat with a specific playbook version.\n\nAvailable routes:\n- POST /playbooks/{base_id}/versions/{version}/chat\n- POST /playbooks/{base_id}/versions/{version}/preview/chat\n\nPath parameters:\n- base_id: The base ID of the playbook (shared across all versions)\n- version: Version number (e.g., \"1\", \"2\") or \"latest\" for the most recent version\n\nAuthentication:\n- JWT token via Authorization header: Bearer <token>\n- API key via X-API-Key header (for external integrations)","operationId":"playbook_chat_by_version_playbooks__base_id__versions__version__chat_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/versions/{version}/preview/chat":{"post":{"tags":["playbooks"],"summary":"Playbook Chat By Version","description":"Chat with a specific playbook version.\n\nAvailable routes:\n- POST /playbooks/{base_id}/versions/{version}/chat\n- POST /playbooks/{base_id}/versions/{version}/preview/chat\n\nPath parameters:\n- base_id: The base ID of the playbook (shared across all versions)\n- version: Version number (e.g., \"1\", \"2\") or \"latest\" for the most recent version\n\nAuthentication:\n- JWT token via Authorization header: Bearer <token>\n- API key via X-API-Key header (for external integrations)","operationId":"playbook_chat_by_version_playbooks__base_id__versions__version__preview_chat_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/chat":{"post":{"tags":["playbooks"],"summary":"Playbook Chat","description":"Chat with a playbook agent (production-ready endpoint).\n\nAvailable routes:\n- POST /playbooks/{playbook_id}/chat (production)\n- POST /playbooks/{playbook_id}/preview/chat (legacy)\n\nAuthentication:\n- JWT token via Authorization header: Bearer <token>\n- API key via X-API-Key header (for external integrations)\n\nThis implements agent execution with LlamaIndex FunctionAgent:\n1. Create Memory object (auto-loads chat history from chat store)\n2. Compile playbook to FunctionAgent (uses content as system prompt)\n3. Call agent with user message and memory (auto-saves messages to chat store)\n4. Extract structured response (list of events to execute)\n5. Return response with events directly from agent output","operationId":"playbook_chat_playbooks__playbook_id__chat_post","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/preview/chat":{"post":{"tags":["playbooks"],"summary":"Playbook Chat","description":"Chat with a playbook agent (production-ready endpoint).\n\nAvailable routes:\n- POST /playbooks/{playbook_id}/chat (production)\n- POST /playbooks/{playbook_id}/preview/chat (legacy)\n\nAuthentication:\n- JWT token via Authorization header: Bearer <token>\n- API key via X-API-Key header (for external integrations)\n\nThis implements agent execution with LlamaIndex FunctionAgent:\n1. Create Memory object (auto-loads chat history from chat store)\n2. Compile playbook to FunctionAgent (uses content as system prompt)\n3. Call agent with user message and memory (auto-saves messages to chat store)\n4. Extract structured response (list of events to execute)\n5. Return response with events directly from agent output","operationId":"playbook_chat_playbooks__playbook_id__preview_chat_post","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/conversations/{conversation_id}/task":{"post":{"tags":["playbooks"],"summary":"Assign Conversation Task","description":"Assign a task for this conversation to pursue.\n\nDeliberately NOT part of the chat completion: a task is set once and lives\nacross turns, so repeating it on every message would be noise, and it has to\nbe settable at any point of the conversation's life — including before the\nconversation exists, which is why this creates the row when it is missing.\n\nOne live task per conversation. Assigning while another is still running is\na 409: the caller waits for it to be completed or failed. Re-assigning the\ntask that is already running is a no-op, so retries are safe.\n\nQuery parameters:\n- version: which playbook version's catalog to resolve the id against.\n  \"active\" (default) or a version number — the preview passes the version it\n  is testing.","operationId":"assign_conversation_task_playbooks__base_id__conversations__conversation_id__task_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"version","in":"query","required":false,"schema":{"type":"string","default":"active","title":"Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationTaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["playbooks"],"summary":"Get Conversation Task","description":"Read the task this conversation is pursuing, and its latest status.","operationId":"get_conversation_task_playbooks__base_id__conversations__conversation_id__task_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"version","in":"query","required":false,"schema":{"type":"string","default":"active","title":"Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationTaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/conversations/{conversation_id}/task/move":{"post":{"tags":["playbooks"],"summary":"Move Conversation Task","description":"Move the task this conversation is pursuing to another conversation of the same person.\n\nFor a channel that answers in a different conversation from the one the\ntask opened. On Intercom a WhatsApp start sends the template and files it\nunder the contact Intercom picks for that number; when several contacts\nshare the number, the person's reply can land on another one, in another\nconversation (Coder, 2026-11-26: the run stayed on 215477031869424 while the\nperson wrote in 215477031885392, answered by an assistant without the task).\nThe channel sees where the reply landed and moves the task there.\n\nThe run itself moves — same row in the task log, same inputs, nudges and\nassignment date — and the conversation it left gets its slot back. The new\nconversation gets the task marker and a copy of the template that opened\nthe old one, so the reply is read as an answer to it.\n\nRetry-safe: when this conversation has no live task left and the target is\npursuing one, the move already happened and the answer is the target's task.\n\nRaises:\n    HTTPException 400: no target, or the same conversation.\n    HTTPException 403: not an admin — both conversations are production traffic.\n    HTTPException 409: nothing to move (no live task here, or it is not this\n        assistant's), the target is pursuing a task of its own, or the target\n        was handed off to a human.","operationId":"move_conversation_task_playbooks__base_id__conversations__conversation_id__task_move_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"version","in":"query","required":false,"schema":{"type":"string","default":"active","title":"Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationTaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/conversations/start":{"post":{"tags":["playbooks"],"summary":"Start Conversation","description":"Open a conversation to run a task in, and speak first.\n\nThe only endpoint that creates a conversation nobody asked for. Everything\nelse in Studio Chat starts from an inbound message; this starts from a task.\n\nHow it goes\n-----------\n1. The task is checked against the assistant's catalog and takes the\n   conversation's slot — the same slot, marker and run row as any other\n   assignment, so a proactively started task shows up in the task log next\n   to the rest. The ``inputs`` (what this task gets to work with here: the\n   questions to ask, the amount owed) are stored on that run and reach the\n   assistant on every turn, in the task block and through ``{{ input: }}``.\n   ``context`` is the opening turn's, like on /chat, and is not persisted.\n2. The assistant writes its opening line (``opening=\"assistant\"``), running\n   a real turn with the task already in the prompt: tools, knowledge bases\n   and skills all available, because the first message of a collections\n   chase usually needs to know the balance.\n3. The channel named by ``channel_id`` is asked to open the conversation on\n   its platform — ``POST /adapter/v1/conversations/start`` on its adapter,\n   with the platform bearer, like a follow-up — and answers with the\n   platform's id, which becomes the Studio Chat id. The conversation is\n   stamped with that channel, so follow-ups (a task's too) come back\n   through the same adapter.\n\nWhich way the channel reaches them\n----------------------------------\nA channel is not always one way of reaching someone: the same Intercom can\nopen a Messenger conversation, which waits until the person opens the app,\nor send an email, which lands in their inbox. ``transport`` names it, so a\ntask that has to arrive today can say so instead of inheriting whatever the\nbridge defaults to. The adapter declares what it can open (``transports`` in\nits manifest) and an undeclared one is refused with the rest of the\npre-flight, before a turn is spent writing the opener. Left out, the adapter\nkeeps deciding — on Intercom that is the Messenger, which is what every\nstart did before the field existed.\n\nA start is a channel operation\n------------------------------\nThere is no per-assistant webhook: ``proactive_webhook_url`` and the HMAC\nsecret are not read here any more. The channel's manifest is read before\nanything is written — it must declare ``conversation_start`` and route one\nof its inboxes to this assistant — so a channel that cannot open the\nconversation fails the request before the task takes a slot or the\nassistant spends a turn writing an opener nobody would deliver.\n\nWhy the channel mints the id\n----------------------------\nThe platforms disagree about when an id exists: on Intercom the conversation\nid is an *output* of sending the first admin message, while on WhatsApp it\nis the contact, known long before. Letting the adapter answer with the id\ncovers both and keeps today's invariant — the channel's id IS the Studio\nChat id — with no mapping table anywhere.\n\nWhatsApp, and the 24h window\n----------------------------\nOutside the service window the first message must be an approved template,\nso the assistant cannot write it. The caller names it inside the transport\n(``transport: {\"type\": \"whatsapp\", \"template\": {name, language, variables}}``)\n— on the call, never on the task — and the channel's manifest says whether\nthat transport requires one (``templates``). The bridge\nopens with it and reports back what it sent; we record it as a\n``template_opened`` event (not as the assistant's words), and the assistant\npicks the task up on the customer's reply, told that a fixed template it did\nnot write opened the conversation. ``opening=\"channel\"`` with the template in\n``address`` is the older form of the same thing and still works.\n\nErrors:\n- 400: the task id is not in this assistant's catalog; ``channel_id`` is not\n  a channel of this account; its adapter does not declare\n  ``conversation_start``, does not route to this assistant, declares its\n  ``transports`` and the requested one is not among them, or answers 404 on\n  the door (not implemented); a ``transport.template`` for a transport whose manifest\n  takes none (``template_not_accepted``).\n- 403: the account does not have tasks enabled.\n- 409: a task is already running on that conversation, or the id the channel\n  returned already belongs to another conversation.\n- 422: no address or no channel_id to deliver through; no conversation_id on\n  a deliver=false dry run; a dry run of a channel-written opener; no\n  ``transport.template`` where the channel's manifest requires one\n  (``template_required``); both ``transport.template`` and ``template_set_id``.\n- 502: the channel's manifest could not be read, or its adapter could not\n  open the conversation (any other non-2xx, a timeout, no id in the answer).\n\nQuery parameters:\n- version: which playbook version's catalog to resolve the task id against.","operationId":"start_conversation_playbooks__base_id__conversations_start_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"version","in":"query","required":false,"schema":{"type":"string","default":"active","title":"Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartConversationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartConversationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/conversations/{conversation_id}/operator-outbound":{"post":{"tags":["playbooks"],"summary":"Register Operator Outbound","description":"Register an operator-initiated outbound on a conversation.\n\nPersists the outbound as its own assistant row (marked with\n``additional_kwargs[kind] = \"operator_outbound\"``). No agent run, no\nevent processing — just storage.\n\nUse this when the operator/system sends a message (e.g., a WhatsApp HSM\ntemplate) and you want to record it now so that, whenever the user\neventually replies via the chat endpoint, the LLM picks up the\noutbound context automatically.\n\nIf you already have the user reply in hand, prefer\n``prior_assistant_message`` on the chat endpoint — it's the same\npersistence + the agent run in one round trip.\n\nPath parameters:\n- base_id: Playbook base ID (used to resolve project_id; the playbook\n  itself is not invoked — the outbound row is plain assistant content).\n- conversation_id: Conversation identifier used by the chat endpoint.","operationId":"register_operator_outbound_playbooks__base_id__conversations__conversation_id__operator_outbound_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorOutboundRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorOutboundResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/conversations/{conversation_id}/agent-message":{"post":{"tags":["playbooks"],"summary":"Register Agent Message","description":"Record what a human agent wrote to the customer. No agent run.\n\nA channel (the Rumo bridge) calls this for every outgoing, non-private\nmessage a person on the team sends in a conversation its assistant serves.\nThe row is the agent's, not the assistant's: it is stored as\n``role: system`` with ``additional_kwargs.kind = \"agent_message\"`` (plus\n``agent``, ``message_id``, ``created_at``), shown in Activity as the human\nagent's message, and read by the model on its next turn as\n``<human_agent_message>`` — so the assistant knows what the person said and\nnever takes it for its own words or the customer's.\n\nIdempotent on ``message_id``: the same id is stored once (200, ``duplicate: true``).\nPrivate notes are refused (400): the customer never saw them.","operationId":"register_agent_message_playbooks__base_id__conversations__conversation_id__agent_message_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMessageRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentMessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/preview/winback":{"post":{"tags":["playbooks"],"summary":"Trigger Preview Winback","description":"Run one attempt of a follow-up on a preview conversation, now.\n\nWhat the dashboard's \"simulate follow-up\" and the MCP's ``preview_followup``\ncall: nothing is scheduled and nothing waits, the attempt runs as if its\ndelay had just elapsed.\n\nWhich rule: the cron's own choice — the first enabled rule whose tag filter\nand ``enable_condition`` pass (``resolve_winback_rule``), the condition on\nthe preview conversation's latest stored context. Which attempt: ``attempt`` when given,\notherwise the next one of the conversation's current silence — so calling\nthis repeatedly walks the schedule, and a message from the person in\nbetween starts it over, exactly as in production.\n\nWhat the attempt does depends on the attempt:\n\n- one with its own ``instructions`` runs as a turn of the assistant on a\n  follow-up event (``services.followup_steps``), on the version the preview\n  conversation is on. It may write, call tools — for real — or do neither;\n- one without is a message written from the rule's ``message_instructions``.\n\nNot run here: the ``send_mode=llm`` judge (this answers \"what would the\nattempt do\", not \"would it fire\"), delivery, the rule's tag, the ledger.\nPreview conversations only.\n\nFailures come back as 200 with ``success=false`` and a reason in ``error``.","operationId":"trigger_preview_winback_playbooks__base_id__preview_winback_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WinbackTriggerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WinbackTriggerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/inboxes":{"get":{"tags":["playbooks"],"summary":"List Inboxes For Playbook","description":"List all inboxes with information about deployed playbooks,\nincluding version comparison for the specified playbook.","operationId":"list_inboxes_for_playbook_playbooks__playbook_id__inboxes_get","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InboxWithPlaybook"},"title":"Response List Inboxes For Playbook Playbooks  Playbook Id  Inboxes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/active":{"get":{"tags":["playbooks"],"summary":"Get Active Version","description":"Get the active version for a playbook.\n\nReturns the currently designated active version for this playbook.\nIf no active version is set, returns 404.\n\nArgs:\n    base_id: The base ID of the playbook (shared across all versions)","operationId":"get_active_version_playbooks__base_id__active_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveVersionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["playbooks"],"summary":"Set Active Version","description":"Set the active version for a playbook.\n\nDesignates which version should be used when clients call the\n/playbooks/{base_id}/active/chat endpoint.\n\nArgs:\n    base_id: The base ID of the playbook (shared across all versions)\n    request_body: Contains version_number to set as active","operationId":"set_active_version_playbooks__base_id__active_put","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetActiveVersionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveVersionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["playbooks"],"summary":"Remove Active Version","description":"Remove the active version pointer for a playbook.\n\nAfter removal, the /playbooks/{base_id}/active/chat endpoint will return 404.\n\nArgs:\n    base_id: The base ID of the playbook (shared across all versions)","operationId":"remove_active_version_playbooks__base_id__active_delete","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/active/history":{"get":{"tags":["playbooks"],"summary":"Get Active Version History","description":"Get the history of active version changes for a playbook.\n\nReturns a list of all active version changes, ordered by most recent first.\nThis allows users to see the deployment history.\n\nArgs:\n    base_id: The base ID of the playbook (shared across all versions)","operationId":"get_active_version_history_playbooks__base_id__active_history_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveVersionHistoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/active/chat":{"post":{"tags":["playbooks"],"summary":"Playbook Active Chat","description":"Chat with the active version of a playbook.\n\nUses the version designated as \"active\" for this playbook.\nIf no active version is set, returns 404.\n\nAuthentication:\n- JWT token via Authorization header: Bearer <token>\n- API key via X-API-Key header (for external integrations)\n\nArgs:\n    base_id: The base ID of the playbook (shared across all versions)","operationId":"playbook_active_chat_playbooks__base_id__active_chat_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/conversations/{conversation_id}/handoff":{"get":{"tags":["playbooks"],"summary":"Get Conversation Handoff","description":"Whether this conversation was ever handed off, for a channel deciding who answers.\n\nA channel whose platform reopens a session when the customer writes again\n(Bitrix24 open lines invite the bot into every new session) asks this\nbefore running a turn: a lead the assistant already handed to a person\ngoes straight back to a person. ``tags`` let the channel route that\nhandoff the same way the first one went (e.g. contract questions to the\ncontracts team).\n\nA channel that only pauses the assistant for a while reads\n``handoff_age_seconds`` instead: how long ago the latest handoff was\nrecorded, measured here. It is null when there is no handoff to count\nfrom — none happened, it predates the field, or the channel released it\n(``DELETE`` on this same path).\n\nA channel that gives a held conversation back to the assistant opens a\nsection with a recap (``POST …/sections``); ``resumed`` is then true until\nthe assistant hands off again, so the channel resumes it only once.\n\nA conversation Studio Chat has never seen answers ``exists: false`` and\n``has_handoff: false`` rather than 404, so the channel needs no special case.\n\nAuthentication:\n- JWT token via Authorization header: Bearer <token>\n- API key via X-API-Key header (bridges use this)","operationId":"get_conversation_handoff_playbooks__base_id__conversations__conversation_id__handoff_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationHandoffStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["playbooks"],"summary":"Release Conversation Handoff","description":"Give a handed-off conversation back to the assistant.\n\nA channel calls this when its platform closes the conversation or hands it\nback to the assistant, so a pause counted from ``handoff_at`` ends there.\nIt clears the handoff time and nothing else: ``has_handoff`` stays true,\nbecause the conversation was handed off — analytics count it, and a\nchannel that never returns a conversation to the assistant keeps reading\nthat flag.\n\nReleasing a conversation with no handoff, or one Studio Chat has never\nseen, answers ``released: false`` rather than an error: channels send\nthis on every close without knowing which conversations were handed off.\n\nAuthentication:\n- JWT token via Authorization header: Bearer <token>\n- API key via X-API-Key header (bridges use this)","operationId":"release_conversation_handoff_playbooks__base_id__conversations__conversation_id__handoff_delete","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationHandoffRelease"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["playbooks"],"summary":"Mark Conversation Handoff","description":"Mark a conversation as handed off from an external caller.\n\nSaves an error message to the conversation (visible in chat logs) and\nsets has_handoff=True. Used by bridge/proxy integrations when a handoff\noccurs outside the normal AI response flow (e.g., unsupported media).\n\nAuthentication:\n- JWT token via Authorization header: Bearer <token>\n- API key via X-API-Key header (for external integrations)\n\nArgs:\n    base_id: The base ID of the playbook (shared across all versions)\n    conversation_id: The external conversation ID","operationId":"mark_conversation_handoff_playbooks__base_id__conversations__conversation_id__handoff_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ExternalHandoffRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/conversations/{conversation_id}/sections":{"post":{"tags":["playbooks"],"summary":"Open Conversation Section","description":"Open a new section of an existing conversation, with a recap summary.\n\nA \"section\" is a context boundary: subsequent /active/chat completions for\nthis conversation only load history from the section's start, so prior\nsections (e.g. a thread the AI handled before a human took over) don't bleed\ninto the new one. The summary is persisted as a section-marker message — fed\nto the LLM as context and rendered by the FE as a divider.\n\nTypical use: an external bridge re-assigns a conversation back to the AI\nafter a human handoff; it opens a section with a summary of what happened,\nthen sends the user's message to /active/chat as usual.\n\nAuthentication:\n- JWT token via Authorization header: Bearer <token>\n- API key via X-API-Key header (for external integrations)","operationId":"open_conversation_section_playbooks__base_id__conversations__conversation_id__sections_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConversationSectionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/preview/chat/stream":{"post":{"tags":["playbooks"],"summary":"Playbook Preview Chat Stream","description":"Stream a playbook preview chat response via Server-Sent Events.\n\nThis endpoint provides real-time streaming of the agent's response,\nincluding tool calls, reasoning, and the final response.\n\nSSE Event Types:\n- chat_started: Stream connection established\n- tool_call_start: Tool execution beginning\n- tool_call_result: Tool execution complete\n- chat_complete: Final parsed response with events\n- chat_error: Error occurred\n- chat_cancelled: Request was cancelled\n\nArgs:\n    playbook_id: ID of the playbook to preview\n    chat_request: Chat request with conversation_id and user_message\n    current_user: Authenticated user\n    request: FastAPI request for disconnect detection\n\nReturns:\n    StreamingResponse with SSE events","operationId":"playbook_preview_chat_stream_playbooks__playbook_id__preview_chat_stream_post","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/versions/{version}/preview/chat/stream":{"post":{"tags":["playbooks"],"summary":"Playbook Version Preview Chat Stream","description":"Stream a playbook version preview chat response via Server-Sent Events.\n\nThis endpoint provides real-time streaming of the agent's response\nfor a specific playbook version.\n\nArgs:\n    base_id: Base ID of the playbook\n    version: Version number (e.g., \"1\", \"2\") or \"latest\"\n    chat_request: Chat request with conversation_id and user_message\n    current_user: Authenticated user\n    request: FastAPI request for disconnect detection\n\nReturns:\n    StreamingResponse with SSE events","operationId":"playbook_version_preview_chat_stream_playbooks__base_id__versions__version__preview_chat_stream_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/suggestion-playbooks":{"post":{"tags":["suggestion-playbooks"],"summary":"Create Suggestion Playbook","description":"Create v1 of a suggestion playbook for a project.","operationId":"create_suggestion_playbook_projects__project_id__suggestion_playbooks_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestionPlaybookCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestionPlaybook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["suggestion-playbooks"],"summary":"List Suggestion Playbooks","description":"List the latest version of every suggestion playbook in a project.","operationId":"list_suggestion_playbooks_projects__project_id__suggestion_playbooks_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SuggestionPlaybook"},"title":"Response List Suggestion Playbooks Projects  Project Id  Suggestion Playbooks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/suggestion-playbooks/{playbook_id}":{"get":{"tags":["suggestion-playbooks"],"summary":"Get Suggestion Playbook","description":"Fetch a specific version of a suggestion playbook.","operationId":"get_suggestion_playbook_suggestion_playbooks__playbook_id__get","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestionPlaybook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["suggestion-playbooks"],"summary":"Update Suggestion Playbook","description":"Create a new version of a suggestion playbook with the supplied edits.","operationId":"update_suggestion_playbook_suggestion_playbooks__playbook_id__patch","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestionPlaybookUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestionPlaybook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/suggestion-playbooks/{base_id}/versions":{"get":{"tags":["suggestion-playbooks"],"summary":"List Suggestion Playbook Versions","description":"List every version of a suggestion playbook, newest first.","operationId":"list_suggestion_playbook_versions_suggestion_playbooks__base_id__versions_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SuggestionPlaybook"},"title":"Response List Suggestion Playbook Versions Suggestion Playbooks  Base Id  Versions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/suggestion-playbooks/{base_id}/versions/{version_number}":{"get":{"tags":["suggestion-playbooks"],"summary":"Get Suggestion Playbook Version","description":"Fetch a specific version of a suggestion playbook by version number.","operationId":"get_suggestion_playbook_version_suggestion_playbooks__base_id__versions__version_number__get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"version_number","in":"path","required":true,"schema":{"type":"integer","title":"Version Number"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestionPlaybook"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/suggestion-playbooks/{base_id}":{"delete":{"tags":["suggestion-playbooks"],"summary":"Delete Suggestion Playbook","description":"Soft-delete every version of a suggestion playbook.","operationId":"delete_suggestion_playbook_suggestion_playbooks__base_id__delete","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inboxes/{inbox_id}/suggestion-playbook":{"post":{"tags":["suggestion-playbooks"],"summary":"Link Inbox Suggestion Playbook","description":"Link a Chatwoot inbox to a suggestion playbook (upsert by inbox_id).","operationId":"link_inbox_suggestion_playbook_inboxes__inbox_id__suggestion_playbook_post","parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","title":"Inbox Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkInboxSuggestionPlaybookRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxSuggestionPlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["suggestion-playbooks"],"summary":"Get Inbox Suggestion Playbook","description":"Return the suggestion-playbook link for an inbox (404 if not linked).","operationId":"get_inbox_suggestion_playbook_inboxes__inbox_id__suggestion_playbook_get","parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","title":"Inbox Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxSuggestionPlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["suggestion-playbooks"],"summary":"Unlink Inbox Suggestion Playbook","description":"Remove the suggestion-playbook link for an inbox. Idempotent.","operationId":"unlink_inbox_suggestion_playbook_inboxes__inbox_id__suggestion_playbook_delete","parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","title":"Inbox Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/campaigns/{campaign_id}/playbook":{"post":{"tags":["campaigns"],"summary":"Link Campaign To Playbook","description":"Link a Chatwoot campaign to a StudioChat playbook.\n\nCalled by Chatwoot when a campaign is created with an assistant selected.","operationId":"link_campaign_to_playbook_campaigns__campaign_id__playbook_post","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"integer","title":"Campaign Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkCampaignPlaybookRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignPlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["campaigns"],"summary":"Unlink Campaign Playbook","description":"Remove the playbook link from a campaign.","operationId":"unlink_campaign_playbook_campaigns__campaign_id__playbook_delete","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"integer","title":"Campaign Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}},"get":{"tags":["campaigns"],"summary":"Get Campaign Playbook","description":"Get the linked playbook for a campaign.","operationId":"get_campaign_playbook_campaigns__campaign_id__playbook_get","parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"integer","title":"Campaign Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignPlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/campaigns/with-playbooks":{"get":{"tags":["campaigns"],"summary":"List Campaigns With Playbooks","description":"List all campaign-playbook mappings for the account.","operationId":"list_campaigns_with_playbooks_campaigns_with_playbooks_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CampaignPlaybookResponse"},"title":"Response List Campaigns With Playbooks Campaigns With Playbooks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/campaigns/available-assistants":{"get":{"tags":["campaigns"],"summary":"List Available Assistants","description":"List playbooks available for campaign linking.\n\nReturns playbooks that have a PlaybookUser configured (required for\nconversation assignment). Called by Chatwoot campaign form to populate\nthe assistant dropdown.","operationId":"list_available_assistants_campaigns_available_assistants_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AvailableAssistant"},"title":"Response List Available Assistants Campaigns Available Assistants Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-tools":{"post":{"tags":["api-tools"],"summary":"Create Api Tool","description":"Create a new API tool for a project.\n\nThe tool is created at the project level and can be used by any playbook in the project.\nNot referenced by any playbook yet, so it has no effect on production — no\napproval needed for sandbox tokens.\n\nRefused with 409 when a live tool of the project already has the name; an\narchived tool's name is free.","operationId":"create_api_tool_projects__project_id__api_tools_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToolCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTool"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["api-tools"],"summary":"List Api Tools","description":"List API tools for a project.\n\nArgs:\n    project_id: The project ID\n    include_playbook_usage: Include which assistants use each tool\n    include_archived: Also return archived tools (flagged ``is_archived``)\n\nReturns the unarchived tools of the project by default. Archived tools are\nstill live for the assistants that reference them — being off this list is\nthe whole effect of archiving. Legacy ``is_deleted`` rows are never\nreturned: they were removed under the old semantics and are inert.\n\n``include_playbook_usage=true`` is the one place usage is exposed for both\narchivable resource types (knowledge bases use the identical flag on\n``GET /projects/{id}/knowledgebases``): each item becomes an\n``ApiToolWithUsage`` carrying ``used_by_playbooks``, one entry per assistant\nwhose **active or latest** version references the tool — the same definition\nof \"in use\" that ``_project_api_tool_usage`` applies to the approval gate.\nThe archive dialog reads it to say \"N assistants use this — they keep using\nit\"; combine it with ``include_archived=true`` to get usage for an\nalready-archived tool.","operationId":"list_api_tools_projects__project_id__api_tools_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"include_playbook_usage","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Playbook Usage"}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ApiTool"}},{"type":"array","items":{"$ref":"#/components/schemas/ApiToolWithUsage-Output"}}],"title":"Response List Api Tools Projects  Project Id  Api Tools Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-tools/{tool_id}/duplicate":{"post":{"tags":["api-tools"],"summary":"Duplicate Api Tool","description":"Copy an API tool into a new tool of the same project, stored credentials included.\n\nThe panel used to duplicate by reading the tool and posting it back to create.\nReads mask credentials (see ``app/secret_masking.py``), so that copy carried\nbullets and create refused it with a 400 — every tool with an auth header\nfailed to duplicate. Copying row to row here gives the new tool the real value\nwithout it ever leaving the backend.\n\nThe copy is named ``copy-of-<name>`` (``-2``, ``-3``… when taken). Like create,\nit is a tool no playbook references yet, so it needs no approval for sandbox\ntokens. An archived tool can be duplicated (the copy is live); a legacy\n``is_deleted`` row is inert and 404s.","operationId":"duplicate_api_tool_projects__project_id__api_tools__tool_id__duplicate_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"tool_id","in":"path","required":true,"schema":{"type":"string","title":"Tool Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTool"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-tools/{tool_id}":{"get":{"tags":["api-tools"],"summary":"Get Api Tool","description":"Get a specific API tool.\n\nArchived tools resolve too (``is_archived`` says so) — detail pages, Sami\npills, analytics and approvals address tools by id and must keep working\nafter an archive.","operationId":"get_api_tool_projects__project_id__api_tools__tool_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"tool_id","in":"path","required":true,"schema":{"type":"string","title":"Tool Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTool"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["api-tools"],"summary":"Update Api Tool","description":"Update an API tool.\n\nGated by human approval only when the tool is referenced by a playbook's\nactive or latest version — unused tools update directly. An archived tool\ncannot be edited (409): unarchive it first.\n\nA rename is refused with 409 when a live tool of the project already has the\nnew name; an archived tool's name is free.","operationId":"update_api_tool_projects__project_id__api_tools__tool_id__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"tool_id","in":"path","required":true,"schema":{"type":"string","title":"Tool Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToolUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTool"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["api-tools"],"summary":"Delete Api Tool","description":"Deprecated alias of POST /projects/{project_id}/api-tools/{tool_id}/archive.\n\nKept so queued approvals (replayed verbatim as DELETE) and old integrations\ndo not 404. It archives — it has never hard-deleted.","operationId":"delete_api_tool_projects__project_id__api_tools__tool_id__delete","deprecated":true,"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"tool_id","in":"path","required":true,"schema":{"type":"string","title":"Tool Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-tools/{tool_id}/archive":{"post":{"tags":["api-tools"],"summary":"Archive Api Tool","description":"Archive an API tool — there is no delete, and this is not an off switch.\n\nArchiving is organizational: the tool leaves this project's list and the\npickers so nobody reaches for it again. **Every assistant that already\nreferences it keeps calling it, unchanged.** Nothing is removed either —\nthe definition, its usage analytics, alert overrides and async operations\nstay, and every playbook version keeps the tool id, which is what makes\nunarchiving reversible. Idempotent.\n\nTo make an assistant stop using a tool, remove the reference from the\nassistant: that creates a new version and can be rolled back.\n\nAdmin-only; no approval gate, because nothing about live behaviour changes.","operationId":"archive_api_tool_projects__project_id__api_tools__tool_id__archive_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"tool_id","in":"path","required":true,"schema":{"type":"string","title":"Tool Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTool"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-tools/{tool_id}/unarchive":{"post":{"tags":["api-tools"],"summary":"Unarchive Api Tool","description":"Un-archive an API tool: it returns to the list and the pickers.\n\nNothing about runtime changes here either — the tool never stopped serving\nthe assistants that reference it. Idempotent (succeeds when already\nunarchived). Admin-only, no approval gate.\n\nA tool flagged ``is_deleted`` (removed before archiving existed) is NOT\nresurrected by this: those rows stay inert on purpose.\n\nRefused with 409 when another live tool of the project took the name while\nthis one was archived: names are unique among the live tools of a project so\nthe assistant editor's picker is unambiguous, and one of the two has to be\nrenamed first.","operationId":"unarchive_api_tool_projects__project_id__api_tools__tool_id__unarchive_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"tool_id","in":"path","required":true,"schema":{"type":"string","title":"Tool Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiTool"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-tools/test":{"post":{"tags":["api-tools"],"summary":"Test Api Tool","description":"Proxy an API tool test request server-side to avoid browser CORS issues.\n\nFires a one-off request and returns the response — no persisted state, so\nno approval needed for sandbox tokens.\n\n``tool_id`` names a saved tool of the project to take credentials from: any\nheader sent masked is resolved against that tool's stored headers before the\ncall goes out. It is what lets the tool builder — and an MCP client, which\nonly ever sees masked reads — dry-run an existing tool without the real value\never leaving the backend. Without it, a masked header is refused (400) rather\nthan sent as bullets to the upstream.\n\nThe URL comes from the caller, so a stored credential is only filled in when\n``url`` has the saved tool's origin (``origin_accepts``); anywhere else a\nmasked header is refused like an unknown one, and testing against a new host\nmeans typing the value. Filling one in at all is admin-only: the route is\nopen to members for testing with values they typed, but using the account's\nsaved key against its API, on any path and method, is not using the product.","operationId":"test_api_tool_projects__project_id__api_tools_test_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToolTestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-tools/preview-jmespath":{"post":{"tags":["api-tools"],"summary":"Preview Jmespath Endpoint","description":"Apply a JMESPath expression to a sample response and return diagnostics.\n\nUsed by the tool-builder UI to show a live before/after preview of the\nresponse_jmespath filter as the user edits it. Errors (bad syntax, non-JSON\nbody, etc.) are returned in the body — never raised — so the UI can render\nthem inline. No persisted state, so no approval needed for sandbox tokens.","operationId":"preview_jmespath_endpoint_projects__project_id__api_tools_preview_jmespath_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JmespathPreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/custom-toolkits":{"get":{"tags":["custom-toolkits"],"summary":"List Custom Toolkits","description":"List all custom toolkits with connection status for this project.","operationId":"list_custom_toolkits_projects__project_id__custom_toolkits_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomToolkitListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/custom-toolkits/connect":{"post":{"tags":["custom-toolkits"],"summary":"Connect Custom Toolkit","description":"Connect a custom toolkit by providing credentials.\n\nThe connection is tested before saving. If the test fails, returns 400.","operationId":"connect_custom_toolkit_projects__project_id__custom_toolkits_connect_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomToolkitConnectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomToolkitConnectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/custom-toolkits/{toolkit_slug}":{"delete":{"tags":["custom-toolkits"],"summary":"Disconnect Custom Toolkit","description":"Disconnect a custom toolkit from the project.","operationId":"disconnect_custom_toolkit_projects__project_id__custom_toolkits__toolkit_slug__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"toolkit_slug","in":"path","required":true,"schema":{"type":"string","title":"Toolkit Slug"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomToolkitDisconnectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/custom-toolkits/{toolkit_slug}/test":{"post":{"tags":["custom-toolkits"],"summary":"Test Custom Toolkit","description":"Test the stored credentials of a connected custom toolkit.\n\nCalls the toolkit's ``test_connection`` against the currently-saved (encrypted)\ncredentials and returns whether the API responded successfully. Used by the\ninline integrations UI to verify a key after save.","operationId":"test_custom_toolkit_projects__project_id__custom_toolkits__toolkit_slug__test_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"toolkit_slug","in":"path","required":true,"schema":{"type":"string","title":"Toolkit Slug"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomToolkitTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/custom-toolkits/{toolkit_slug}/metadata/{metadata_type}":{"get":{"tags":["custom-toolkits"],"summary":"Get Custom Toolkit Metadata","description":"Fetch dynamic metadata for a connected custom toolkit (e.g., ticket_types).","operationId":"get_custom_toolkit_metadata_projects__project_id__custom_toolkits__toolkit_slug__metadata__metadata_type__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"toolkit_slug","in":"path","required":true,"schema":{"type":"string","title":"Toolkit Slug"}},{"name":"metadata_type","in":"path","required":true,"schema":{"type":"string","title":"Metadata Type"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/slack/test":{"post":{"tags":["custom-toolkits"],"summary":"Send Slack Test Message","description":"Send a test message to a Slack channel via the project's connected Slack toolkit.\n\nUsed by the notification config UIs (reports/monitors/alerts/api-tool-alerts) to\nverify a channel works. Resolves the project's toolkit (OAuth preferred, then bot\ntoken); returns a clean ``{success, error}`` rather than raising on Slack errors.","operationId":"send_slack_test_message_projects__project_id__slack_test_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackTestMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackTestMessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/custom-toolkits/{toolkit_slug}/oauth/start":{"get":{"tags":["custom-toolkits"],"summary":"Start Custom Toolkit Oauth","description":"Begin an OAuth install for an ``auth_type == \"oauth\"`` toolkit.\n\nReturns the provider authorize URL (with a signed, short-lived ``state`` that\nround-trips this project/account). The frontend opens it in a popup; the\nprovider redirects back to the public callback below, which exchanges the\ncode and stores the connection.","operationId":"start_custom_toolkit_oauth_projects__project_id__custom_toolkits__toolkit_slug__oauth_start_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"toolkit_slug","in":"path","required":true,"schema":{"type":"string","title":"Toolkit Slug"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomToolkitOAuthStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/custom-toolkits/oauth/callback":{"get":{"tags":["custom-toolkits"],"summary":"Custom Toolkit Oauth Callback","description":"Public OAuth redirect target. Verifies state, exchanges the code, stores it.\n\nUnauthenticated by design — the provider redirects the user's browser here.\nTrust is carried by the signed, short-lived ``state`` (which is tamper-proof but\nNOT single-use — it is replayable within its TTL). To keep the account binding\nload-bearing, the project/account ownership encoded in the state is re-validated\nbefore storing. Always returns the self-closing popup page.","operationId":"custom_toolkit_oauth_callback_custom_toolkits_oauth_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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/tool-configurations":{"post":{"tags":["custom-toolkits"],"summary":"Create Tool Configuration","description":"Create a tool configuration for a project. Generates a stable short_name.\n\nCreating a pill has no effect until its macro is added to instructions, so\nthis executes directly even for project (``sbs_``) tokens — no approval.","operationId":"create_tool_configuration_projects__project_id__tool_configurations_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolConfigurationCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolConfigurationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["custom-toolkits"],"summary":"List Tool Configurations","description":"List all tool configurations for a project, with in-use / usage info.","operationId":"list_tool_configurations_projects__project_id__tool_configurations_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ToolConfigurationResponse"},"title":"Response List Tool Configurations Projects  Project Id  Tool Configurations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/tool-configurations/test":{"post":{"tags":["custom-toolkits"],"summary":"Test Toolkit Action","description":"Run a toolkit action once, outside any conversation, and return what it answered.\n\nThe counterpart of ``/api-tools/test`` for toolkit actions: the way to see\nwhat a pill does before an assistant calls it. The action runs as the agent\nwould run it — the project's stored credentials, the pill's pinned params —\nbut every input is the caller's: the model's ``arguments``, overrides of\nthe pinned ``params``, and the run the agent would have been in\n(``conversation_id``, ``context``, ``external_user_id``, ``attachments``).\nProduction lets the model choose none of the latter; a test has to be able\nto, or an action bound to the current conversation (closing it) can never\nbe tried.\n\nIt is a real call: an action with side effects sends, creates or closes\nfor real, and the result says so (``side_effects``). Admin-only — it runs\nthe account's stored credentials with caller-chosen inputs, which is what\nconfiguring the pill is, and the route family already says so\n(``role_policy.ADMIN_ONLY_PREFIXES``). The legacy account-wide sandbox\nkey goes through the approval queue for any action with side effects.\nNothing is persisted by this route — not even the per-conversation dedup\nrows (``is_action_test``) — and the run stays out of usage analytics\n(``is_preview``).","operationId":"test_toolkit_action_projects__project_id__tool_configurations_test_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolkitActionTestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/tool-configurations/{config_id}":{"get":{"tags":["custom-toolkits"],"summary":"Get Tool Configuration","description":"Get a single tool configuration, with in-use / usage info.","operationId":"get_tool_configuration_projects__project_id__tool_configurations__config_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"config_id","in":"path","required":true,"schema":{"type":"string","title":"Config Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolConfigurationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["custom-toolkits"],"summary":"Update Tool Configuration","description":"Update a tool configuration's config JSON. short_name stays stable.\n\nIf the pill is referenced in the active or latest version of any playbook\n(instructions or skills), the edit reaches live behavior and is queued for\nhuman approval (202) when the caller is a project (``sbs_``) token. Configs\nnot yet wired into any instruction are updated directly.","operationId":"update_tool_configuration_projects__project_id__tool_configurations__config_id__put","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"config_id","in":"path","required":true,"schema":{"type":"string","title":"Config Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolConfigurationUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolConfigurationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["custom-toolkits"],"summary":"Delete Tool Configuration","description":"Delete a tool configuration.\n\nDeleting a pill that is still referenced in active/latest instructions is\nqueued for human approval (202) for project (``sbs_``) tokens; unused configs\nare deleted directly.","operationId":"delete_tool_configuration_projects__project_id__tool_configurations__config_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"config_id","in":"path","required":true,"schema":{"type":"string","title":"Config Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/custom-toolkits/{toolkit_slug}/status":{"get":{"tags":["custom-toolkits"],"summary":"Get Custom Toolkit Status","description":"Whether a toolkit is connected for this project (prerequisite to use its actions).\n\n``is_connected`` must be true before any of the toolkit's actions can be\nconfigured or called. ``connected_account_id`` is the connection id you pass\nas ``toolkit_connection_id`` when creating a tool configuration.","operationId":"get_custom_toolkit_status_projects__project_id__custom_toolkits__toolkit_slug__status_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"toolkit_slug","in":"path","required":true,"schema":{"type":"string","title":"Toolkit Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomToolkitStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/custom-toolkits/{toolkit_slug}/actions":{"get":{"tags":["custom-toolkits"],"summary":"List Toolkit Actions","description":"List a toolkit's tool actions and the configurable schema of each.\n\nThis is the self-documenting \"what can I configure on this action\" endpoint\n(e.g. the fields of ``INTERCOM_TICKETS_CREATE_TICKET``). Options for\n``select`` fields with a ``metadata_source`` are fetched separately via the\nmetadata endpoint (see ``metadata_sources``). The response also reports\n``is_connected`` — the actions are only usable once the toolkit is connected.","operationId":"list_toolkit_actions_projects__project_id__custom_toolkits__toolkit_slug__actions_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"toolkit_slug","in":"path","required":true,"schema":{"type":"string","title":"Toolkit Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolkitActionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/tool-configurations/{config_id}/schema":{"get":{"tags":["custom-toolkits"],"summary":"Get Tool Configuration Schema","description":"Return the effective, per-attribute view of a single tool configuration.\n\nMerges the stored config with live service metadata so each attribute shows\nits mode (assistant_decides / preconfigured / empty), whether the service\nrequires it, its options, and any conditional dependency — plus a list of\ndetected configuration problems.","operationId":"get_tool_configuration_schema_projects__project_id__tool_configurations__config_id__schema_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"config_id","in":"path","required":true,"schema":{"type":"string","title":"Config Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolConfigEffectiveSchema"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/tool-configuration-audit":{"get":{"tags":["custom-toolkits"],"summary":"Audit Tool Configurations","description":"Audit every tool configuration in the project for misconfigurations.\n\nSurfaces pills where a required attribute is left empty, or a conditional\n(e.g. Intercom \"Submotivo …\") attribute is unset — the exact class of bug\nthat silently 400s at ticket-creation time. In-use configs are listed first.","operationId":"audit_tool_configurations_projects__project_id__tool_configuration_audit_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolConfigAuditResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/custom-tool-usages":{"get":{"tags":["custom-toolkits"],"summary":"List Custom Tool Usages","description":"Map every ``{{ custom_tool: short_name }}`` macro to where it is used.\n\nReturns ``{short_name: [{playbook_base_id, playbook_name, location, version}]}``\nacross the active and latest version of each playbook (instructions + skills).\nUse it to tie a pill (e.g. ``create_ticket_824ce``) back to the skill /\ncasuística that references it.","operationId":"list_custom_tool_usages_projects__project_id__custom_tool_usages_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels":{"get":{"tags":["channels"],"summary":"List Channels","description":"Every channel of the account with its manifest, fetched live and concurrently.\n\nA channel whose adapter does not answer comes back with ``manifest: null`` and\nthe reason in ``error``; the others are unaffected.","operationId":"list_channels_accounts_channels_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["channels"],"summary":"Create Channel","description":"Register an adapter: discover it and fetch its manifest first, save the URL only if it answers.","operationId":"create_channel_accounts_channels_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/voice-numbers":{"get":{"tags":["channels"],"summary":"List Voice Numbers","description":"The account's phone numbers: which assistant answers each one, and the week's calls.\n\nA number is registered by the platform (app/voice/numbers.py); the account\nchanges the assistant on its page. Declared before the ``/{channel_id}`` routes.","operationId":"list_voice_numbers_accounts_channels_voice_numbers_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceNumbersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/voice-numbers/{number_id}":{"get":{"tags":["channels"],"summary":"Get Voice Number","description":"One number: the row, the week, and its last ten calls.","operationId":"get_voice_number_accounts_channels_voice_numbers__number_id__get","parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string","title":"Number Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceNumberDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["channels"],"summary":"Patch Voice Number","description":"Change which assistant answers the number, for the calls to come.\n\nA call in progress keeps the assistant it started with, and a call already\nplaced is answered by the assistant it was placed for (the webhook reads the\ncall's row before the number's).","operationId":"patch_voice_number_accounts_channels_voice_numbers__number_id__patch","parameters":[{"name":"number_id","in":"path","required":true,"schema":{"type":"string","title":"Number Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceNumberPatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceNumberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/x-accounts":{"get":{"tags":["channels"],"summary":"List X Accounts","description":"The account's X accounts: who answers each one, how it is connected, and the week's conversations.","operationId":"list_x_accounts_accounts_channels_x_accounts_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XAccountsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["channels"],"summary":"Create X Account","description":"A new, pending X account: next, its X app's credentials (PUT /x-accounts/{id}/app).","operationId":"create_x_account_accounts_channels_x_accounts_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XAccountCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XAccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/x-accounts/{row_id}":{"get":{"tags":["channels"],"summary":"Get X Account","description":"One X account: the row, the scopes it asks for and its last ten conversations.","operationId":"get_x_account_accounts_channels_x_accounts__row_id__get","parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XAccountDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["channels"],"summary":"Patch X Account","description":"Change the assistant that answers, or switch the account off and on.","operationId":"patch_x_account_accounts_channels_x_accounts__row_id__patch","parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XAccountPatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XAccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["channels"],"summary":"Delete X Account","description":"Unsubscribe, unregister the webhook and revoke the tokens (best effort), then forget the row and its keys.\n\nIts conversations stay. The X app itself is the account's to remove.","operationId":"delete_x_account_accounts_channels_x_accounts__row_id__delete","parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/x-accounts/{row_id}/app":{"put":{"tags":["channels"],"summary":"Set X App","description":"Store the X app's credentials (encrypted) once the bearer token proves to be a working app token.","operationId":"set_x_app_accounts_channels_x_accounts__row_id__app_put","parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XAccountAppRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XAccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/x-accounts/{row_id}/connect/token":{"post":{"tags":["channels"],"summary":"Connect X With Token","description":"Connect with the OAuth 1.0a Access Token and Secret X's console generates for the app's own account.\n\nTraded once for an OAuth 2.0 pair; neither the pasted pair nor the new one\nis ever logged or returned.","operationId":"connect_x_with_token_accounts_channels_x_accounts__row_id__connect_token_post","parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XAccountTokenExchangeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XAccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/x-accounts/{row_id}/xchat/unlock":{"post":{"tags":["channels"],"summary":"Unlock X Chat","description":"Recover the account's XChat keys with its passcode and store them encrypted. The passcode is not kept.\n\nNever retried: X allows a few wrong passcodes before it locks the keys,\nand each wrong one is reported with the attempts left.","operationId":"unlock_x_chat_accounts_channels_x_accounts__row_id__xchat_unlock_post","parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/XAccountUnlockRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XAccountOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/x-accounts/{row_id}/check":{"post":{"tags":["channels"],"summary":"Check X Account","description":"A live look at the connection; re-validates the webhook and recreates missing subscriptions.","operationId":"check_x_account_accounts_channels_x_accounts__row_id__check_post","parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"string","title":"Row Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/XAccountCheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/discover":{"post":{"tags":["channels"],"summary":"Discover Channel","description":"Probe ``GET {base_url}/adapter/v1`` (no auth) so the add dialog can confirm the URL is an adapter.","operationId":"discover_channel_accounts_channels_discover_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelDiscoverRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelDiscoverResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/setup-options":{"get":{"tags":["channels"],"summary":"List Setup Options","description":"The platforms this server can connect through a guided setup. Empty when there is none.\n\nToday that is at most Rumo, served by the adapter in ``RUMO_ADAPTER_URL``.\nThe form is the adapter's own declaration, passed through: this backend\nknows nothing about what a Rumo account needs to be connected.","operationId":"list_setup_options_accounts_channels_setup_options_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelSetupOption"},"title":"Response List Setup Options Accounts Channels Setup Options Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/setup":{"post":{"tags":["channels"],"summary":"Setup Channel","description":"Connect a platform account as a channel through its multi-tenant adapter.\n\nThe order is the design (SPEC §4.6 / §7.4):\n\n1. refuse what we can refuse ourselves, before anything is minted;\n2. mint the adapter's API key and pre-assign the channel id;\n3. ask the adapter — it proves the caller administers the platform account\n   and reserves the tenant before it answers 202;\n4. only then write the row. On ANY other outcome the key is revoked and\n   nothing is written.\n\n``request.params`` and the minted key are secrets in transit. Neither is\nlogged, and an adapter that echoes one back has it scrubbed from its words.","operationId":"setup_channel_accounts_channels_setup_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelSetupRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelSetupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/{channel_id}":{"patch":{"tags":["channels"],"summary":"Patch Channel","description":"Move a registration to a new URL keeping its id.\n\nThe id anchors the stored-config history, so re-registering (delete +\ncreate) is no longer a harmless way to change a URL — it would orphan every\nversion. Verifies the adapter answers at the new URL like create does;\n``verify: false`` is for a move in progress, where it does not answer yet.","operationId":"patch_channel_accounts_channels__channel_id__patch","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelPatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["channels"],"summary":"Delete Channel","description":"Delete a channel. A multi-tenant one is torn down first: adapter, then key, then row (SPEC §7.4).\n\nThe teardown is best effort by design. An adapter that is down must not\nmake a channel undeletable — the operator's intent is to disconnect, and\nthe part that is ours (the API key, the row, the JWT resolution that hangs\nfrom it) is removed regardless. What could not be undone on the platform is\nreported, not hidden. A channel registered by URL is deleted exactly as\nbefore: nothing is sent to its adapter and no key is touched.","operationId":"delete_channel_accounts_channels__channel_id__delete","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/{channel_id}/stored-config":{"get":{"tags":["channels"],"summary":"Get Stored Config","description":"The active stored configuration — the document the adapter polls.\n\nReadable with the account API key: this is how a bridge fetches its own\nconfig every 30 s, with the credential it already holds. ``ETag`` is the\nYAML's sha256 and ``If-None-Match`` answers 304 with no body, so the steady\nstate costs nothing. 404 (``no_stored_config``) while nothing was stored —\na freshly deployed, unconfigured adapter polls right through it.","operationId":"get_stored_config_accounts_channels__channel_id__stored_config_get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"If-None-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-None-Match"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelStoredConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["channels"],"summary":"Put Stored Config","description":"Store a new version and activate it.\n\nOnly YAML *syntax* is checked (it must parse to a mapping): the schema\nbelongs to each adapter's own code and only the adapter can validate it —\nit does, on pull, and refuses without dying, reporting the exact error in\nits status. What is enforced here is the shape a paste accident produces.","operationId":"put_stored_config_accounts_channels__channel_id__stored_config_put","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelStoredConfigPutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelStoredConfigPutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/{channel_id}/stored-config/versions":{"get":{"tags":["channels"],"summary":"List Stored Config Versions","description":"The history, newest first — everything but the YAML itself. Nothing is ever deleted.","operationId":"list_stored_config_versions_accounts_channels__channel_id__stored_config_versions_get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelStoredConfigVersionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/{channel_id}/stored-config/activate":{"post":{"tags":["channels"],"summary":"Activate Stored Config","description":"Point the channel at an existing version. Rollback and roll-forward are both this — nothing is copied.","operationId":"activate_stored_config_accounts_channels__channel_id__stored_config_activate_post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelStoredConfigActivateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelStoredConfigActivateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/{channel_id}/sync-config":{"post":{"tags":["channels"],"summary":"Sync Channel Config","description":"Ask the adapter to apply its stored config now, instead of within its poll.\n\nThe write flow's last mile: store a version, sync, read the result — the\nadapter answers with the applied version, or with the exact refusal, the\nsame snapshot its status carries. 404 when the adapter predates the\nendpoint (it will pick the change up on its own poll), 502 when it cannot\nbe reached.","operationId":"sync_channel_config_accounts_channels__channel_id__sync_config_post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelSyncConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/{channel_id}/setup":{"post":{"tags":["channels"],"summary":"Repair Channel","description":"Re-run the setup of a multi-tenant channel — how a failed or drifted one is repaired (SPEC §4.6 rule 3).\n\nThe channel id is the proof of ownership, so nothing secret is asked for or\nsent: the params carry only the non-secret identity the adapter needs to\nfind the tenant, and ``api_key`` is omitted so it keeps the one it holds.\nAnswers the adapter's SetupRun.","operationId":"repair_channel_accounts_channels__channel_id__setup_post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Repair Channel Accounts Channels  Channel Id  Setup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/{channel_id}/setup-runs/{run_id}":{"get":{"tags":["channels"],"summary":"Get Channel Setup Run","description":"The adapter's SetupRun, verbatim — polled by the dashboard until ``state`` leaves ``running``.\n\n404 when the run does not exist OR belongs to another tenant of the same\nadapter: a run id is not a way to read somebody else's setup.","operationId":"get_channel_setup_run_accounts_channels__channel_id__setup_runs__run_id__get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Channel Setup Run Accounts Channels  Channel Id  Setup Runs  Run Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/{channel_id}/manifest":{"get":{"tags":["channels"],"summary":"Get Channel Manifest","description":"The adapter's manifest, live, enriched with the account's assistants. 502 when it cannot be reached.","operationId":"get_channel_manifest_accounts_channels__channel_id__manifest_get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelManifestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/{channel_id}/config":{"get":{"tags":["channels"],"summary":"Get Channel Config","description":"The adapter's own configuration, redacted by the adapter, fetched live.\n\n404 when the adapter does not serve one (the document is optional in the\nprotocol), 502 when it cannot be reached. Studio Chat stores none of it and\nredacts nothing itself: by the time a document gets here there is no secret\nleft in it.","operationId":"get_channel_config_accounts_channels__channel_id__config_get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/{channel_id}/status":{"get":{"tags":["channels"],"summary":"Get Channel Status","description":"Proxy of the adapter's live Status. 502 when the adapter cannot be reached.","operationId":"get_channel_status_accounts_channels__channel_id__status_get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","description":"Bypass the adapter's 30 s status cache (passed through as ?refresh=1)","default":false,"title":"Refresh"},"description":"Bypass the adapter's 30 s status cache (passed through as ?refresh=1)"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/{channel_id}/rumo/{path}":{"delete":{"tags":["channels"],"summary":"Rumo Extension","description":"Relay one call to the Rumo bridge's own surface: ``{bridge}/rumo/v1/t/{tenant}/{path}``.\n\nThe Rumo channel page in the dashboard is built on this surface (inboxes,\nattribute definitions, routes) and it is not part of the Channel Adapter\nProtocol, so this backend knows nothing about its shape: it checks who is\nasking (members read, admins write), pins the tenant to the channel row,\nrelays the body, and returns the bridge's status and JSON verbatim — the page\nkeys its copy on the bridge's refusal codes. Only the one channel whose\nadapter is ``RUMO_ADAPTER_URL`` has this surface; any other channel is a 404.\n\nA ``PUT`` carries who saved it: ``updated_by`` is stamped with the caller\nwhen the body does not name one.\n\nA write goes through ``require_human``: routing an inbox puts an assistant in\nfront of live traffic — the act deploying a playbook is — so a sandbox key\nqueues it for approval and so does a Rumo MCP connection whose account asks\nfor that (``manage_rumo_routes`` writes through this route). A person in the\ndashboard is untouched.","operationId":"rumo_extension_accounts_channels__channel_id__rumo__path__delete","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["channels"],"summary":"Rumo Extension","description":"Relay one call to the Rumo bridge's own surface: ``{bridge}/rumo/v1/t/{tenant}/{path}``.\n\nThe Rumo channel page in the dashboard is built on this surface (inboxes,\nattribute definitions, routes) and it is not part of the Channel Adapter\nProtocol, so this backend knows nothing about its shape: it checks who is\nasking (members read, admins write), pins the tenant to the channel row,\nrelays the body, and returns the bridge's status and JSON verbatim — the page\nkeys its copy on the bridge's refusal codes. Only the one channel whose\nadapter is ``RUMO_ADAPTER_URL`` has this surface; any other channel is a 404.\n\nA ``PUT`` carries who saved it: ``updated_by`` is stamped with the caller\nwhen the body does not name one.\n\nA write goes through ``require_human``: routing an inbox puts an assistant in\nfront of live traffic — the act deploying a playbook is — so a sandbox key\nqueues it for approval and so does a Rumo MCP connection whose account asks\nfor that (``manage_rumo_routes`` writes through this route). A person in the\ndashboard is untouched.","operationId":"rumo_extension_accounts_channels__channel_id__rumo__path__delete","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["channels"],"summary":"Rumo Extension","description":"Relay one call to the Rumo bridge's own surface: ``{bridge}/rumo/v1/t/{tenant}/{path}``.\n\nThe Rumo channel page in the dashboard is built on this surface (inboxes,\nattribute definitions, routes) and it is not part of the Channel Adapter\nProtocol, so this backend knows nothing about its shape: it checks who is\nasking (members read, admins write), pins the tenant to the channel row,\nrelays the body, and returns the bridge's status and JSON verbatim — the page\nkeys its copy on the bridge's refusal codes. Only the one channel whose\nadapter is ``RUMO_ADAPTER_URL`` has this surface; any other channel is a 404.\n\nA ``PUT`` carries who saved it: ``updated_by`` is stamped with the caller\nwhen the body does not name one.\n\nA write goes through ``require_human``: routing an inbox puts an assistant in\nfront of live traffic — the act deploying a playbook is — so a sandbox key\nqueues it for approval and so does a Rumo MCP connection whose account asks\nfor that (``manage_rumo_routes`` writes through this route). A person in the\ndashboard is untouched.","operationId":"rumo_extension_accounts_channels__channel_id__rumo__path__delete","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["channels"],"summary":"Rumo Extension","description":"Relay one call to the Rumo bridge's own surface: ``{bridge}/rumo/v1/t/{tenant}/{path}``.\n\nThe Rumo channel page in the dashboard is built on this surface (inboxes,\nattribute definitions, routes) and it is not part of the Channel Adapter\nProtocol, so this backend knows nothing about its shape: it checks who is\nasking (members read, admins write), pins the tenant to the channel row,\nrelays the body, and returns the bridge's status and JSON verbatim — the page\nkeys its copy on the bridge's refusal codes. Only the one channel whose\nadapter is ``RUMO_ADAPTER_URL`` has this surface; any other channel is a 404.\n\nA ``PUT`` carries who saved it: ``updated_by`` is stamped with the caller\nwhen the body does not name one.\n\nA write goes through ``require_human``: routing an inbox puts an assistant in\nfront of live traffic — the act deploying a playbook is — so a sandbox key\nqueues it for approval and so does a Rumo MCP connection whose account asks\nfor that (``manage_rumo_routes`` writes through this route). A person in the\ndashboard is untouched.","operationId":"rumo_extension_accounts_channels__channel_id__rumo__path__delete","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"path","in":"path","required":true,"schema":{"type":"string","title":"Path"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/accounts/channels/{channel_id}/directory":{"get":{"tags":["channels"],"summary":"Get Channel Directory","description":"One channel's directory — its inboxes, as its adapter lists them, verbatim.\n\nIds are platform-native strings. It feeds the channel's routing form, where\nan operator picks an assistant per inbox; nothing else reads it. 404 when\nthe adapter cannot list at all (``directory_not_available``, or a build that\npredates the door): \"cannot tell\" is not the same as an empty list. 502 when\nit cannot be reached.","operationId":"get_channel_directory_accounts_channels__channel_id__directory_get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"types","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma list of directory types. Default: inboxes.","title":"Types"},"description":"Comma list of directory types. Default: inboxes."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Case-insensitive substring filter on the name","title":"Q"},"description":"Case-insensitive substring filter on the name"},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Channel Directory Accounts Channels  Channel Id  Directory Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/versions/{version}/voice/session":{"post":{"tags":["voice"],"summary":"Voice Session","operationId":"voice_session_playbooks__base_id__versions__version__voice_session_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/VoiceSessionRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/versions/{version}/voice/conversations/{conversation_id}/tool-calls":{"get":{"tags":["voice"],"summary":"Voice Tool Calls","operationId":"voice_tool_calls_playbooks__base_id__versions__version__voice_conversations__conversation_id__tool_calls_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"since","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Since"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceToolCallsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice/health":{"get":{"tags":["voice-live"],"summary":"Voice Health","description":"For Render's health check on the voice service: the process answers, and what it carries.\n\nAlways 200 while the process runs, draining included: a failing check would get the\ninstance restarted, which is exactly what drops calls.","operationId":"voice_health_voice_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Voice Health Voice Health Get"}}}}}}},"/voice/assets/{name}":{"get":{"tags":["voice-twilio"],"summary":"Voice Asset","description":"A demo line's recordings, for Twilio's <Play>. Public: the same audio for every caller.","operationId":"voice_asset_voice_assets__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice/twilio/incoming":{"post":{"tags":["voice-twilio"],"summary":"Incoming Call","description":"Twilio has a call for one of our numbers: connect it, or tell the caller why not.","operationId":"incoming_call_voice_twilio_incoming_post","parameters":[{"name":"x-twilio-signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Twilio-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voice/twilio/status":{"post":{"tags":["voice-twilio"],"summary":"Call Status","description":"Twilio's status callback: where a call we placed is, and how it ended if nobody answered.","operationId":"call_status_voice_twilio_status_post","parameters":[{"name":"x-twilio-signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Twilio-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/voice/calls":{"post":{"tags":["voice-twilio"],"summary":"Place Call Route","description":"Have the assistant call someone. 202: the call is placed; its status callback says how it goes.","operationId":"place_call_route_playbooks__base_id__voice_calls_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaceCallRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlacedCall"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/kaption/calls":{"post":{"tags":["whatsapp-calls"],"summary":"Receive Call Event","operationId":"receive_call_event_webhooks_kaption_calls_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/kaption/voice/calls/offer":{"post":{"tags":["whatsapp-calls"],"summary":"Offer Call","operationId":"offer_call_kaption_voice_calls_offer_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/kaption/voice/inboxes/{inbox_id}/assistant":{"get":{"tags":["whatsapp-calls"],"summary":"Inbox Assistant","operationId":"inbox_assistant_kaption_voice_inboxes__inbox_id__assistant_get","parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"string","title":"Inbox Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/activity/calls/search":{"get":{"tags":["whatsapp-calls"],"summary":"Search Calls","description":"Calls whose transcript says ``q`` (API.4), from Rumo's transcript search: Studio Chat has no transcripts.","operationId":"search_calls_activity_calls_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":200,"title":"Q"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/activity/calls/{kaption_call_id}":{"get":{"tags":["whatsapp-calls"],"summary":"Get Call","operationId":"get_call_activity_calls__kaption_call_id__get","parameters":[{"name":"kaption_call_id","in":"path","required":true,"schema":{"type":"integer","title":"Kaption Call Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/insights/calls":{"get":{"tags":["whatsapp-calls"],"summary":"Get Insights","operationId":"get_insights_insights_calls_get","parameters":[{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From"}},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To"}},{"name":"inbox_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbox Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/insights/calls/inboxes/{inbox_id}":{"get":{"tags":["whatsapp-calls"],"summary":"Get Inbox Settings","operationId":"get_inbox_settings_insights_calls_inboxes__inbox_id__get","parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"integer","title":"Inbox Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["whatsapp-calls"],"summary":"Patch Inbox Settings","operationId":"patch_inbox_settings_insights_calls_inboxes__inbox_id__patch","parameters":[{"name":"inbox_id","in":"path","required":true,"schema":{"type":"integer","title":"Inbox Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxCallSettingsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/evals/cases/from-call":{"post":{"tags":["whatsapp-calls"],"summary":"Eval Case From Call","operationId":"eval_case_from_call_evals_cases_from_call_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalFromCallRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/url-shortener":{"post":{"tags":["url-shortener"],"summary":"Create Url Shortener","description":"Create a new URL shortener configuration for a project.\n\nOnly one shortener is allowed per project.","operationId":"create_url_shortener_projects__project_id__url_shortener_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlShortenerCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlShortener"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["url-shortener"],"summary":"List Url Shorteners","description":"List all URL shortener configurations for a project.","operationId":"list_url_shorteners_projects__project_id__url_shortener_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UrlShortener"},"title":"Response List Url Shorteners Projects  Project Id  Url Shortener Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/url-shortener/effective":{"get":{"tags":["url-shortener"],"summary":"Get Effective Url Shortener","description":"Return the shortener effectively in use for a project (custom row or native default).\n\nThe UI uses this to know whether URL shortening can be enabled at all. Unlike the\nlist/get endpoints, this never returns auth headers, so the native default's API key\nis not exposed to the client. Registered before the ``/{shortener_id}`` route so\n``effective`` is not mistaken for a shortener id.","operationId":"get_effective_url_shortener_projects__project_id__url_shortener_effective_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlShortenerEffective"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/url-shortener/effective/test":{"post":{"tags":["url-shortener"],"summary":"Test Effective Url Shortener","description":"Test the shortener effectively in use for a project (custom row or native default).\n\nLets the UI verify/use the native default (or the configured one) without needing a\nsaved row or the shortener's secret headers — the call runs server-side. Registered\nbefore the ``/{shortener_id}`` routes so ``effective`` is not parsed as a shortener id.","operationId":"test_effective_url_shortener_projects__project_id__url_shortener_effective_test_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlShortenerTestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlShortenerTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/url-shortener/{shortener_id}":{"get":{"tags":["url-shortener"],"summary":"Get Url Shortener","description":"Get a specific URL shortener configuration.","operationId":"get_url_shortener_projects__project_id__url_shortener__shortener_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"shortener_id","in":"path","required":true,"schema":{"type":"string","title":"Shortener Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlShortener"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["url-shortener"],"summary":"Update Url Shortener","description":"Update a URL shortener configuration.","operationId":"update_url_shortener_projects__project_id__url_shortener__shortener_id__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"shortener_id","in":"path","required":true,"schema":{"type":"string","title":"Shortener Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlShortenerUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlShortener"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["url-shortener"],"summary":"Delete Url Shortener","description":"Delete a URL shortener configuration (soft delete).","operationId":"delete_url_shortener_projects__project_id__url_shortener__shortener_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"shortener_id","in":"path","required":true,"schema":{"type":"string","title":"Shortener Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/url-shortener/{shortener_id}/test":{"post":{"tags":["url-shortener"],"summary":"Test Url Shortener","description":"Test a URL shortener configuration with a sample URL.","operationId":"test_url_shortener_projects__project_id__url_shortener__shortener_id__test_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"shortener_id","in":"path","required":true,"schema":{"type":"string","title":"Shortener Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlShortenerTestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlShortenerTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/url-shortener/test-config":{"post":{"tags":["url-shortener"],"summary":"Test Url Shortener Config","description":"Test a URL shortener with inline configuration (no saved shortener needed).\n\nThis endpoint allows testing a URL shortener configuration before saving it.","operationId":"test_url_shortener_config_projects__project_id__url_shortener_test_config_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlShortenerTestConfigRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UrlShortenerTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/schedule":{"get":{"tags":["schedule"],"summary":"Get Project Schedule","description":"Get the project's schedule (office hours) and all date overrides.\n\nReturns the weekly schedule configuration and all date overrides for the project.\nIf no schedule exists yet, schedule will be null.","operationId":"get_project_schedule_projects__project_id__schedule_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleWithOverrides"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["schedule"],"summary":"Create Project Schedule","description":"Create a new schedule (office hours) for a project.\n\nOnly one schedule is allowed per project.","operationId":"create_project_schedule_projects__project_id__schedule_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectScheduleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectSchedule"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["schedule"],"summary":"Update Project Schedule","description":"Update the project's schedule (office hours).","operationId":"update_project_schedule_projects__project_id__schedule_patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectScheduleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectSchedule"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["schedule"],"summary":"Delete Project Schedule","description":"Delete the project's schedule (office hours).\n\nThis permanently removes the schedule. Date overrides are NOT deleted.","operationId":"delete_project_schedule_projects__project_id__schedule_delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/schedule/overrides":{"get":{"tags":["schedule"],"summary":"List Date Overrides","description":"List all date overrides for a project.","operationId":"list_date_overrides_projects__project_id__schedule_overrides_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DateOverride"},"title":"Response List Date Overrides Projects  Project Id  Schedule Overrides Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["schedule"],"summary":"Create Date Override","description":"Create a new date override for a project.\n\nUse this to mark specific dates as:\n- OOO (Out of Office): set is_available=false\n- Modified hours: set is_available=true and provide override_schedule","operationId":"create_date_override_projects__project_id__schedule_overrides_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DateOverrideCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DateOverride"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/schedule/overrides/{override_id}":{"get":{"tags":["schedule"],"summary":"Get Date Override","description":"Get a specific date override.","operationId":"get_date_override_projects__project_id__schedule_overrides__override_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"override_id","in":"path","required":true,"schema":{"type":"string","title":"Override Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DateOverride"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["schedule"],"summary":"Update Date Override","description":"Update a date override.","operationId":"update_date_override_projects__project_id__schedule_overrides__override_id__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"override_id","in":"path","required":true,"schema":{"type":"string","title":"Override Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DateOverrideUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DateOverride"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["schedule"],"summary":"Delete Date Override","description":"Delete a date override.","operationId":"delete_date_override_projects__project_id__schedule_overrides__override_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"override_id","in":"path","required":true,"schema":{"type":"string","title":"Override Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/followup-hours":{"get":{"tags":["followup-hours"],"summary":"Get Followup Hours","description":"The account's follow-up window, or null when none is set (always open).","operationId":"get_followup_hours_projects__project_id__followup_hours_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/FollowupHours"},{"type":"null"}],"title":"Response Get Followup Hours Projects  Project Id  Followup Hours Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["followup-hours"],"summary":"Put Followup Hours","description":"Set or replace the account's follow-up window.","operationId":"put_followup_hours_projects__project_id__followup_hours_put","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowupHoursUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowupHours"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["followup-hours"],"summary":"Delete Followup Hours","description":"Remove the window: follow-ups go out at any hour again.","operationId":"delete_followup_hours_projects__project_id__followup_hours_delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/schedule":{"get":{"tags":["assistant-schedule"],"summary":"Get Assistant Schedule","description":"Get the assistant's schedule override and all date overrides.\n\nReturns the weekly schedule configuration and all date overrides for the assistant.\nIf no schedule exists yet, schedule will be null.","operationId":"get_assistant_schedule_playbooks__playbook_id__schedule_get","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantScheduleWithOverrides"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["assistant-schedule"],"summary":"Create Assistant Schedule","description":"Create a new schedule override for an assistant.\n\nOnly one schedule is allowed per assistant.","operationId":"create_assistant_schedule_playbooks__playbook_id__schedule_post","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantScheduleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantSchedule"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["assistant-schedule"],"summary":"Update Assistant Schedule","description":"Update the assistant's schedule override.","operationId":"update_assistant_schedule_playbooks__playbook_id__schedule_patch","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantScheduleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantSchedule"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["assistant-schedule"],"summary":"Delete Assistant Schedule","description":"Delete the assistant's schedule override.\n\nThis permanently removes the schedule and all associated date overrides.","operationId":"delete_assistant_schedule_playbooks__playbook_id__schedule_delete","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/schedule/overrides":{"get":{"tags":["assistant-schedule"],"summary":"List Assistant Date Overrides","description":"List all date overrides for an assistant.","operationId":"list_assistant_date_overrides_playbooks__playbook_id__schedule_overrides_get","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AssistantDateOverride"},"title":"Response List Assistant Date Overrides Playbooks  Playbook Id  Schedule Overrides Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["assistant-schedule"],"summary":"Create Assistant Date Override","description":"Create a new date override for an assistant.","operationId":"create_assistant_date_override_playbooks__playbook_id__schedule_overrides_post","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantDateOverrideCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantDateOverride"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/schedule/overrides/{override_id}":{"patch":{"tags":["assistant-schedule"],"summary":"Update Assistant Date Override","description":"Update an assistant date override.","operationId":"update_assistant_date_override_playbooks__playbook_id__schedule_overrides__override_id__patch","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"override_id","in":"path","required":true,"schema":{"type":"string","title":"Override Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantDateOverrideUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantDateOverride"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["assistant-schedule"],"summary":"Delete Assistant Date Override","description":"Delete an assistant date override.","operationId":"delete_assistant_date_override_playbooks__playbook_id__schedule_overrides__override_id__delete","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"override_id","in":"path","required":true,"schema":{"type":"string","title":"Override Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-keys":{"post":{"tags":["api-keys"],"summary":"Create Api Key","description":"Create a new API key for a project.\n\nIMPORTANT: The raw API key is only returned once in this response.\nStore it securely - it cannot be retrieved again.\n\nOnly available for standalone accounts.","operationId":"create_api_key_projects__project_id__api_keys_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectApiKeyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectApiKeyCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["api-keys"],"summary":"List Api Keys","description":"List all API keys for a project.\n\nOnly available for standalone accounts.\nNote: The raw key values are not returned.","operationId":"list_api_keys_projects__project_id__api_keys_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProjectApiKeyResponse"},"title":"Response List Api Keys Projects  Project Id  Api Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-keys/{key_id}":{"get":{"tags":["api-keys"],"summary":"Get Api Key","description":"Get a specific API key.","operationId":"get_api_key_projects__project_id__api_keys__key_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["api-keys"],"summary":"Update Api Key","description":"Update an API key (name, description, or revoke/reactivate).","operationId":"update_api_key_projects__project_id__api_keys__key_id__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectApiKeyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["api-keys"],"summary":"Delete Api Key","description":"Delete an API key permanently.","operationId":"delete_api_key_projects__project_id__api_keys__key_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-keys/{key_id}/rotate":{"post":{"tags":["api-keys"],"summary":"Rotate Api Key","description":"Rotate an API key: generate a fresh secret and invalidate the previous one.\n\nIMPORTANT: The new raw API key is only returned once in this response.\nStore it securely - it cannot be retrieved again. The old key value stops\nworking immediately.\n\nAdmin-only. Only available for standalone accounts.","operationId":"rotate_api_key_projects__project_id__api_keys__key_id__rotate_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectApiKeyCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/demo":{"get":{"tags":["playbook-demos"],"summary":"Get Playbook Demo","description":"Whether this account has public demos, the URLs to share, and the key the demo is on.\n\nNothing to turn on here: the switch is the account's ``public_demos`` feature flag.","operationId":"get_playbook_demo_playbooks__base_id__demo_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookDemoStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/demo/public":{"get":{"tags":["playbook-demos"],"summary":"Get Public Demo Config","description":"What the public demo page needs: names, logo, and a live browser-exposed key.\n\nThe first visit mints key #1; a visit after it expired mints the next one — this is\nwhere rotation happens, on the visit that needs it. 503 while the assistant is\npaused (kill switch), so the page can say so; the chat route would refuse the same way.","operationId":"get_public_demo_config_playbooks__base_id__demo_public_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybookDemoPublicConfig"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/demo/start":{"post":{"tags":["playbook-demos"],"summary":"Start Public Demo","description":"Open a demo conversation with one of the assistant's tasks: the assistant speaks first.\n\nPublic, like the rest of the demo: it answers only while the account's\n``public_demos`` flag is on, and only for a task of the ACTIVE version (with\nthe account's ``tasks`` flag). The conversation id is always minted here and\nalways new — the route never takes one — so a visitor can only ever start a\nconversation of their own, never assign a task to a customer's.\n\nOn whatsapp/web/email the opening turn runs now and comes back in ``reply``;\nthe page continues the conversation on the chat route with its key. On voice\nnothing runs yet: the page opens a call on the returned id, and the call\nopens with the task (app/voice/live/brain.py).","operationId":"start_public_demo_playbooks__base_id__demo_start_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoStartRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/demo/voice/session":{"post":{"tags":["playbook-demos"],"summary":"Open Public Demo Voice Session","description":"A call to the active version from the public demo page: a ticket for its socket.\n\nNo credential: like the config route, it answers only while the account's\n``public_demos`` flag is on (the same switch as the text demos; the\nsuperadmin ``voice`` flag only gates the editor's \"Call\" button). The\nticket is worth one call of at most fifteen minutes on the active version\n(app/voice/live/ticket.py); the visitor never holds a key.\nRate-limited per visitor IP, because each call spends transcription, model and voice.","operationId":"open_public_demo_voice_session_playbooks__base_id__demo_voice_session_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DemoVoiceSessionRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/demo/logo":{"get":{"tags":["playbook-demos"],"summary":"Get Public Demo Logo","description":"The account's logo, for the demo page's brand header. Public while the flag is on.","operationId":"get_public_demo_logo_playbooks__base_id__demo_logo_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/sandbox-key":{"get":{"tags":["sandbox-keys"],"summary":"Get Or Create Sandbox Key","description":"Get the sandbox API key for a project, creating one if it doesn't exist.\n\nUsed by the Skills settings UI to display configuration values.\nWorks for both Kaption and standalone accounts.","operationId":"get_or_create_sandbox_key_projects__project_id__sandbox_key_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__sandbox_keys__SandboxKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/sandbox-key/rotate":{"post":{"tags":["sandbox-keys"],"summary":"Rotate Sandbox Key","description":"Rotate the sandbox API key for a project: invalidate the existing key\nand issue a new one.\n\nAdmin-only. Any sandbox session, skill, or external integration still\nholding the previous token will need to be reconfigured with the new\nvalue before it can authenticate again.","operationId":"rotate_sandbox_key_projects__project_id__sandbox_key_rotate_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__sandbox_keys__SandboxKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/jobs/{job_id}":{"get":{"tags":["jobs"],"summary":"Get Job","description":"Get the status of a training job.","operationId":"get_job_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/jobs":{"get":{"tags":["jobs"],"summary":"List Jobs","description":"List all training jobs for an project.","operationId":"list_jobs_projects__project_id__jobs_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Job"},"title":"Response List Jobs Projects  Project Id  Jobs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/train":{"post":{"tags":["jobs"],"summary":"Train Assistant Manually","description":"Manually trigger training for an project. Applies all pending knowledge base changes.","operationId":"train_assistant_manually_projects__project_id__train_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/suggestion":{"post":{"tags":["suggestions"],"summary":"Get Suggestion","description":"Get a suggestion for replying to a conversation (playground endpoint).\n\nThis endpoint is used by the playground/UI to test suggestions.\nRequires JWT authentication via CurrentUser dependency.\n\nThis endpoint uses a three-step RAG process (skips triage):\n1. Generate an optimal search query from the conversation\n2. Retrieve relevant knowledge base nodes\n3. Generate final suggestion based on retrieved information","operationId":"get_suggestion_projects__project_id__suggestion_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutosuggestionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutosuggestionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/suggestion/rewrite-for-attachment":{"post":{"tags":["suggestions"],"summary":"Rewrite Suggestion For Attachment","description":"Rewrite a suggestion message for attachment delivery.\n\nThis endpoint takes a suggestion text with file URLs replaced by placeholders\n(e.g., <attachment-1>, <attachment-2>) and rewrites it to naturally reference\nthe attachments instead of including raw URLs.\n\n**Frontend workflow:**\n1. Extract file URLs from the suggestion text\n2. Replace each URL with a placeholder: <attachment-1>, <attachment-2>, etc.\n3. Call this endpoint with the text and filenames\n4. Receive the rewritten message\n5. Fetch files from original URLs and send via SDK\n\n**Why placeholders?**\n- Saves tokens (URLs can be very long)\n- Prevents LLM from mangling URLs\n- More reliable rewriting\n\nRequest body:\n    - suggestion_text: Text with placeholders (e.g., \"Here is the file: <attachment-1>\")\n    - filenames: List of filenames in order (e.g., [\"report.pdf\"])\n    - conversation_context: Optional conversation history for language detection\n\nReturns:\n    AttachmentRewriteResponse with rewritten message","operationId":"rewrite_suggestion_for_attachment_projects__project_id__suggestion_rewrite_for_attachment_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentRewriteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachmentRewriteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/suggestion":{"post":{"tags":["suggestions"],"summary":"Get Production Suggestion","description":"Get a pre-calculated suggestion for replying to a conversation (production endpoint).\n\nThis endpoint returns suggestions that were pre-calculated in the background when\nmessages arrived. Suggestions are cached and returned instantly if available.\n\n**Pre-calculation workflow:**\n1. When ANY user message arrives via webhook for an account with assistants,\n   the suggestion is calculated in the background (regardless of deployment mode)\n2. The calculated suggestion is cached in Redis (or in-memory if Redis not available)\n3. When this endpoint is called, the cached suggestion is returned immediately\n\n**Assistant selection:**\n- If a deployment exists for the inbox, uses that assistant and personality tone\n- Otherwise, uses the first assistant for the account with default (professional) tone\n- Works for ALL accounts with assistants, deployment mode is no longer relevant\n\n**Cache behavior:**\n- Each new message invalidates the previous suggestion\n- Only one suggestion per conversation is stored at a time\n- Suggestions expire after 24 hours (configurable via SUGGESTION_CACHE_TTL)\n\nAuthentication:\n    Requires X-API-Key header with valid API key (set in KAPTBASE_API_KEY env var)\n\nRequest body:\n    - account_id: Account ID\n    - inbox_id: Inbox ID (optional, only used for logging)\n    - conversation_id: Conversation ID\n    - user_metadata: Optional user metadata (not used, for API compatibility)\n    - agent_prompt: Optional agent prompt (not used, for API compatibility)\n    - language: Optional language (not used, for API compatibility)\n\nReturns:\n    - 200: AutosuggestionResponse with cached suggestion\n    - 202: Suggestion is being calculated, client should retry (includes Retry-After header)\n\nRaises:\n    401: Invalid API key","operationId":"get_production_suggestion_suggestion_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductionAutosuggestionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutosuggestionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/issues":{"post":{"tags":["project-issues"],"summary":"Create Issue","description":"Create a issue. This is the endpoint background agents call.\n\nAuthenticated by a human JWT or a sandbox API key. Deliberately does NOT\ncall ``require_human()``: dropping an informational hint into the inbox is a\nbenign write, not a mutation of customer-facing config, so it must not be\nrouted through the approvals queue.","operationId":"create_issue_projects__project_id__issues_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["project-issues"],"summary":"List Issues","operationId":"list_issues_projects__project_id__issues_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectIssueStatusEnum"},{"type":"null"}],"title":"Status"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectIssueCategoryEnum"},{"type":"null"}],"title":"Category"}},{"name":"include_comments","in":"query","required":false,"schema":{"type":"boolean","description":"Embed each issue's comment thread. On by default so agents get the full picture.","default":true,"title":"Include Comments"},"description":"Embed each issue's comment thread. On by default so agents get the full picture."},{"name":"include_followups","in":"query","required":false,"schema":{"type":"boolean","description":"Embed each issue's follow-ups (re-detections).","default":true,"title":"Include Followups"},"description":"Embed each issue's follow-ups (re-detections)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssuesListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/issues/{suggestion_id}":{"get":{"tags":["project-issues"],"summary":"Get Issue","operationId":"get_issue_issues__suggestion_id__get","parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"integer","title":"Suggestion Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["project-issues"],"summary":"Delete Issue","operationId":"delete_issue_issues__suggestion_id__delete","parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"integer","title":"Suggestion Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/issues/{suggestion_id}/followups":{"post":{"tags":["project-issues"],"summary":"Add Followup","description":"Append a follow-up (a later occurrence/update) to an existing issue.\n\nAgent-callable: this is how a cron agent avoids creating duplicate\nissues for the same problem — it adds new cases to the open issue\ninstead. Reopens the issue if it was resolved (regression).","operationId":"add_followup_issues__suggestion_id__followups_post","parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"integer","title":"Suggestion Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueFollowupCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/issues/{suggestion_id}/comments":{"post":{"tags":["project-issues"],"summary":"Add Comment","description":"Add a human comment/note to a issue (a PR-style discussion thread).\n\nDoes not change the issue's status. To resolve *with* a note, pass\n``note`` to the resolve endpoint, or just add a comment and then resolve.","operationId":"add_comment_issues__suggestion_id__comments_post","parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"integer","title":"Suggestion Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueCommentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/issues/{suggestion_id}/comments/{comment_id}":{"patch":{"tags":["project-issues"],"summary":"Edit Comment","description":"Edit a comment's body. Only the author may edit their own comment.","operationId":"edit_comment_issues__suggestion_id__comments__comment_id__patch","parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"integer","title":"Suggestion Id"}},{"name":"comment_id","in":"path","required":true,"schema":{"type":"string","title":"Comment Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueCommentCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["project-issues"],"summary":"Remove Comment","description":"Delete a comment. Only the author may delete their own comment.","operationId":"remove_comment_issues__suggestion_id__comments__comment_id__delete","parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"integer","title":"Suggestion Id"}},{"name":"comment_id","in":"path","required":true,"schema":{"type":"string","title":"Comment Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/issues/{suggestion_id}/resolve":{"post":{"tags":["project-issues"],"summary":"Resolve Issue","operationId":"resolve_issue_issues__suggestion_id__resolve_post","parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"integer","title":"Suggestion Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectIssueCommentCreate"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/issues/{suggestion_id}/reopen":{"post":{"tags":["project-issues"],"summary":"Reopen Issue","operationId":"reopen_issue_issues__suggestion_id__reopen_post","parameters":[{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"integer","title":"Suggestion Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectIssueCommentCreate"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/issues/notification-config":{"get":{"tags":["project-issues"],"summary":"Get Notification Config","description":"Return the project's issue notification config.\n\nIf none exists yet, return a default-disabled config so the FE always has a\nshape to render (is_enabled False, no recipients, per-event toggles on).","operationId":"get_notification_config_projects__project_id__issues_notification_config_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueNotificationConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["project-issues"],"summary":"Update Notification Config","description":"Create or update the project's issue notification config.","operationId":"update_notification_config_projects__project_id__issues_notification_config_put","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueNotificationConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssueNotificationConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/lookup":{"post":{"tags":["lookup"],"summary":"Document Lookup","description":"Perform document lookup - search and retrieve relevant documents without LLM suggestion generation.\n\nThis endpoint performs RAG retrieval and returns full documents with LLM-generated explanations\nof why each document is relevant to the query. Unlike the suggestion endpoint, this does not\ngenerate a final response - it only returns the source documents.\n\nRequires JWT authentication via CurrentUser dependency.","operationId":"document_lookup_projects__project_id__lookup_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentLookupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentLookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/kb-search":{"post":{"tags":["lookup"],"summary":"Kb Search","description":"Raw knowledge base retrieval: two-stage (dense wide -> Cohere rerank -> top_n), no LLM synthesis.\n\nUnlike /lookup, this returns the retrieved chunks directly (text + score + metadata) without\ngenerating LLM explanations. The lexical filter prepass and rerank happen inside rag_manager.query().\n\nAuth: session JWT, project API key, admin API key, or an agt_ token holding\nkb.custom:read (CurrentUserOrKbAgent) — the KB builder queries its own corpus\nback through here while sweeping retrieval params.","operationId":"kb_search_projects__project_id__kb_search_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBSearchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/kb-ask":{"post":{"tags":["lookup"],"summary":"Kb Ask","description":"Answer a question over the knowledge base via a minimal one-tool agent.\n\nThis runs the EXACT production ``search_knowledge_base`` tool (same retrieval, same\nmetadata-filter exposure, same [[citation_id]] mechanism playbooks use) behind a tiny\nagent. The test UI hits this endpoint so it behaves identically to the assistant.\n\nAuth: session JWT, project API key, admin API key, or an agt_ token holding\nkb.custom:read (CurrentUserOrKbAgent) — the KB builder queries its own corpus\nback through here while sweeping retrieval params.","operationId":"kb_ask_projects__project_id__kb_ask_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBAskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KBAskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inboxes":{"get":{"tags":["chatwoot"],"summary":"List Inboxes","description":"List all inboxes for the authenticated user's account.\n\nOnly available for KAPTION accounts. Standalone accounts don't use Chatwoot inboxes.","operationId":"list_inboxes_inboxes_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Inboxes Inboxes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/labels":{"get":{"tags":["chatwoot"],"summary":"List Labels","description":"List all labels for the authenticated user's account.\n\nReturns a list of label objects with id, title, description, color, etc.","operationId":"list_labels_labels_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Labels Labels Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agents":{"get":{"tags":["chatwoot"],"summary":"List Agents","description":"List all agents for the authenticated user's account.\n\nReturns a list of agent objects with id, name, email, role, etc.","operationId":"list_agents_agents_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Agents Agents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams":{"get":{"tags":["chatwoot"],"summary":"List Teams","description":"List all teams for the authenticated user's account.\n\nReturns a list of team objects with id, name, description, etc.","operationId":"list_teams_teams_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Teams Teams Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rumo/catalog/flows":{"get":{"tags":["rumo-catalog"],"summary":"List Catalog Flows","description":"The inbox's WhatsApp Flow library in Rumo (summaries), for the flow set editor.","operationId":"list_catalog_flows_rumo_catalog_flows_get","parameters":[{"name":"inbox_id","in":"query","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"title":"Inbox Id"}},{"name":"playbook_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Refresh"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Catalog Flows Rumo Catalog Flows Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rumo/catalog/flows/{flow_id}":{"get":{"tags":["rumo-catalog"],"summary":"Get Catalog Flow","description":"One flow: its screens and field map (the keys a prefill can set).","operationId":"get_catalog_flow_rumo_catalog_flows__flow_id__get","parameters":[{"name":"flow_id","in":"path","required":true,"schema":{"type":"integer","title":"Flow Id"}},{"name":"inbox_id","in":"query","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"title":"Inbox Id"}},{"name":"playbook_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Id"}},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Refresh"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Catalog Flow Rumo Catalog Flows  Flow Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rumo/catalog/templates":{"get":{"tags":["rumo-catalog"],"summary":"List Catalog Templates","description":"The inbox's synced WhatsApp templates, with their variable slots, FLOW buttons and wapreview preview.","operationId":"list_catalog_templates_rumo_catalog_templates_get","parameters":[{"name":"inbox_id","in":"query","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"title":"Inbox Id"}},{"name":"playbook_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Id"}},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Refresh"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Catalog Templates Rumo Catalog Templates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/rumo-sets/validate":{"post":{"tags":["rumo-catalog"],"summary":"Validate Playbook Rumo Sets","description":"Check flow / template sets against Rumo without saving (the editor shows the warnings).","operationId":"validate_playbook_rumo_sets_playbooks__base_id__rumo_sets_validate_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RumoSetsValidateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Validate Playbook Rumo Sets Playbooks  Base Id  Rumo Sets Validate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilot/chat":{"post":{"tags":["copilot"],"summary":"Copilot Chat","description":"Send a message to Copilot and get a response.\n\nThe conversation is automatically created if it doesn't exist.\nAll Copilot conversations are marked as internal and excluded from analytics.\n\nArgs:\n    chat_request: Chat request with conversation_id, user_message, and optional kb_ids/tool_ids\n    current_user: Authenticated user\n    request: FastAPI request object\n\nReturns:\n    CopilotChatResponse with messages, explanation, and elapsed time","operationId":"copilot_chat_copilot_chat_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CopilotChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CopilotChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilot/chat/stream":{"post":{"tags":["copilot"],"summary":"Copilot Chat Stream","description":"SSE streaming endpoint for Copilot chat.\n\nEmits real-time events for tool calls and final response.\nEvents:\n- tool_call_start: When a tool starts executing\n- tool_call_result: When a tool completes\n- response: The final response from the agent\n- done: Signals completion\n- error: If an error occurs","operationId":"copilot_chat_stream_copilot_chat_stream_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CopilotChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilot/conversations":{"get":{"tags":["copilot"],"summary":"List Copilot Conversations","description":"List Copilot conversations for the current account.\n\nReturns conversations sorted by last activity (most recent first).\n\nArgs:\n    current_user: Authenticated user\n    limit: Maximum number of conversations to return (default: 50)\n    offset: Number of conversations to skip (default: 0)\n\nReturns:\n    CopilotConversationsResponse with conversations list and total count","operationId":"list_copilot_conversations_copilot_conversations_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CopilotConversationsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilot/conversations/kaption/{kaption_conversation_id}":{"get":{"tags":["copilot"],"summary":"Get Kaption Copilot Session","description":"Get or prepare a Copilot session for a Kaption conversation.\n\nLooks up an existing Copilot session linked to the specified Kaption conversation\nfor the current agent. If no session exists, returns the conversation_id that\nshould be used to create one.\n\nThe conversation_id format is: \"kaption:{user_id}:{kaption_conversation_id}\"\nThis ensures each agent has their own copilot session per Kaption conversation.\n\nArgs:\n    kaption_conversation_id: Kaption (Chatwoot) conversation ID\n    current_user: Authenticated user (contains account_id and user_id)\n\nReturns:\n    KaptionCopilotSessionResponse with:\n    - conversation_id: ID to use for this session\n    - exists: Whether an existing session was found\n    - message_count: Number of messages in the session (0 if new)","operationId":"get_kaption_copilot_session_copilot_conversations_kaption__kaption_conversation_id__get","parameters":[{"name":"kaption_conversation_id","in":"path","required":true,"schema":{"type":"integer","title":"Kaption Conversation Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KaptionCopilotSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilot/conversations/{conversation_id}/messages":{"get":{"tags":["copilot"],"summary":"Get Copilot Messages","description":"Get messages for a specific Copilot conversation.\n\nArgs:\n    conversation_id: Conversation identifier\n    current_user: Authenticated user\n\nReturns:\n    List of messages in chronological order","operationId":"get_copilot_messages_copilot_conversations__conversation_id__messages_get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CopilotMessage-Output"},"title":"Response Get Copilot Messages Copilot Conversations  Conversation Id  Messages Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilot/conversations/{conversation_id}":{"delete":{"tags":["copilot"],"summary":"Delete Copilot Conversation","description":"Delete a Copilot conversation.\n\nArgs:\n    conversation_id: Conversation identifier\n    current_user: Authenticated user\n\nReturns:\n    204 No Content on success","operationId":"delete_copilot_conversation_copilot_conversations__conversation_id__delete","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilot-embed/{account_id}/{conversation_id}/events":{"get":{"tags":["copilot-embed"],"summary":"Sse Events","description":"SSE endpoint for real-time copilot updates.\n\nStreams events for:\n- New messages arriving via webhooks\n- Suggestion calculation status changes\n- Ready suggestions\n\nAuthentication is via JWT token passed as ?token= query parameter\n(EventSource API doesn't support custom headers).\n\nArgs:\n    account_id: The Kaption account ID\n    conversation_id: The conversation ID\n    current_user: The authenticated user from JWT\n\nReturns:\n    StreamingResponse with SSE events","operationId":"sse_events_copilot_embed__account_id___conversation_id__events_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/copilot-embed/{account_id}/{conversation_id}/session-messages":{"get":{"tags":["copilot-embed"],"summary":"Get Session Messages","description":"Get Chatwoot conversation messages from session store for LLM context.\n\nReturns messages formatted for injection into copilot LLM prompts.\nThis allows the copilot to have context about the ongoing customer conversation.\n\nArgs:\n    account_id: The Kaption account ID\n    conversation_id: The conversation ID\n    current_user: The authenticated user from JWT\n    limit: Maximum number of messages to return (default 50, max 100)\n\nReturns:\n    SessionMessagesResponse with messages and formatted context","operationId":"get_session_messages_copilot_embed__account_id___conversation_id__session_messages_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum number of messages to return","default":50,"title":"Limit"},"description":"Maximum number of messages to return"},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionMessagesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilot-embed/{account_id}/{conversation_id}/suggestion":{"get":{"tags":["copilot-embed"],"summary":"Get Current Suggestion","description":"Get the current cached suggestion for a conversation.\n\nThis is a convenience endpoint to get the current suggestion state\nwithout setting up an SSE connection.\n\nArgs:\n    account_id: The Kaption account ID\n    conversation_id: The conversation ID\n    current_user: The authenticated user from JWT\n\nReturns:\n    Current suggestion state or 202 if calculating","operationId":"get_current_suggestion_copilot_embed__account_id___conversation_id__suggestion_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"integer","title":"Account Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/admin/accounts/{kaption_account_id}/assistants":{"get":{"tags":["admin"],"summary":"Admin List Assistants","description":"List all assistants for an account (Admin API).\n\nThis endpoint is for Kaption team use only.\n\nAuthentication:\n    Requires X-API-Key header with valid admin API key (ADMIN_API_KEY)\n\nArgs:\n    kaption_account_id: Chatwoot account ID to list assistants for\n    api_key: Admin API key from header\n\nReturns:\n    List of assistants for the account\n\nRaises:\n    401: Invalid API key\n    404: Account not found\n    500: Server error","operationId":"admin_list_assistants_admin_accounts__kaption_account_id__assistants_get","parameters":[{"name":"kaption_account_id","in":"path","required":true,"schema":{"type":"integer","title":"Kaption Account Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Project"},"title":"Response Admin List Assistants Admin Accounts  Kaption Account Id  Assistants Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin"],"summary":"Admin Create Custom Assistant","description":"Create a custom assistant for an account (Admin API).\n\nThis endpoint is for Kaption team use only. Custom assistants cannot be modified\nthrough regular API endpoints - they must be managed via admin endpoints or CLI.\n\nThis endpoint now also creates a Chatwoot user and webhook, just like the regular\nassistant creation endpoint.\n\nAuthentication:\n    Requires X-API-Key header with valid admin API key (ADMIN_API_KEY)\n\nArgs:\n    kaption_account_id: Chatwoot account ID to create the assistant for\n    request: Assistant creation details (name and description)\n    api_key: Admin API key from header\n\nReturns:\n    The created custom assistant\n\nRaises:\n    401: Invalid API key\n    404: Account not found\n    500: Server error during creation","operationId":"admin_create_custom_assistant_admin_accounts__kaption_account_id__assistants_post","parameters":[{"name":"kaption_account_id","in":"path","required":true,"schema":{"type":"integer","title":"Kaption Account Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomProjectCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/projects/{project_id}":{"delete":{"tags":["admin"],"summary":"Admin Delete Assistant","description":"Delete an assistant (Admin API).\n\nThis endpoint is for Kaption team use only. Deletes the assistant and all\nassociated data (knowledge bases, deployments, etc.).\n\nAuthentication:\n    Requires X-API-Key header with valid admin API key (ADMIN_API_KEY)\n\nArgs:\n    project_id: Project ID to delete\n    api_key: Admin API key from header\n\nReturns:\n    204 No Content on success\n\nRaises:\n    401: Invalid API key\n    404: Project not found\n    500: Server error during deletion","operationId":"admin_delete_assistant_admin_projects__project_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/projects/{project_id}/knowledgebases":{"get":{"tags":["admin"],"summary":"Admin List Knowledgebases","description":"List all knowledge bases for an assistant (Admin API).\n\nThis endpoint is for Kaption team use only. Admin callers see temporary KBs\n(include_temporary=True) so eval/sweep scratch KBs are visible and manageable —\nunlike the user-facing list which hides them. When kb_type=custom, only CUSTOM\nKBs are returned (each with custom_info populated).\n\nAuthentication:\n    X-API-Key: the shared ADMIN_API_KEY, or an agent token with kb.custom:read\n\nArgs:\n    project_id: Project ID to list knowledge bases for\n    auth: Resolved caller (admin key or scoped agent token)\n    kb_type: Optional KB type filter (e.g. \"custom\")\n    include_deleted: Include soft-deleted KBs\n\nReturns:\n    List of knowledge bases for the assistant (including temporary KBs)\n\nRaises:\n    401: Invalid API key\n    403: Token not allowed to act on this project's account\n    404: Project not found\n    500: Server error","operationId":"admin_list_knowledgebases_admin_projects__project_id__knowledgebases_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"kb_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by KB type (e.g. 'custom'). Omit to list all types.","title":"Kb Type"},"description":"Filter by KB type (e.g. 'custom'). Omit to list all types."},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","description":"Include soft-deleted KBs (status=DELETED)","default":false,"title":"Include Deleted"},"description":"Include soft-deleted KBs (status=DELETED)"},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeBase"},"title":"Response Admin List Knowledgebases Admin Projects  Project Id  Knowledgebases Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin"],"summary":"Admin Create Custom Kb","description":"Create a custom knowledge base for an assistant (Admin API).\n\nThis endpoint is for Kaption team use only. Custom knowledge bases have no content\nfield as they are managed outside the system (e.g., external vector stores).\n\nAuthentication:\n    X-API-Key: the shared ADMIN_API_KEY, or an agent token with kb.custom:write\n\nArgs:\n    project_id: Project ID to add the knowledge base to\n    request: Knowledge base details (title and description)\n    auth: Resolved caller (admin key or scoped agent token)\n\nReturns:\n    The created custom knowledge base\n\nRaises:\n    401: Invalid API key\n    403: Token not allowed to act on this project's account\n    404: Project not found\n    500: Server error during creation","operationId":"admin_create_custom_kb_admin_projects__project_id__knowledgebases_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCustomKBCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/projects/{project_id}/collection":{"post":{"tags":["admin"],"summary":"Admin Set Collection","description":"Set Chroma collection for an assistant and mark all KBs as ACTIVE (Admin API).\n\nThis endpoint associates an existing Chroma collection (by collection_id UUID) with an project.\nUsed for manual collection management or restoring from backups.\n\nAuthentication:\n    Requires X-API-Key header with valid admin API key (ADMIN_API_KEY)\n\nArgs:\n    project_id: Project ID\n    request: Collection configuration (collection_id UUID and database_name)\n    api_key: Admin API key from header\n\nReturns:\n    Success message with count of KBs marked as active\n\nRaises:\n    401: Invalid API key\n    404: Project not found\n    500: Server error during operation","operationId":"admin_set_collection_admin_projects__project_id__collection_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSetCollectionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/knowledgebases/{kb_id}/collection":{"patch":{"tags":["admin"],"summary":"Admin Patch Custom Kb Collection","description":"Patch collection and metadata configuration to a custom knowledge base (Admin API).\n\nThis endpoint associates an existing Chroma collection with a custom knowledge base\nand allows configuring optional instructions and metadata fields. The KB must be\nof type CUSTOM.\n\nAuthentication:\n    Requires X-API-Key header with valid admin API key (ADMIN_API_KEY)\n\nArgs:\n    kb_id: Knowledge base ID (path parameter)\n    request: Collection configuration including collection_id, database_name, and optional fields\n    api_key: Admin API key from header\n\nReturns:\n    The updated knowledge base\n\nRaises:\n    401: Invalid API key\n    404: Knowledge base not found\n    400: Knowledge base is not custom type\n    500: Server error during operation","operationId":"admin_patch_custom_kb_collection_admin_knowledgebases__kb_id__collection_patch","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminSetCustomKBCollectionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/knowledgebases/{kb_id}/retrieval-config":{"patch":{"tags":["admin"],"summary":"Admin Patch Retrieval Config","description":"Patch the retrieval_config of a custom knowledge base (Admin API).\n\nPromotes tuned hyperparameters (e.g. from an eval/sweep) onto the KB. Only the\nnon-None fields in the request are merged onto the KB's existing retrieval_config;\nomitted fields keep their current value. If the KB had no retrieval_config yet, a\ndefault RetrievalConfig is used as the base before merging.\n\nAuthentication:\n    X-API-Key: the shared ADMIN_API_KEY, or an agent token with kb.custom:write\n\nArgs:\n    kb_id: Knowledge base ID (path parameter)\n    request: All-optional retrieval config patch\n    auth: Resolved caller (admin key or scoped agent token)\n\nReturns:\n    The updated knowledge base\n\nRaises:\n    401: Invalid API key\n    403: Token not allowed to act on this KB's account\n    404: Knowledge base not found\n    400: Knowledge base is not custom type\n    500: Server error during operation","operationId":"admin_patch_retrieval_config_admin_knowledgebases__kb_id__retrieval_config_patch","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPatchRetrievalConfigRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/knowledgebases/{kb_id}":{"patch":{"tags":["admin"],"summary":"Admin Patch Custom Kb","description":"Patch top-level fields of a CUSTOM KB (Admin API). Primary use: PROMOTE a temporary\neval KB to definitive in place by setting is_temporary=false (and optionally renaming),\navoiding a re-ingest. Only non-None fields are applied; status is preserved.\n\nAuthentication:\n    X-API-Key: the shared ADMIN_API_KEY, or an agent token with kb.custom:write","operationId":"admin_patch_custom_kb_admin_knowledgebases__kb_id__patch","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPatchCustomKBRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin"],"summary":"Admin Delete Custom Kb","description":"Hard-delete a custom knowledge base and its dedicated Chroma collection (Admin API).\n\nUsed to clean up temporary/scratch KBs after an eval sweep. Custom KBs each own a\nDEDICATED Chroma collection (provisioned at create time), so deleting the collection\nhere never touches a shared/global project collection.\n\nSteps:\n  1. Look up the collection mapping for the KB's chroma_collection_id.\n  2. Best-effort delete the Chroma collection (logged on failure, does not abort).\n  3. Invalidate the cached collection index.\n  4. Delete the collection mapping row.\n  5. Hard-delete the KB row.\n\nAuthentication:\n    X-API-Key: the shared ADMIN_API_KEY, or an agent token with kb.custom:write.\n    An agent token may delete ONLY a temporary KB (see below); a human with the\n    admin key can delete either.\n\nArgs:\n    kb_id: Knowledge base ID (path parameter)\n    auth: Resolved caller (admin key or scoped agent token)\n\nReturns:\n    {kb_id, deleted, collection_deleted}\n\nRaises:\n    401: Invalid API key\n    403: Token not allowed on this account, or KB is not temporary\n    404: Knowledge base not found\n    409: KB is not custom type or has no dedicated Chroma collection\n    500: Server error during deletion","operationId":"admin_delete_custom_kb_admin_knowledgebases__kb_id__delete","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminDeleteCustomKBResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/knowledgebases/{kb_id}/documents":{"post":{"tags":["admin"],"summary":"Admin Ingest Custom Kb Documents","description":"Ingest documents into a custom knowledge base (Admin API).\n\nChunks each document with SentenceSplitter(chunk_size=1024, chunk_overlap=200),\nstamps native + client metadata on every node, embeds and inserts into the KB's\nChroma collection. With upsert=true (default), existing chunks for each doc_id are\ndeleted first. After ingest, recomputes meta__<field> filter values, updates the KB's\ndoc_count / last_ingested_at, and invalidates the cached collection index.\n\nAuthentication:\n    X-API-Key: the shared ADMIN_API_KEY, or an agent token with kb.custom:write\n\nRaises:\n    401: Invalid API key\n    403: Token not allowed to act on this KB's account\n    404: Knowledge base not found\n    409: KB is not custom type or has no bound collection\n    413: Too many documents or total text exceeds the size limit\n    422: Invalid request body (empty/duplicate doc_id)\n    500: Server error during ingest","operationId":"admin_ingest_custom_kb_documents_admin_knowledgebases__kb_id__documents_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomKBIngestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomKBIngestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["admin"],"summary":"Admin List Custom Kb Documents","description":"List the distinct documents in a custom knowledge base (Admin API).\n\nReturns each distinct doc_id with its chunk count and the metadata of its first chunk.\n\nAuthentication:\n    X-API-Key: the shared ADMIN_API_KEY, or an agent token with kb.custom:read\n\nRaises:\n    401: Invalid API key\n    403: Token not allowed to act on this KB's account\n    404: Knowledge base not found\n    409: KB is not custom type or has no bound collection\n    500: Server error during listing","operationId":"admin_list_custom_kb_documents_admin_knowledgebases__kb_id__documents_get","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomKBDocumentListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/knowledgebases/{kb_id}/documents/{doc_id}":{"delete":{"tags":["admin"],"summary":"Admin Delete Custom Kb Document","description":"Delete a single document (all its chunks) from a custom knowledge base (Admin API).\n\nRecomputes meta__<field> filter values and doc_count from the remaining documents\nand invalidates the cached collection index.\n\nAuthentication:\n    X-API-Key: the shared ADMIN_API_KEY, or an agent token with kb.custom:write\n\nRaises:\n    401: Invalid API key\n    403: Token not allowed to act on this KB's account\n    404: Knowledge base or document not found\n    409: KB is not custom type or has no bound collection\n    500: Server error during deletion","operationId":"admin_delete_custom_kb_document_admin_knowledgebases__kb_id__documents__doc_id__delete","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"doc_id","in":"path","required":true,"schema":{"type":"string","title":"Doc Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomKBDocumentDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/knowledgebases/{kb_id}/validate-metadata-fields":{"post":{"tags":["admin"],"summary":"Admin Validate Metadata Fields","description":"Validate proposed metadata filter fields against the ingested collection (Admin API).\n\nRead-only. Scans every chunk's metadata and, for each proposed field, reports whether\nit was found, how many distinct values it has, and up to sample_size example values.\nFields not present on any chunk are returned in `unknown`. Used by the KB-builder\nflow to confirm which proposed filter fields actually exist in the ingested data\nbefore promoting them to metadata_filter_fields.\n\nAuthentication:\n    X-API-Key: the shared ADMIN_API_KEY, or an agent token with kb.custom:read\n\nArgs:\n    kb_id: Knowledge base ID (path parameter)\n    request: Proposed field names + sample size\n    auth: Resolved caller (admin key or scoped agent token)\n\nReturns:\n    {validated: [{field, found, distinct_count, example_values}], unknown: [field, ...]}\n\nRaises:\n    401: Invalid API key\n    403: Token not allowed to act on this KB's account\n    404: Knowledge base not found\n    409: KB is not custom type or has no bound collection\n    500: Server error during validation","operationId":"admin_validate_metadata_fields_admin_knowledgebases__kb_id__validate_metadata_fields_post","parameters":[{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminValidateMetadataFieldsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminValidateMetadataFieldsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kaption-superadmin/login":{"post":{"tags":["kaption-superadmin"],"summary":"Login","description":"Step 1: email + password → enroll-or-verify response. See\napp.admin_auth.perform_login_step1 for the contract.","operationId":"login_kaption_superadmin_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kaption-superadmin/login/totp":{"post":{"tags":["kaption-superadmin"],"summary":"Login Totp","description":"Step 2: pending_token + 6-digit code → session JWT in body.\nSee app.admin_auth.perform_login_step2 for the contract.","operationId":"login_totp_kaption_superadmin_login_totp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLoginTotpRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLoginCompleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kaption-superadmin/me":{"get":{"tags":["kaption-superadmin"],"summary":"Me","description":"Whoami. The FE shell hits this on mount to gate rendering.","operationId":"me_kaption_superadmin_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kaption-superadmin/accounts":{"get":{"tags":["kaption-superadmin"],"summary":"List Accounts","description":"Paginated kaption account list. Standalone never appears.","operationId":"list_accounts_kaption_superadmin_accounts_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Substring match against account name.","title":"Q"},"description":"Substring match against account name."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAccountListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kaption-superadmin/accounts/{account_id}":{"get":{"tags":["kaption-superadmin"],"summary":"Get Account","operationId":"get_account_kaption_superadmin_accounts__account_id__get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAccountDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["kaption-superadmin"],"summary":"Update Account","description":"Patch copilot_model, playbooks_model and/or chatwoot_base_url. At\nleast one field must be present. Pass `null` to clear (next layer takes\nover).","operationId":"update_account_kaption_superadmin_accounts__account_id__patch","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAccountUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAccountDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kaption-superadmin/accounts/{account_id}/playbooks":{"get":{"tags":["kaption-superadmin"],"summary":"List Playbooks","description":"Latest non-deleted version per playbook, with effective_model\nresolved against the account's playbooks_model (not copilot_model —\ncopilot_model is for the copilot only).","operationId":"list_playbooks_kaption_superadmin_accounts__account_id__playbooks_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPlaybookListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kaption-superadmin/playbooks/{playbook_id}/model":{"patch":{"tags":["kaption-superadmin"],"summary":"Update Playbook Model","description":"Set/clear the per-version model. Rejects playbooks belonging to\nstandalone accounts.","operationId":"update_playbook_model_kaption_superadmin_playbooks__playbook_id__model_patch","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPlaybookModelUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPlaybookSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/kaption-superadmin/accounts/{account_id}/feature-flags":{"get":{"tags":["kaption-superadmin"],"summary":"Get Account Feature Flags","description":"The flags of native Rumo accounts, for this one: its override, the default, what applies.","operationId":"get_account_feature_flags_kaption_superadmin_accounts__account_id__feature_flags_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account 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"}}}}}}},"/kaption-superadmin/accounts/{account_id}/feature-flags/{key}":{"patch":{"tags":["kaption-superadmin"],"summary":"Set Account Feature Flag","description":"Turn one flag of a native Rumo account on, off, or back to its default.","operationId":"set_account_feature_flag_kaption_superadmin_accounts__account_id__feature_flags__key__patch","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KaptionFeatureFlagUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/login":{"post":{"tags":["superadmin"],"summary":"Login","operationId":"login_superadmin_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/login/totp":{"post":{"tags":["superadmin"],"summary":"Login Totp","operationId":"login_totp_superadmin_login_totp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLoginTotpRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminLoginCompleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/me":{"get":{"tags":["superadmin"],"summary":"Me","description":"Whoami. The FE shell hits this on mount to gate rendering.\n\nThe client list is resolved here rather than shipped as a frontend constant\n(`SUPERADMIN_CLIENTS`): it is the left rail, and for a KAM the rail is the\nfirst place the scope has to be visible.","operationId":"me_superadmin_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminMeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/mcp-sso-ticket":{"post":{"tags":["superadmin"],"summary":"Mint Mcp Admin Sso Ticket","description":"Mint a one-time SSO ticket so the admin MCP /authorize flow can skip its login.\n\nPanel sessions only: the ticket proves \"this browser holds a live superadmin\nsession for this operator\". The `SuperAdmin` dependency is what makes that\ntrue — it re-reads the operator row and rejects any session issued before\nthe operator's current TOTP enrolment, so a ticket cannot outlive a 2FA\nreset. The admin AS redeems it once, re-validates the operator, and lands on\nthe consent page. It grants no API access by itself.","operationId":"mint_mcp_admin_sso_ticket_superadmin_mcp_sso_ticket_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpAdminSsoTicketResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/mcp-connections":{"get":{"tags":["superadmin"],"summary":"List Mcp Admin Connections","description":"Live admin MCP connections, newest first.\n\nA superadmin sees every connection, not just their own: this surface\nreaches all accounts, so \"who has a client connected to it\" is not private\nbetween them. A KAM sees only their own — other operators' sessions are not\npart of the world their role describes.","operationId":"list_mcp_admin_connections_superadmin_mcp_connections_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpAdminConnectionListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/mcp-connections/{grant_id}":{"delete":{"tags":["superadmin"],"summary":"Revoke Mcp Admin Connection","description":"Revoke one admin MCP connection and every refresh token under it.\n\nAny SUPERADMIN can revoke any connection, deliberately: this is the kill\nswitch for a surface that reaches every account, and needing the right\nperson to be awake would defeat it. A KAM can only cut their own — the kill\nswitch is not theirs to pull on someone else. Revocation reaches the\nverifier within its 60s cache TTL (app/mcp_admin/grants.py), and\nimmediately for the instance that served this request.","operationId":"revoke_mcp_admin_connection_superadmin_mcp_connections__grant_id__delete","parameters":[{"name":"grant_id","in":"path","required":true,"schema":{"type":"string","title":"Grant Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpAdminConnectionListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/fgt-tokens":{"get":{"tags":["superadmin"],"summary":"List Fgt Tokens","description":"Every fine-grained agent token, newest first — including revoked/expired.\n\nUntil now these existed only in the CLI that minted them and in a per-agent\nlookup, so there was no way to answer \"what agt_ credentials exist against\nthis platform\". Every operator sees every token: these reach across accounts,\nso they are not private between operators (same reasoning as MCP connections).","operationId":"list_fgt_tokens_superadmin_fgt_tokens_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FgtTokenListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["superadmin"],"summary":"Mint Fgt Token","description":"Persist a token the panel generated, rotating the agent's previous one.\n\nUnlike the management API's reconcile, this never no-ops on unchanged\nscopes: the operator clicked \"create\" and is holding a plaintext this\nrequest is supposed to store. Returning \"already exists\" would hand them a\ncredential that authenticates nothing.","operationId":"mint_fgt_token_superadmin_fgt_tokens_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/FgtMintRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FgtMintResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/fgt-scopes":{"get":{"tags":["superadmin"],"summary":"List Fgt Scopes","description":"The grantable scope catalog, so the panel can explain what a token holds\ninstead of showing a bare slug.","operationId":"list_fgt_scopes_superadmin_fgt_scopes_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FgtScopeListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/fgt-tokens/{token_id}":{"delete":{"tags":["superadmin"],"summary":"Revoke Fgt Token","description":"Revoke one agent token. Any operator can revoke any token, deliberately —\nthis is the kill switch for a credential that reaches across accounts, and\nneeding the right person to be awake would defeat it.\n\nRevocation is immediate: require_scope re-reads the row on every request\n(there is no token cache), so the next call with it gets a 401.","operationId":"revoke_fgt_token_superadmin_fgt_tokens__token_id__delete","parameters":[{"name":"token_id","in":"path","required":true,"schema":{"type":"string","title":"Token Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FgtTokenListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/operators":{"get":{"tags":["superadmin"],"summary":"List Operators","description":"Everyone who can sign into this panel, with the accounts they reach.","operationId":"list_operators_superadmin_operators_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["superadmin"],"summary":"Create Operator","description":"Create a panel user in this panel's scope, with their accounts.\n\nThe TOTP secret is generated here and never returned: the operator enrols\ntheir authenticator on first login through the flow that already exists\n(`app/admin_auth.py`), which is also what proves they are the person who got\nthe password.","operationId":"create_operator_superadmin_operators_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/CreateOperatorRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/operators/{operator_id}":{"patch":{"tags":["superadmin"],"summary":"Update Operator","description":"Change an operator's role, password, or the accounts they reach.\n\nDemoting yourself is refused. Not for safety — a second superadmin could\nundo it — but because the request would succeed and then lock the caller\nout of the screen they are on, with no way back that is obvious from there.","operationId":"update_operator_superadmin_operators__operator_id__patch","parameters":[{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","title":"Operator Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOperatorRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["superadmin"],"summary":"Delete Operator","description":"Remove a panel user. Their account assignments go with them (CASCADE).","operationId":"delete_operator_superadmin_operators__operator_id__delete","parameters":[{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","title":"Operator Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/operators/{operator_id}/reset-totp":{"post":{"tags":["superadmin"],"summary":"Reset Operator Totp","description":"Rotate an operator's authenticator secret and force re-enrolment.\n\nClearing ``totp_enrolled_at`` also kills every live session of theirs —\nthe auth dep refuses any token issued before the current enrolment — which\nis what makes this the \"they lost their phone\" button and the \"revoke them\nright now\" button at the same time.","operationId":"reset_operator_totp_superadmin_operators__operator_id__reset_totp_post","parameters":[{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","title":"Operator Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/operators/{operator_id}/mcp-key":{"post":{"tags":["superadmin"],"summary":"Mint Operator Mcp Key","description":"Persist a service operator's mak_ key, rotating the previous one.\n\nRefused for a person (409). A key that authenticates as a human would make\nan agent's cross-account writes indistinguishable from that person's, which\nis the one thing a service identity exists to prevent; a person connects\nthrough OAuth and their own authenticator instead.\n\nRotation is mint-then-revoke: the old key is dead the moment this returns,\nso the consumer's environment has to be updated in the same sitting.","operationId":"mint_operator_mcp_key_superadmin_operators__operator_id__mcp_key_post","parameters":[{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","title":"Operator Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MintOperatorMcpKeyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MintOperatorMcpKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["superadmin"],"summary":"Revoke Operator Mcp Key","description":"Revoke a service operator's live admin MCP key. The row stays; mint again to re-arm.\n\nAny superadmin can pull this, deliberately — it is the kill switch for a\ncredential that reaches every account, and needing the right person to be\nawake would defeat it. Effective on the next request (the verifier reads\nthe row's revoked_at fresh). Its mem key, if any, is DELETE .../mem-key.","operationId":"revoke_operator_mcp_key_superadmin_operators__operator_id__mcp_key_delete","parameters":[{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","title":"Operator Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/operators/{operator_id}/mem-key":{"delete":{"tags":["superadmin"],"summary":"Revoke Operator Mem Key","description":"Revoke anyone's mem key — a person's or a service's. Superadmin only.\n\nThere is deliberately no matching POST: a person's key is minted by that\nperson, in their own browser (POST /me/mem-key), so nobody else ever holds\nits plaintext. What a superadmin needs is the kill switch, and this is it —\neffective on mem's next /whoami (mem caches up to 5 minutes on its side).","operationId":"revoke_operator_mem_key_superadmin_operators__operator_id__mem_key_delete","parameters":[{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","title":"Operator Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/me/mem-key":{"get":{"tags":["superadmin"],"summary":"Get My Mem Key","description":"The caller's live mem key: its prefix and when it was last used. Never the key.","operationId":"get_my_mem_key_superadmin_me_mem_key_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyMemKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["superadmin"],"summary":"Mint My Mem Key","description":"Persist the caller's mem key, rotating the previous one. Carries the prefix and hash only.\n\nRefused for a service identity (409): it has no browser to generate a key\nin, and its mem key comes from `studiochat superadmin mcp-key --mem`.","operationId":"mint_my_mem_key_superadmin_me_mem_key_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/MintOperatorMcpKeyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MintMyMemKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["superadmin"],"summary":"Revoke My Mem Key","description":"Revoke the caller's mem key. mem refuses it on its next /whoami.","operationId":"revoke_my_mem_key_superadmin_me_mem_key_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyMemKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts":{"get":{"tags":["superadmin"],"summary":"List Accounts","description":"Paginated standalone account list. Kaption never appears.\n\nSearch matches accounts whose name contains `q`, OR accounts that\nown at least one non-deleted playbook whose name contains `q`. The\nplaybook match uses an EXISTS subquery so we don't have to JOIN\n(which would multiply rows when an account has many playbooks).","operationId":"list_accounts_superadmin_accounts_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Substring match against account name OR the name of any of the account's non-deleted playbooks (assistants).","title":"Q"},"description":"Substring match against account name OR the name of any of the account's non-deleted playbooks (assistants)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandaloneAccountListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}":{"get":{"tags":["superadmin"],"summary":"Get Account","operationId":"get_account_superadmin_accounts__account_id__get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandaloneAccountDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/users":{"get":{"tags":["superadmin"],"summary":"List Account Users","description":"Who is in an account and when each of them last signed in and last used it.\n\nBuilt for \"did the customer ever open the demo we sent?\": a user with a\n`last_login` signed in at least once; `last_seen_at` says when they were\nlast active.","operationId":"list_account_users_superadmin_accounts__account_id__users_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUsersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/feature-flags":{"get":{"tags":["superadmin"],"summary":"Get Account Feature Flags","description":"Every flag for this account: stored override, default, and what applies.","operationId":"get_account_feature_flags_superadmin_accounts__account_id__feature_flags_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/feature-flags/{key}":{"patch":{"tags":["superadmin"],"summary":"Set Account Feature Flag","description":"Turn one flag on, off, or back to the default.\n\nA null value clears the override rather than storing a falsy one — the\ndifference matters for the number-valued flags, where \"unset\" and \"zero\"\nare different answers.\n\nGated: this proposes, it does not apply. See app/superadmin_approvals.py —\nthe write happens when a superadmin approves the proposal and this same\nrequest is replayed.","operationId":"set_account_feature_flag_superadmin_accounts__account_id__feature_flags__key__patch","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlagsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/sami-session":{"patch":{"tags":["superadmin"],"summary":"Update Account Sami Session Limits","description":"Set/clear this account's Sami session limits (age and/or spend).\n\nSend a field as ``null`` to clear that override and fall back to the\ndeploy's ``SAMI_SESSION_MAX_AGE_HOURS`` / ``SAMI_SESSION_COST_CAP_USD``;\nomit it entirely to leave it untouched. ``max_age_hours: 0`` means \"never\nexpire on age\"; the spend cap can't be zeroed from here (see the model).\nStandalone-only, like every other write on this panel.\n\nThe two limits are independent but interact: whichever binds first retires\nthe session, so raising the age without raising the spend cap usually\nchanges nothing for an account that actually uses Sami.","operationId":"update_account_sami_session_limits_superadmin_accounts__account_id__sami_session_patch","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SamiSessionLimitsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandaloneAccountDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/voice-numbers":{"get":{"tags":["superadmin"],"summary":"List Account Voice Numbers","description":"The account's phone numbers: which assistant answers each, its switches, the week's calls.","operationId":"list_account_voice_numbers_superadmin_accounts__account_id__voice_numbers_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceNumbersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["superadmin"],"summary":"Register Voice Number","description":"Make a number of our Twilio account a channel of this account, answered by one of its assistants.\n\nGated: proposes, a superadmin approves. Checked before queueing, so nobody\napproves a change that fails on replay: the account exists, the assistant is\nthe account's, the number is nobody's yet and — when this deploy holds the\nTwilio credentials — it is a number of our Twilio account. On the approved\nreplay the row is written and the number's webhooks on Twilio are pointed at\nus (app/voice/twilio.py).","operationId":"register_voice_number_superadmin_accounts__account_id__voice_numbers_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceNumberRegisterRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceNumberRegistered"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/voice-numbers/{number_id}":{"patch":{"tags":["superadmin"],"summary":"Change Voice Number","description":"Change who answers a number, its name or its switches. Gated: proposes, a superadmin approves.\n\nApplies to the calls to come: a call in progress keeps its assistant, and a\ncall already placed is answered by the assistant it was placed for.","operationId":"change_voice_number_superadmin_accounts__account_id__voice_numbers__number_id__patch","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"number_id","in":"path","required":true,"schema":{"type":"string","title":"Number Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceNumberChangeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceNumberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/name":{"patch":{"tags":["superadmin"],"summary":"Rename Account","description":"Rename a standalone account. Gated: proposes, a superadmin approves.\n\nThe name is an identifier, not just a label: the CLI, the admin endpoints and\nthe admin MCP's `account` argument all resolve accounts by it, case-insensitively.\nSo a name another account already holds (in any casing) is refused — two rows\nanswering to one name is how the wrong account gets configured.\n\nAccounts named in app.pricing are refused too, in both directions: pricing,\nper-conversation billing and monthly minimums are keyed by name, so renaming\none silently drops its revenue and floor, and taking a priced name silently\nbills an account for someone else's deal. That rename has to move the pricing\nentry in the same deploy, which is a code change, not a panel click.","operationId":"rename_account_superadmin_accounts__account_id__name_patch","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRenameRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandaloneAccountDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/my-membership":{"get":{"tags":["superadmin"],"summary":"Get Operator Membership","description":"Resolve the calling operator's own member row in this account (403 if none).\n\nSame authority model as `impersonate_account`, exposed as a read so a\ncaller can act as that member without minting a customer session token.\nThe admin MCP's account write tools use it: they refuse unless the operator\nalready has an admin seat here, and then run as it, so the change lands on\nthe customer's own audit trail and approval queue exactly as if the\noperator had done it in the dashboard.","operationId":"get_operator_membership_superadmin_accounts__account_id__my_membership_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorMembershipResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/logo":{"get":{"tags":["superadmin"],"summary":"Get Account Logo","description":"The account's logo as a data URI, for the admin MCP's approval view.\n\nThe view has to say unmistakably WHICH customer a decision is for; the logo\nis the part an operator recognises at a glance. Too big or an odd type is\nanswered with no logo, never an error: the view falls back to initials.","operationId":"get_account_logo_superadmin_accounts__account_id__logo_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountLogoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/impersonate":{"post":{"tags":["superadmin"],"summary":"Impersonate Account","description":"Mint a short-lived standalone session token for `ctx.email` inside\nthe target account, so the operator can open the customer dashboard\nalready logged in.\n\nSecurity model (the load-bearing properties — keep these together):\n\n  1. Caller must hold a valid /superadmin session JWT (SuperAdmin\n     dep — same gate as every other route here, including TOTP\n     enforcement).\n  2. Target account must be standalone (kaption accounts are\n     managed externally — they have no StandaloneUser rows for us\n     to impersonate AS).\n  3. The operator's superadmin email must already exist as an\n     ACTIVE `StandaloneUser` row in the target account. We never\n     create users on impersonation — operators get access only to\n     accounts they've already been provisioned into out-of-band.\n     The role (is_admin) is inherited from that row, NOT escalated.\n  4. The minted token has a 1h TTL, the `is_impersonation` flag,\n     and `impersonator_email` so audit logs / FE banners can show\n     \"you're impersonating as <operator>\".\n\nThe same session-storage mechanism as normal /auth/login is used,\nso /api/* routes don't need to know this is an impersonation\nsession — `app.auth.get_current_user` accepts it transparently.","operationId":"impersonate_account_superadmin_accounts__account_id__impersonate_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImpersonateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/playbooks":{"get":{"tags":["superadmin"],"summary":"List Playbooks","description":"Latest non-deleted version per playbook across all the account's\nprojects, with project_name inlined so the UI can render a single\nflat list grouped by project.","operationId":"list_playbooks_superadmin_accounts__account_id__playbooks_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandalonePlaybookListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/playbooks/{playbook_id}/model":{"patch":{"tags":["superadmin"],"summary":"Update Playbook Model","description":"Set/clear the per-version model. Rejects playbooks belonging to\nnon-standalone accounts — symmetric to the kaption panel's\nrejection of standalone-owned playbooks.","operationId":"update_playbook_model_superadmin_playbooks__playbook_id__model_patch","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandalonePlaybookModelUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandalonePlaybookSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/finance":{"get":{"tags":["superadmin"],"summary":"Get Finance","description":"Finance overview for hardcoded priced accounts (coder, takenos).\n\nReturns the LLM cost, revenue (resolved_conversations × price), and\nmargin for each priced account plus a Global aggregate, with a\nperiod-aligned diff against the previous month so the FE can render\ndeltas without a second round-trip.\n\nPerf: previously this fired 12 SQL queries (2 accounts × cur+prev ×\n3 sub-queries each) serially. Now it fires THREE queries total:\n1. Resolve the 2 priced accounts (one SELECT).\n2. Bulk cost aggregation grouped by (account, window) — one SUM\n   across the union of both date ranges.\n3. Bulk conversation aggregation grouped by (account, window) —\n   one COUNT + SUM(CASE for resolved) across the union.\nSteps 2 + 3 run in parallel on worker threads. Wall time expected\nto drop from ~3.5 s to ~250–400 ms.","operationId":"get_finance_superadmin_finance_get","parameters":[{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Target month as YYYY-MM. Defaults to the current month. The current month is reported as MTD vs same-day-of-month last month; past months are reported as full month vs full previous month.","title":"Month"},"description":"Target month as YYYY-MM. Defaults to the current month. The current month is reported as MTD vs same-day-of-month last month; past months are reported as full month vs full previous month."},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/balances":{"get":{"tags":["superadmin"],"summary":"Get Balances","description":"List every funded account with its current balance (refills minus\nall-time LLM cost), lowest balance first so accounts running low\nsurface at the top. Post-paid accounts are omitted.","operationId":"get_balances_superadmin_balances_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__superadmin__BalancesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/balance":{"get":{"tags":["superadmin"],"summary":"Get Account Balance","description":"Balance + full refill ledger for one account. `is_credit_tracked`\nis False (with zeroed figures) when the account is post-paid — the FE\nuses that to decide whether to render the balance card at all.","operationId":"get_account_balance_superadmin_accounts__account_id__balance_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__superadmin__AccountBalanceDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/credits":{"post":{"tags":["superadmin"],"summary":"Add Account Credit","description":"Add a credit (refill) to an account's ledger and return the updated\nbalance + ledger. Recorded against the operator's email.","operationId":"add_account_credit_superadmin_accounts__account_id__credits_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddCreditRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__superadmin__AccountBalanceDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/revenue":{"get":{"tags":["superadmin"],"summary":"Get Revenue","description":"Revenue for one year, per client (prepaid refills + post-paid payments),\nhighest total first. `available_years` drives the year selector.","operationId":"get_revenue_superadmin_revenue_get","parameters":[{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Defaults to the current year.","title":"Year"},"description":"Defaults to the current year."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevenueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/revenue":{"get":{"tags":["superadmin"],"summary":"Get Account Revenue","description":"One account's revenue ledger (all payments), newest first.","operationId":"get_account_revenue_superadmin_accounts__account_id__revenue_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"All-time when omitted.","title":"Year"},"description":"All-time when omitted."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRevenueDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/deal":{"get":{"tags":["superadmin"],"summary":"Get Account Deal","description":"Return the configured contractual billing terms for one account.\n\nThis is deliberately separate from revenue: it returns the rule needed to\ncalculate revenue, not a potentially expensive usage query. An account with\nno configured terms is returned explicitly rather than receiving an\ninvented default.","operationId":"get_account_deal_superadmin_accounts__account_id__deal_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDealModel"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/payments":{"post":{"tags":["superadmin"],"summary":"Add Account Payment","description":"Record a payment for an account (credit or plain), then return its\nupdated all-time revenue ledger. Attributed to the operator's email.","operationId":"add_account_payment_superadmin_accounts__account_id__payments_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddPaymentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRevenueDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/payments/{payment_id}":{"patch":{"tags":["superadmin"],"summary":"Update Account Payment","description":"Edit a recorded payment (amount/credit flag/date/note). Scoped to the\naccount.","operationId":"update_account_payment_superadmin_accounts__account_id__payments__payment_id__patch","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__superadmin__UpdatePaymentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRevenueDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["superadmin"],"summary":"Delete Account Payment","description":"Delete a recorded payment. 404 if it doesn't exist for this account.","operationId":"delete_account_payment_superadmin_accounts__account_id__payments__payment_id__delete","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountRevenueDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/non-billable-conversations":{"get":{"tags":["superadmin"],"summary":"List Non Billable Conversations","description":"The conversations marked as not billable for an account, newest first.","operationId":"list_non_billable_conversations_superadmin_accounts__account_id__non_billable_conversations_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},{"type":"null"}],"description":"YYYY-MM, by conversation start.","title":"Month"},"description":"YYYY-MM, by conversation start."},{"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"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NonBillableListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["superadmin"],"summary":"Mark Non Billable Conversations","description":"Mark conversations as not billable, with a note. Proposed for approval;\nthe approved replay applies it. Ids outside the account are refused (400) so\nthe reviewer approves exactly the list that will be applied.","operationId":"mark_non_billable_conversations_superadmin_accounts__account_id__non_billable_conversations_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkNonBillableRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkNonBillableResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/accounts/{account_id}/non-billable-conversations/{conversation_id}":{"delete":{"tags":["superadmin"],"summary":"Unmark Non Billable Conversation","description":"Make a marked conversation billable again. Proposed for approval.","operationId":"unmark_non_billable_conversation_superadmin_accounts__account_id__non_billable_conversations__conversation_id__delete","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation 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"}}}}}}},"/superadmin/clients/{name}/analytics":{"get":{"tags":["superadmin"],"summary":"Get Client Analytics","description":"Daily volume + handoff counts for a priced client.\n\nAlways returns one row per day in the requested window — including\ndays with zero conversations — so the FE chart's x-axis stays\ncontinuous regardless of holes in the data.","operationId":"get_client_analytics_superadmin_clients__name__analytics_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Number of trailing days to include. Defaults to 14 to match the customer Home view's volume/deflection chart.","default":14,"title":"Days"},"description":"Number of trailing days to include. Defaults to 14 to match the customer Home view's volume/deflection chart."},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientAnalyticsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/clients/{name}/skills-credentials":{"get":{"tags":["superadmin"],"summary":"Get Client Skills Credentials","description":"Skills credentials (Project ID + sandbox API token) for a priced\nclient, so the operator can read off the same values the customer\nsees on their Skills settings page without impersonating.\n\nOne entry per project — standalone accounts have one today, but the\nschema allows N. Like the customer get-or-create endpoint, a project\nwith no key yet gets one minted here so the operator always sees a\nusable value (the same key the customer would get on first visit).","operationId":"get_client_skills_credentials_superadmin_clients__name__skills_credentials_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientSkillsCredentialsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/clients/{name}/csat":{"get":{"tags":["superadmin"],"summary":"Get Client Csat","description":"CSAT for a priced client over the trailing `days` days, paired\nwith the immediately preceding window for period-over-period\ncomparison. The FE charts both series on a shared day-index axis.","operationId":"get_client_csat_superadmin_clients__name__csat_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Number of trailing days. The 'previous' block compares against the immediately preceding window of the same length.","default":14,"title":"Days"},"description":"Number of trailing days. The 'previous' block compares against the immediately preceding window of the same length."},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCsatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/status":{"get":{"tags":["superadmin"],"summary":"Get Status","description":"Snapshot of the last 48h of activity, bucketed for the panel.\n\nReturns three windows (15m / 1h / 24h) each paired with the\nimmediately-preceding window of the same length, so every KPI card\ncan render a current value plus a diff vs the previous block.\nPlus a 1h timeline at 5-minute granularity for the per-client\ncharts.","operationId":"get_status_superadmin_status_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/home/assistant-costs":{"get":{"tags":["superadmin"],"summary":"Home Assistant Costs","description":"Month-to-date assistant spend, split per client.\n\nSpend = ChatMessage.cost_usd in production conversations only —\npreviews, evals and copilot are excluded, matching the operator's\nmental model of 'what the assistants cost me in prod this month'.","operationId":"home_assistant_costs_superadmin_home_assistant_costs_get","parameters":[{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeAssistantCostsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/home/sami-costs":{"get":{"tags":["superadmin"],"summary":"Home Sami Costs","description":"Month-to-date Sami session spend, split per client.\n\nReads the cumulative estimate on sami_sessions (cost_usd is a\nlist-price estimate — see ANTHROPIC_SESSION_PRICES_PER_M), bucketing\neach session at its updated_at, same convention as the Costs tab.","operationId":"home_sami_costs_superadmin_home_sami_costs_get","parameters":[{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeSamiCostsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/home/oneoff-costs":{"get":{"tags":["superadmin"],"summary":"Home Oneoff Costs","description":"Month-to-date spend of the one-off Sami runs — reports and alerts.\n\nThese are the runs nobody watches: a cron fires them, they burn a\ncontext, and nothing on this page used to say so. They never write to\n`sami_sessions` (the one-off path emits `report_run` / `alert_run`\nllm_usage_events instead), so this card and the Sami sessions card\npartition Sami spend with no overlap.\n\nCost is what the writer recorded: real dollars on the OpenAI runtime, a\nlist-price estimate on the Anthropic one (see oneoff.py) — same\nconvention as the Costs tab, which folds these two sources into its\n`sami_reports` / `sami_alerts` buckets.","operationId":"home_oneoff_costs_superadmin_home_oneoff_costs_get","parameters":[{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeOneOffCostsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/home/cache-7d":{"get":{"tags":["superadmin"],"summary":"Home Cache 7D","description":"Assistant prompt-cache performance over the last 7 days.\n\nProduction conversations only. cached = cache_read_tokens,\nuncached = input - cached (floored at 0) — same split the Costs tab\ncharts as 'Cached vs Uncached'.","operationId":"home_cache_7d_superadmin_home_cache_7d_get","parameters":[{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeCacheResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/home/traffic-7d":{"get":{"tags":["superadmin"],"summary":"Home Traffic 7D","description":"Production conversation volume per day over the last 7 days,\nsplit by priced client (everything else folds into 'other').","operationId":"home_traffic_7d_superadmin_home_traffic_7d_get","parameters":[{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeTrafficResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/home/spend-7d":{"get":{"tags":["superadmin"],"summary":"Home Spend 7D","description":"Assistant spend per day over the last 7 days, split by priced\nclient ('other' folds the rest).\n\nSame cost definition as /home/assistant-costs: ChatMessage.cost_usd\nin production conversations only — previews, evals, copilot, Sami\nand background jobs are all excluded.","operationId":"home_spend_7d_superadmin_home_spend_7d_get","parameters":[{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeSpend7dResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/home/sami-spend-7d":{"get":{"tags":["superadmin"],"summary":"Home Sami Spend 7D","description":"Sami session spend per day over the last 7 days, split by priced\nclient ('other' folds the rest).\n\nSame convention as the Costs tab: the cumulative estimate on\nsami_sessions bucketed at updated_at (cost_usd is a list-price\nestimate — see ANTHROPIC_SESSION_PRICES_PER_M).","operationId":"home_sami_spend_7d_superadmin_home_sami_spend_7d_get","parameters":[{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomeSpend7dResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/home/pnl-mtd":{"get":{"tags":["superadmin"],"summary":"Home Pnl Mtd","description":"Global month-to-date P&L.\n\nIncome = billable units × per-client price across every priced\nclient (same math as the Costs tab's account P&L, via\nclient_billing). Cost = ALL LLM spend for the window — every source,\nSami and background jobs included (superadmin_costs._collect_rows).\nPrevious window = same elapsed span at the start of the prior month.","operationId":"home_pnl_mtd_superadmin_home_pnl_mtd_get","parameters":[{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomePnlMtdResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/guardrails":{"get":{"tags":["superadmin"],"summary":"Get Guardrails Overview","description":"Month summary for the top of the guardrails view: KPI cards,\nperiod-over-period diff, daily-bucketed timeline, per-policy breakdown.\n\nRestricts to standalone accounts via JOIN. Pulls the widest range\nneeded (current month + previous month same-span) once, then\nderives both halves in Python — keeps the query path simple at the\ncost of a tiny bit of memory (one row per evaluation, max ~62 days\nof data).","operationId":"get_guardrails_overview_superadmin_guardrails_get","parameters":[{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"YYYY-MM. Default current month (MTD). Past months show full-month vs full-previous-month.","title":"Month"},"description":"YYYY-MM. Default current month (MTD). Past months show full-month vs full-previous-month."},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuardrailOverviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/guardrails/violations":{"get":{"tags":["superadmin"],"summary":"Get Guardrails Violations","description":"Paginated table of flagged checks in the chosen month. Always\nrestricted to standalone accounts. Newest-first.\n\nReturns enough per-row context (account name, project name, audited\ntext snapshot, all failed policies with rationale, review state)\nfor the FE to render the table without secondary lookups.","operationId":"get_guardrails_violations_superadmin_guardrails_violations_get","parameters":[{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"YYYY-MM. Default current month (MTD). Mirrors /guardrails month semantics.","title":"Month"},"description":"YYYY-MM. Default current month (MTD). Mirrors /guardrails month semantics."},{"name":"include_reviewed","in":"query","required":false,"schema":{"type":"boolean","description":"Default false: only the unresolved review queue. Set true to also surface dismissed rows (rendered muted in the FE) for audit/history.","default":false,"title":"Include Reviewed"},"description":"Default false: only the unresolved review queue. Set true to also surface dismissed rows (rendered muted in the FE) for audit/history."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the calendar buckets and the period label are computed in (e.g. 'America/Argentina/Buenos_Aires'). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuardrailViolationsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/guardrails/violations/{check_id}/review":{"post":{"tags":["superadmin"],"summary":"Review Violation","description":"Operator dismisses (or re-dismisses) a flagged check.\n\nAlways restricted to standalone-typed accounts via the same JOIN\nused by the read endpoints — a kaption-owned check is invisible to\nthis panel and the lookup returns 404, never leaking the row's\nexistence.\n\nRe-review is allowed: the operator might come back with new info\nor want to update the notes. We overwrite the review fields and\nstamp a fresh `reviewed_at` so the audit log shows the latest\ndecision.\n\nReviewing a row that the model marked `passed=True` is rejected —\nthere's nothing to dismiss, and accepting it would let an operator\naccidentally annotate every audit row.","operationId":"review_violation_superadmin_guardrails_violations__check_id__review_post","parameters":[{"name":"check_id","in":"path","required":true,"schema":{"type":"string","title":"Check Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewViolationRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewViolationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/guardrails/test":{"post":{"tags":["superadmin"],"summary":"Test Guardrail","description":"Run one assistant message through a guardrail policy and return the\nverdict, using the same path production uses\n(`OssSafeguardEvaluator.evaluate_policy`, Groq direct). Stateless — for\ndemos and policy tuning from the superadmin panel; no row is written.","operationId":"test_guardrail_superadmin_guardrails_test_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/GuardrailTestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuardrailTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/guardrails/policies":{"get":{"tags":["superadmin"],"summary":"List Guardrail Policies","description":"List the registered guardrail policies (the in-code REGISTRY) so the\nplayground can offer a policy selector. In-memory — no DB. As more\nguardrails are added to REGISTRY they appear here automatically.","operationId":"list_guardrail_policies_superadmin_guardrails_policies_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuardrailPoliciesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/approvals":{"get":{"tags":["superadmin"],"summary":"List Approvals","description":"Approvals across every standalone account, newest first.\n\nJoins each approval to its account so the panel can group rows per\naccount without N+1 lookups. Kaption-scope accounts never appear.","operationId":"list_approvals_superadmin_approvals_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by approval status (pending|approved|rejected|executed|failed).","title":"Status"},"description":"Filter by approval status (pending|approved|rejected|executed|failed)."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Substring match against the account name.","title":"Q"},"description":"Substring match against the account name."},{"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"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuperadminApprovalListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/approvals/{approval_id}":{"get":{"tags":["superadmin"],"summary":"Get Approval","description":"One approval of a standalone account — the row `GET /approvals` lists.\n\nWhat the admin MCP's approval view polls while the operator decides in the\npanel. The account check is the scope gate's (`superadmin_scope`, which\nresolves `{approval_id}` to its account): outside the caller's accounts this\nis a 404 before the handler runs.","operationId":"get_approval_superadmin_approvals__approval_id__get","parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuperadminApprovalItem"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/approvals/{approval_id}/approve":{"post":{"tags":["superadmin"],"summary":"Approve Approval","description":"Approve a pending approval as the operator's own member user.\n\n``?activate=true`` is the account-side \"approve and activate\", passed\nthrough untouched with the version offer the operator saw (the\n``activation`` on ``GET /approvals/{id}``): the member's own route decides\nwhether it applies and answers 409 if the assistant moved. Nothing new is\nreachable — the same seat could activate the version on its own through\n``PUT /playbooks/{base_id}/active``.","operationId":"approve_approval_superadmin_approvals__approval_id__approve_post","parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}},{"name":"activate","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Activate"}},{"name":"expected_active_version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Active Version"}},{"name":"expected_latest_version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Latest Version"}},{"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"}}}}}}},"/superadmin/approvals/{approval_id}/reject":{"post":{"tags":["superadmin"],"summary":"Reject Approval","description":"Reject a pending approval as the operator's own member user.","operationId":"reject_approval_superadmin_approvals__approval_id__reject_post","parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval 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"}}}}}}},"/superadmin/clients/{name}/assistants":{"get":{"tags":["superadmin"],"summary":"Get Client Assistants","description":"Assistants for a priced client with per-version CI eval state.\n\nOne entry per playbook base: the latest saved version and the active\n(deployed) one, each with its most recent CI run so the panel can\nrender check badges. ``enabled_cases == 0`` means the assistant has no\neval suite (badges are meaningless there).","operationId":"get_client_assistants_superadmin_clients__name__assistants_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientAssistantsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/playbooks/{playbook_id}/detail":{"get":{"tags":["superadmin"],"summary":"Get Superadmin Playbook Detail","description":"One playbook version, read-only: content, skills, and slim KB/tool\nrefs for macro pill rendering. Cross-account — superadmin only.","operationId":"get_superadmin_playbook_detail_superadmin_playbooks__playbook_id__detail_get","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuperadminPlaybookDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/playbooks/{base_id}/eval-runs":{"get":{"tags":["superadmin"],"summary":"Superadmin List Eval Runs","description":"Eval runs for any playbook, cross-account. Same wire shape as the\ncustomer endpoint so the FE evals components render unchanged.","operationId":"superadmin_list_eval_runs_superadmin_playbooks__base_id__eval_runs_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Page Size"}},{"name":"trigger_source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Source"}},{"name":"playbook_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalRunsPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/eval-runs/{run_id}":{"get":{"tags":["superadmin"],"summary":"Superadmin Get Eval Run","description":"Single eval run (live polling for in-flight runs), cross-account.","operationId":"superadmin_get_eval_run_superadmin_eval_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalRunWithDetails"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/eval-runs/{run_id}/results":{"get":{"tags":["superadmin"],"summary":"Superadmin List Eval Results","description":"Per-case results (including the simulated conversation + assertion\nverdicts) for one eval run, cross-account.","operationId":"superadmin_list_eval_results_superadmin_eval_runs__run_id__results_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EvalResultWithCase-Output"},"title":"Response Superadmin List Eval Results Superadmin Eval Runs  Run Id  Results Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/clients/{name}/conversations/{conversation_id}":{"get":{"tags":["superadmin"],"summary":"Get Client Conversation","description":"Find a conversation by its string id within one client's account.\n\nSearches every project of the client (most standalones have one) and\nreturns the same wire shape as the customer Activity detail endpoint,\nso the FE renders it with the exact chat-log components. Strictly\nscoped: a conversation belonging to another account 404s here, even if\nthe id exists. ``include_eval=True`` — operators debug eval\nconversations too.","operationId":"get_client_conversation_superadmin_clients__name__conversations__conversation_id__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuperadminConversationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/clients/{name}/playbooks/{base_id}/active-version":{"post":{"tags":["superadmin"],"summary":"Set Client Active Version","description":"Activate a playbook version on behalf of the operator's member user.\n\nSame authority model as impersonation / approvals (see\n``impersonate_account``): the operator's superadmin email must already\nexist as an ACTIVE admin member of the client's account — we never act\nas an invented user, and the activation lands on the same audit trail\n(``PlaybookActiveVersionHistory.user_id``) as if they had clicked\n\"activate\" inside the customer dashboard.","operationId":"set_client_active_version_superadmin_clients__name__playbooks__base_id__active_version_post","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetClientActiveVersionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveVersionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/agents":{"get":{"tags":["superadmin"],"summary":"List Agents","description":"The fleet: each deployed managed agent + its deployments (schedule,\nstatus, last run).","operationId":"list_agents_superadmin_agents_get","parameters":[{"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"}}}}}}},"/superadmin/agents/{agent_name}/runs":{"get":{"tags":["superadmin"],"summary":"List Agent Runs","description":"Execution history across an agent's deployments, newest first.","operationId":"list_agent_runs_superadmin_agents__agent_name__runs_get","parameters":[{"name":"agent_name","in":"path","required":true,"schema":{"type":"string","title":"Agent Name"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"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"}}}}}}},"/superadmin/agents/runs/{session_id}":{"get":{"tags":["superadmin"],"summary":"Get Agent Run","description":"One run: status, error, the agent's final summary, and a timeline.","operationId":"get_agent_run_superadmin_agents_runs__session_id__get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session 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"}}}}}}},"/superadmin/agents/{agent_name}/memory":{"get":{"tags":["superadmin"],"summary":"Get Agent Memory","description":"File listing of a fleet agent's memory store (metadata, no bodies).","operationId":"get_agent_memory_superadmin_agents__agent_name__memory_get","parameters":[{"name":"agent_name","in":"path","required":true,"schema":{"type":"string","title":"Agent Name"}},{"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"}}}}}}},"/superadmin/agents/{agent_name}/memory/{memory_id}":{"get":{"tags":["superadmin"],"summary":"Get Agent Memory File","description":"One memory file of a fleet agent, with its current content.","operationId":"get_agent_memory_file_superadmin_agents__agent_name__memory__memory_id__get","parameters":[{"name":"agent_name","in":"path","required":true,"schema":{"type":"string","title":"Agent Name"}},{"name":"memory_id","in":"path","required":true,"schema":{"type":"string","title":"Memory 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"}}}}}}},"/superadmin/clients/{name}/memory":{"get":{"tags":["superadmin"],"summary":"Get Client Memory","description":"File listing of the client's Sami account memory (metadata, no bodies).","operationId":"get_client_memory_superadmin_clients__name__memory_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"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"}}}}}}},"/superadmin/clients/{name}/memory/{memory_id}":{"get":{"tags":["superadmin"],"summary":"Get Client Memory File","description":"One Sami memory file of the client's account, with its current content.","operationId":"get_client_memory_file_superadmin_clients__name__memory__memory_id__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"memory_id","in":"path","required":true,"schema":{"type":"string","title":"Memory 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"}}}}}}},"/superadmin/accounts/{account_id}/channels/{channel_id}/stored-config":{"put":{"tags":["superadmin"],"summary":"Put Channel Stored Config","description":"Store a new version of a channel's configuration and activate it — through\nthe platform approval queue.\n\nThe account route (``PUT /accounts/channels/{id}/stored-config``) needs an\nadmin of that account. This one lets a superadmin — or an agent, through the\nadmin MCP — propose the same write for any account, with a human approving\nit in the panel; the approved replay is what writes. Same validation as the\naccount route: YAML *syntax* only, because the schema belongs to the adapter,\nwhich validates on pull and reports a refusal in its status without dying.\nThe proposal carries the whole YAML — ``${VAR}`` references by contract,\nnever a secret value.","operationId":"put_channel_stored_config_superadmin_accounts__account_id__channels__channel_id__stored_config_put","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelStoredConfigPutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelStoredConfigPutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/platform-approvals":{"get":{"tags":["superadmin-approvals"],"summary":"List Platform Approvals","description":"Every platform proposal, newest first, with the pending count for the badge.","operationId":"list_platform_approvals_superadmin_platform_approvals_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"One status or a comma list.","title":"Status"},"description":"One status or a comma list."},{"name":"account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"}},{"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"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformApprovalListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/platform-approvals/{approval_id}":{"get":{"tags":["superadmin-approvals"],"summary":"Get Platform Approval","operationId":"get_platform_approval_superadmin_platform_approvals__approval_id__get","parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformApprovalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/platform-approvals/{approval_id}/approve":{"post":{"tags":["superadmin-approvals"],"summary":"Approve Platform Approval","description":"Apply a proposal by replaying the request that was captured when it was made.\n\nOrder matters: the current value is re-read BEFORE the row is locked, so a\nproposal built on a value that has since moved comes back 409 and stays\npending — reviewable, rejectable, and never half-applied.","operationId":"approve_platform_approval_superadmin_platform_approvals__approval_id__approve_post","parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformApprovalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/platform-approvals/{approval_id}/reject":{"post":{"tags":["superadmin-approvals"],"summary":"Reject Platform Approval","description":"Close a proposal without applying it.","operationId":"reject_platform_approval_superadmin_platform_approvals__approval_id__reject_post","parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlatformApprovalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/bases/spaces":{"get":{"tags":["superadmin"],"summary":"List Bases Spaces","description":"Every registered space, assigned or not (assigned ones name their account).","operationId":"list_bases_spaces_superadmin_bases_spaces_get","parameters":[{"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"}}}}}},"post":{"tags":["superadmin"],"summary":"Register Bases Space","description":"Register a space with its key, or replace the key of a registered one (the assignment stays).\n\nThe key must open THAT space: Bases answers 403 for a key of another space (400 here) and 401\nfor one it does not accept (400 too: the operator's input, never a session). Then the naming\nrule goes on (``PATCH /v1/spaces/{id} {naming: \"kebab\"}``); a refusal, or a Bases that predates\nthe rule (404/405), is 502 ``bases_naming_failed`` and nothing is stored. Answers the space and\nits bases, to preview before assigning.","operationId":"register_bases_space_superadmin_bases_spaces_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/BasesSpaceRegister"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/bases/spaces/{space_id}":{"delete":{"tags":["superadmin"],"summary":"Forget Bases Space","description":"Drop a space registered and never assigned, and its key (409 ``space_assigned`` while an\naccount has it: unassigning forgets it).\n\nNothing is deleted in Bases: the space and its bases stay where they were provisioned.","operationId":"forget_bases_space_superadmin_bases_spaces__space_id__delete","parameters":[{"name":"space_id","in":"path","required":true,"schema":{"type":"string","title":"Space 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"}}}}}}},"/superadmin/accounts/{account_id}/bases":{"get":{"tags":["superadmin"],"summary":"Get Account Bases","description":"The account's space (null when none is assigned), ``keyOk``, and its bases.","operationId":"get_account_bases_superadmin_accounts__account_id__bases_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account 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"}}}}}}},"/superadmin/accounts/{account_id}/bases/space":{"put":{"tags":["superadmin"],"summary":"Assign Bases Space","description":"Assign a registered space to the account. The space it had, if any, is forgotten with its\nkey when this applies (the approval says so). ``spaceId: null`` proposes releasing it.\n\nGated: this proposes, it does not apply (app/superadmin_approvals.py). The checks run before\nqueueing — nobody should approve an assignment that fails on replay — and again on the replay\n(the whole handler runs again), which writes it.","operationId":"assign_bases_space_superadmin_accounts__account_id__bases_space_put","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasesSpaceAssign"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["superadmin"],"summary":"Unassign Bases Space","description":"Unassign: the account stops reaching the space on its next request, and the space is forgotten\nwith its key (it still holds this account's data). Assigning it again takes registering it again.","operationId":"unassign_bases_space_superadmin_accounts__account_id__bases_space_delete","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account 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"}}}}}}},"/superadmin/accounts/{account_id}/bases/provision":{"post":{"tags":["superadmin"],"summary":"Provision Bases Space","description":"Create an empty space in Bases for the account, register it, and propose assigning it.\n\nGated: the answer is the 202 proposal of ``PUT …/bases/space {spaceId}`` (kind ``bases_space``,\nids only), and approving it replays that PUT, so the provisioning itself never runs twice. The\nspace is created now because it exposes nothing until assigned; if the proposal is rejected it\nstays registered and unassigned (forget it, or assign it later). 409 ``account_has_space`` when\nthe account already has one; 503 ``bases_provisioning_not_configured`` without a product key.\n\nThe space is created with the naming rule and named ``slug_name(name)`` («Acme SA» → ``acme-sa``);\nits label in StudioChat stays the name as written. 400 ``space_name_unusable`` when the name has\nno letter or digit to keep; 502 ``bases_naming_failed`` when Bases answers without the rule.\n\nIdempotent while a proposal waits: if the account already has a live, pending ``bases_space``\nproposal, nothing is created and that same proposal comes back (same approval id, 202). Two\ncalls racing within the same moment can still each create a space; the second one's\nassignment then fails at approval (the first already took the account), and its space stays\nregistered and unassigned.","operationId":"provision_bases_space_superadmin_accounts__account_id__bases_provision_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/BasesSpaceProvision"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/costs/overview":{"get":{"tags":["superadmin-costs"],"summary":"Costs Overview","description":"Global LLM spend overview: KPIs (+ previous-window comparison),\nper-source and per-model breakdowns, per-account ranking, and a\nzero-filled cost/token time series.","operationId":"costs_overview_superadmin_costs_overview_get","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Window start (ISO, inclusive)","title":"Start Date"},"description":"Window start (ISO, inclusive)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Window end (ISO, exclusive)","title":"End Date"},"description":"Window end (ISO, exclusive)"},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","description":"hour | day | week | month","default":"day","title":"Granularity"},"description":"hour | day | week | month"},{"name":"account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional account UUID filter","title":"Account Id"},"description":"Optional account UUID filter"},{"name":"include_previous","in":"query","required":false,"schema":{"type":"boolean","description":"Also compute kpis.previous, the window right before this one. Doubles the work, so a caller that only reads this window should turn it off.","default":true,"title":"Include Previous"},"description":"Also compute kpis.previous, the window right before this one. Doubles the work, so a caller that only reads this window should turn it off."},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA zone the buckets are computed in (e.g. America/Argentina/Buenos_Aires). Only the GROUP BY moves: the window is still filtered on the naive-UTC instants. Defaults to UTC, which is byte-identical to the old behaviour.","default":"UTC","title":"Timezone"},"description":"IANA zone the buckets are computed in (e.g. America/Argentina/Buenos_Aires). Only the GROUP BY moves: the window is still filtered on the naive-UTC instants. Defaults to UTC, which is byte-identical to the old behaviour."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostsOverviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/costs/account-pnl":{"get":{"tags":["superadmin-costs"],"summary":"Account Pnl","description":"One account's P&L for the given window: the income its usage will be\ninvoiced at (billable conversations × the client's price, mirroring the\nAnalytics API the invoices are issued from) against the window's total\nLLM cost across every source.\n\nFor more than one account use ``/accounts-pnl``: this filter does not make\nthe query cheap, because messages have no account column and the whole\nwindow is walked either way.","operationId":"account_pnl_superadmin_costs_account_pnl_get","parameters":[{"name":"account_id","in":"query","required":true,"schema":{"type":"string","description":"Account UUID","title":"Account Id"},"description":"Account UUID"},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Window start (ISO, inclusive)","title":"Start Date"},"description":"Window start (ISO, inclusive)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Window end (ISO, exclusive)","title":"End Date"},"description":"Window end (ISO, exclusive)"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA zone the buckets are computed in (e.g. America/Argentina/Buenos_Aires). Only the GROUP BY moves: the window is still filtered on the naive-UTC instants. Defaults to UTC, which is byte-identical to the old behaviour.","default":"UTC","title":"Timezone"},"description":"IANA zone the buckets are computed in (e.g. America/Argentina/Buenos_Aires). Only the GROUP BY moves: the window is still filtered on the naive-UTC instants. Defaults to UTC, which is byte-identical to the old behaviour."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountPnlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/costs/accounts-pnl":{"get":{"tags":["superadmin-costs"],"summary":"Accounts Pnl","description":"Every standalone account's P&L for one window, in one pass.\n\nWhat the Insights view used to fan out as two account-pnl calls per account:\nthe cost rows are grouped by account anyway, so a single ``_collect_rows``\nand a single income query answer for all of them. Same numbers as calling\naccount-pnl once per account (pinned by tests/unit/test_superadmin_costs.py).","operationId":"accounts_pnl_superadmin_costs_accounts_pnl_get","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Window start (ISO, inclusive)","title":"Start Date"},"description":"Window start (ISO, inclusive)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Window end (ISO, exclusive)","title":"End Date"},"description":"Window end (ISO, exclusive)"},{"name":"account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional account UUID filter","title":"Account Id"},"description":"Optional account UUID filter"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA zone the buckets are computed in (e.g. America/Argentina/Buenos_Aires). Only the GROUP BY moves: the window is still filtered on the naive-UTC instants. Defaults to UTC, which is byte-identical to the old behaviour.","default":"UTC","title":"Timezone"},"description":"IANA zone the buckets are computed in (e.g. America/Argentina/Buenos_Aires). Only the GROUP BY moves: the window is still filtered on the naive-UTC instants. Defaults to UTC, which is byte-identical to the old behaviour."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountsPnlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/superadmin/insights/series":{"get":{"tags":["superadmin-insights"],"summary":"Insights Series","description":"Zero-filled income/cost/billable-quantity time series for the Insights\nchart. One aggregate query per metric store (six total), never per bucket.\n\n``include_accounts=true`` also returns the per-client lines each bucket is\nsummed from, plus that client's cash received in the bucket. That is one\nextra query (``account_payments``), not one per client: the income and cost\nbreakdowns already exist per account inside this endpoint and were simply\nbeing aggregated away.","operationId":"insights_series_superadmin_insights_series_get","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Window start (YYYY-MM-DD, inclusive)","title":"Start Date"},"description":"Window start (YYYY-MM-DD, inclusive)"},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Window end (YYYY-MM-DD, EXCLUSIVE)","title":"End Date"},"description":"Window end (YYYY-MM-DD, EXCLUSIVE)"},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","description":"day | week | month","default":"day","title":"Granularity"},"description":"day | week | month"},{"name":"account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional account UUID filter","title":"Account Id"},"description":"Optional account UUID filter"},{"name":"include_accounts","in":"query","required":false,"schema":{"type":"boolean","description":"Add the per-client breakdown of every bucket (terms, billable quantity, income, cost and cash received). With granularity=month this is the month's invoicing run in one call. Off by default — the chart does not need it and the payload grows with the client count.","default":false,"title":"Include Accounts"},"description":"Add the per-client breakdown of every bucket (terms, billable quantity, income, cost and cash received). With granularity=month this is the month's invoicing run in one call. Off by default — the chart does not need it and the payload grows with the client count."},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA zone the buckets are computed in (e.g. America/Argentina/Buenos_Aires). Only the GROUP BY moves: the window is still filtered on the naive-UTC instants. Defaults to UTC, which is byte-identical to the old behaviour.","default":"UTC","title":"Timezone"},"description":"IANA zone the buckets are computed in (e.g. America/Argentina/Buenos_Aires). Only the GROUP BY moves: the window is still filtered on the naive-UTC instants. Defaults to UTC, which is byte-identical to the old behaviour."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightsSeriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/accounts":{"get":{"tags":["costs"],"summary":"List Account Costs","description":"List all accounts with aggregated cost totals.","operationId":"list_account_costs_admin_costs_accounts_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountCostRow"},"title":"Response List Account Costs Admin Costs Accounts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/accounts/{account_slug}/summary":{"get":{"tags":["costs"],"summary":"Get Cost Summary","description":"Aggregated cost summary for an account (all assistant conversations).","operationId":"get_cost_summary_admin_costs_accounts__account_slug__summary_get","parameters":[{"name":"account_slug","in":"path","required":true,"schema":{"type":"string","title":"Account Slug"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/accounts/{account_slug}/by-model":{"get":{"tags":["costs"],"summary":"Get Costs By Model","description":"Cost breakdown grouped by LLM model.","operationId":"get_costs_by_model_admin_costs_accounts__account_slug__by_model_get","parameters":[{"name":"account_slug","in":"path","required":true,"schema":{"type":"string","title":"Account Slug"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelCostBreakdown"},"title":"Response Get Costs By Model Admin Costs Accounts  Account Slug  By Model Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/accounts/{account_slug}/by-playbook":{"get":{"tags":["costs"],"summary":"Get Costs By Playbook","description":"Cost breakdown grouped by playbook.","operationId":"get_costs_by_playbook_admin_costs_accounts__account_slug__by_playbook_get","parameters":[{"name":"account_slug","in":"path","required":true,"schema":{"type":"string","title":"Account Slug"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PlaybookCostBreakdown"},"title":"Response Get Costs By Playbook Admin Costs Accounts  Account Slug  By Playbook Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/accounts/{account_slug}/by-tag":{"get":{"tags":["costs"],"summary":"Get Costs By Tag","description":"Cost breakdown grouped by conversation tag.","operationId":"get_costs_by_tag_admin_costs_accounts__account_slug__by_tag_get","parameters":[{"name":"account_slug","in":"path","required":true,"schema":{"type":"string","title":"Account Slug"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TagCostBreakdown"},"title":"Response Get Costs By Tag Admin Costs Accounts  Account Slug  By Tag Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/accounts/{account_slug}/by-project":{"get":{"tags":["costs"],"summary":"Get Costs By Project","description":"Cost breakdown by project within an account.","operationId":"get_costs_by_project_admin_costs_accounts__account_slug__by_project_get","parameters":[{"name":"account_slug","in":"path","required":true,"schema":{"type":"string","title":"Account Slug"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountCostRow"},"title":"Response Get Costs By Project Admin Costs Accounts  Account Slug  By Project Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/accounts/{account_slug}/conversations":{"get":{"tags":["costs"],"summary":"List Conversation Costs","description":"Per-conversation cost details with filtering and pagination.","operationId":"list_conversation_costs_admin_costs_accounts__account_slug__conversations_get","parameters":[{"name":"account_slug","in":"path","required":true,"schema":{"type":"string","title":"Account Slug"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"}},{"name":"min_cost","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Cost"}},{"name":"max_cost","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Cost"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"total_cost","title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string","default":"desc","title":"Sort Order"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationCostList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/accounts/{account_slug}/time-series":{"get":{"tags":["costs"],"summary":"Get Cost Time Series","description":"Cost time series with configurable granularity (day, week, month).","operationId":"get_cost_time_series_admin_costs_accounts__account_slug__time_series_get","parameters":[{"name":"account_slug","in":"path","required":true,"schema":{"type":"string","title":"Account Slug"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"End Date"}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","default":"day","title":"Granularity"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone for the window bounds and the bucket boundaries, e.g. America/Argentina/Buenos_Aires. Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone for the window bounds and the bucket boundaries, e.g. America/Argentina/Buenos_Aires. Defaults to UTC."},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostTimeSeries"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/accounts/{account_slug}/eval-runs":{"get":{"tags":["costs"],"summary":"List Eval Run Costs","description":"Paginated list of eval runs with their OpenRouter overhead cost.\n\nCost = ``eval_runs.eval_overhead_cost_usd`` (simulator + LLM judge,\nsummed across cases). Runs are joined to ``playbooks`` so the playbook\nname + base id come back on each row.","operationId":"list_eval_run_costs_admin_costs_accounts__account_slug__eval_runs_get","parameters":[{"name":"account_slug","in":"path","required":true,"schema":{"type":"string","title":"Account Slug"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to a single playbook (base_id).","title":"Playbook Base Id"},"description":"Filter to a single playbook (base_id)."},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","description":"cost | created_at | completed_at | started_at","default":"created_at","title":"Sort By"},"description":"cost | created_at | completed_at | started_at"},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string","default":"desc","title":"Sort Order"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalRunCostList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/accounts/{account_slug}/eval-runs/by-playbook":{"get":{"tags":["costs"],"summary":"Get Eval Cost By Playbook","description":"Per-playbook breakdown of eval overhead cost for one account.\n\nAggregates ``eval_runs.eval_overhead_cost_usd`` grouped by\n``Playbook.base_id`` (so all versions of a playbook roll up together).","operationId":"get_eval_cost_by_playbook_admin_costs_accounts__account_slug__eval_runs_by_playbook_get","parameters":[{"name":"account_slug","in":"path","required":true,"schema":{"type":"string","title":"Account Slug"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EvalCostByPlaybookRow"},"title":"Response Get Eval Cost By Playbook Admin Costs Accounts  Account Slug  Eval Runs By Playbook Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/kaption/accounts":{"get":{"tags":["costs"],"summary":"List Kaption Account Costs","description":"List Kaption accounts with aggregated cost totals.","operationId":"list_kaption_account_costs_admin_costs_kaption_accounts_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"kaption_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated Kaption account IDs to filter","title":"Kaption Ids"},"description":"Comma-separated Kaption account IDs to filter"},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KaptionAccountCostRow"},"title":"Response List Kaption Account Costs Admin Costs Kaption Accounts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/kaption/accounts/{kaption_id}/summary":{"get":{"tags":["costs"],"summary":"Get Kaption Cost Summary","description":"Aggregated cost summary for a Kaption account.","operationId":"get_kaption_cost_summary_admin_costs_kaption_accounts__kaption_id__summary_get","parameters":[{"name":"kaption_id","in":"path","required":true,"schema":{"type":"integer","title":"Kaption Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/kaption/accounts/{kaption_id}/by-model":{"get":{"tags":["costs"],"summary":"Get Kaption Costs By Model","description":"Cost breakdown grouped by LLM model for a Kaption account.","operationId":"get_kaption_costs_by_model_admin_costs_kaption_accounts__kaption_id__by_model_get","parameters":[{"name":"kaption_id","in":"path","required":true,"schema":{"type":"integer","title":"Kaption Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ModelCostBreakdown"},"title":"Response Get Kaption Costs By Model Admin Costs Kaption Accounts  Kaption Id  By Model Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/kaption/accounts/{kaption_id}/by-playbook":{"get":{"tags":["costs"],"summary":"Get Kaption Costs By Playbook","description":"Cost breakdown grouped by playbook for a Kaption account.","operationId":"get_kaption_costs_by_playbook_admin_costs_kaption_accounts__kaption_id__by_playbook_get","parameters":[{"name":"kaption_id","in":"path","required":true,"schema":{"type":"integer","title":"Kaption Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PlaybookCostBreakdown"},"title":"Response Get Kaption Costs By Playbook Admin Costs Kaption Accounts  Kaption Id  By Playbook Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/kaption/accounts/{kaption_id}/by-tag":{"get":{"tags":["costs"],"summary":"Get Kaption Costs By Tag","description":"Cost breakdown grouped by conversation tag for a Kaption account.","operationId":"get_kaption_costs_by_tag_admin_costs_kaption_accounts__kaption_id__by_tag_get","parameters":[{"name":"kaption_id","in":"path","required":true,"schema":{"type":"integer","title":"Kaption Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TagCostBreakdown"},"title":"Response Get Kaption Costs By Tag Admin Costs Kaption Accounts  Kaption Id  By Tag Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/kaption/accounts/{kaption_id}/by-project":{"get":{"tags":["costs"],"summary":"Get Kaption Costs By Project","description":"Cost breakdown by project within a Kaption account.","operationId":"get_kaption_costs_by_project_admin_costs_kaption_accounts__kaption_id__by_project_get","parameters":[{"name":"kaption_id","in":"path","required":true,"schema":{"type":"integer","title":"Kaption Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccountCostRow"},"title":"Response Get Kaption Costs By Project Admin Costs Kaption Accounts  Kaption Id  By Project Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/kaption/accounts/{kaption_id}/conversations":{"get":{"tags":["costs"],"summary":"List Kaption Conversation Costs","description":"Per-conversation cost details for a Kaption account.","operationId":"list_kaption_conversation_costs_admin_costs_kaption_accounts__kaption_id__conversations_get","parameters":[{"name":"kaption_id","in":"path","required":true,"schema":{"type":"integer","title":"Kaption Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"}},{"name":"min_cost","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Cost"}},{"name":"max_cost","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Cost"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"total_cost","title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string","default":"desc","title":"Sort Order"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationCostList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/kaption/accounts/{kaption_id}/time-series":{"get":{"tags":["costs"],"summary":"Get Kaption Cost Time Series","description":"Cost time series for a Kaption account.","operationId":"get_kaption_cost_time_series_admin_costs_kaption_accounts__kaption_id__time_series_get","parameters":[{"name":"kaption_id","in":"path","required":true,"schema":{"type":"integer","title":"Kaption Id"}},{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"Start Date"}},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"End Date"}},{"name":"granularity","in":"query","required":false,"schema":{"type":"string","default":"day","title":"Granularity"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone for the window bounds and the bucket boundaries, e.g. America/Argentina/Buenos_Aires. Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone for the window bounds and the bucket boundaries, e.g. America/Argentina/Buenos_Aires. Defaults to UTC."},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostTimeSeries"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/kaption/accounts/{kaption_id}/eval-runs":{"get":{"tags":["costs"],"summary":"List Kaption Eval Run Costs","description":"Paginated list of eval runs with their OpenRouter overhead cost for a Kaption account.","operationId":"list_kaption_eval_run_costs_admin_costs_kaption_accounts__kaption_id__eval_runs_get","parameters":[{"name":"kaption_id","in":"path","required":true,"schema":{"type":"integer","title":"Kaption Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to a single playbook (base_id).","title":"Playbook Base Id"},"description":"Filter to a single playbook (base_id)."},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","description":"cost | created_at | completed_at | started_at","default":"created_at","title":"Sort By"},"description":"cost | created_at | completed_at | started_at"},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string","default":"desc","title":"Sort Order"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalRunCostList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs/kaption/accounts/{kaption_id}/eval-runs/by-playbook":{"get":{"tags":["costs"],"summary":"Get Kaption Eval Cost By Playbook","description":"Per-playbook eval overhead cost breakdown for a Kaption account.","operationId":"get_kaption_eval_cost_by_playbook_admin_costs_kaption_accounts__kaption_id__eval_runs_by_playbook_get","parameters":[{"name":"kaption_id","in":"path","required":true,"schema":{"type":"integer","title":"Kaption Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EvalCostByPlaybookRow"},"title":"Response Get Kaption Eval Cost By Playbook Admin Costs Kaption Accounts  Kaption Id  Eval Runs By Playbook Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/balances":{"get":{"tags":["balances-admin"],"summary":"List Balances","description":"List every funded account with its current balance, lowest first.","operationId":"list_balances_admin_balances_get","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__admin__balances__BalancesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/balances/{account_ref}":{"get":{"tags":["balances-admin"],"summary":"Get Balance","description":"Balance + full refill ledger for one account (by id or name).","operationId":"get_balance_admin_balances__account_ref__get","parameters":[{"name":"account_ref","in":"path","required":true,"schema":{"type":"string","title":"Account Ref"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__admin__balances__AccountBalanceDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/balances/{account_ref}/credits":{"post":{"tags":["balances-admin"],"summary":"Create Credit","description":"Add a credit (refill) to an account's ledger.","operationId":"create_credit_admin_balances__account_ref__credits_post","parameters":[{"name":"account_ref","in":"path","required":true,"schema":{"type":"string","title":"Account Ref"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCreditRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__admin__balances__AccountBalanceDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/balances/{account_ref}/credits/{credit_id}":{"patch":{"tags":["balances-admin"],"summary":"Edit Credit","description":"Edit a refill's amount and/or note. Scoped to the account.","operationId":"edit_credit_admin_balances__account_ref__credits__credit_id__patch","parameters":[{"name":"account_ref","in":"path","required":true,"schema":{"type":"string","title":"Account Ref"}},{"name":"credit_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCreditRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__admin__balances__AccountBalanceDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["balances-admin"],"summary":"Remove Credit","description":"Delete a refill from an account's ledger.","operationId":"remove_credit_admin_balances__account_ref__credits__credit_id__delete","parameters":[{"name":"account_ref","in":"path","required":true,"schema":{"type":"string","title":"Account Ref"}},{"name":"credit_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__admin__balances__AccountBalanceDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/payments/revenue":{"get":{"tags":["payments-admin"],"summary":"Get Revenue","description":"Revenue for one year across clients (prepaid + post-paid), highest\nfirst. `available_years` lists the years with data.","operationId":"get_revenue_admin_payments_revenue_get","parameters":[{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Defaults to the current year.","title":"Year"},"description":"Defaults to the current year."},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the reporting period is expressed in, e.g. America/Argentina/Buenos_Aires.","default":"UTC","title":"Timezone"},"description":"IANA timezone the reporting period is expressed in, e.g. America/Argentina/Buenos_Aires."},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevenueSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/payments/revenue/range":{"get":{"tags":["payments-admin"],"summary":"Get Revenue Range","description":"Revenue across all clients in an arbitrary [start_date, end_date)\nwindow — every payment (prepaid refills + post-paid invoices), per-client\ntotals plus the raw list. Use this instead of `/revenue` when the period\ndoesn't align to a calendar year (a billing cycle, a quarter, a custom\nrange).","operationId":"get_revenue_range_admin_payments_revenue_range_get","parameters":[{"name":"start_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Window start (ISO, inclusive).","title":"Start Date"},"description":"Window start (ISO, inclusive)."},{"name":"end_date","in":"query","required":true,"schema":{"type":"string","format":"date-time","description":"Window end (ISO, exclusive).","title":"End Date"},"description":"Window end (ISO, exclusive)."},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the reporting period is expressed in, e.g. America/Argentina/Buenos_Aires.","default":"UTC","title":"Timezone"},"description":"IANA timezone the reporting period is expressed in, e.g. America/Argentina/Buenos_Aires."},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevenueRangeSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/payments/{account_ref}":{"get":{"tags":["payments-admin"],"summary":"Get Account Payments","description":"One account's revenue ledger (all payments), newest first.","operationId":"get_account_payments_admin_payments__account_ref__get","parameters":[{"name":"account_ref","in":"path","required":true,"schema":{"type":"string","title":"Account Ref"}},{"name":"year","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"All-time when omitted.","title":"Year"},"description":"All-time when omitted."},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountLedger"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["payments-admin"],"summary":"Create Payment","description":"Register a payment for an account (credit or plain). Returns the updated\nall-time ledger.","operationId":"create_payment_admin_payments__account_ref__post","parameters":[{"name":"account_ref","in":"path","required":true,"schema":{"type":"string","title":"Account Ref"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountLedger"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/payments/{account_ref}/{payment_id}":{"patch":{"tags":["payments-admin"],"summary":"Edit Payment","description":"Edit a payment (amount / credit flag / date / note). Scoped to the account.","operationId":"edit_payment_admin_payments__account_ref___payment_id__patch","parameters":[{"name":"account_ref","in":"path","required":true,"schema":{"type":"string","title":"Account Ref"}},{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__admin__payments__UpdatePaymentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountLedger"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["payments-admin"],"summary":"Remove Payment","description":"Delete a payment from an account's ledger.","operationId":"remove_payment_admin_payments__account_ref___payment_id__delete","parameters":[{"name":"account_ref","in":"path","required":true,"schema":{"type":"string","title":"Account Ref"}},{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountLedger"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/guardrails/hits":{"get":{"tags":["guardrails"],"summary":"List Hits","description":"Paginated view of guardrail check rows, newest first.\n\nRestricting to flagged + unresolved is the default because that's\nwhat every operator-facing dashboard wants. Lift either flag to widen\nthe window to the full audit log.","operationId":"list_hits_admin_guardrails_hits_get","parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Inclusive lower bound on `evaluated_at`. Omit for no lower bound.","title":"Start Date"},"description":"Inclusive lower bound on `evaluated_at`. Omit for no lower bound."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Exclusive upper bound on `evaluated_at`. Omit for no upper bound.","title":"End Date"},"description":"Exclusive upper bound on `evaluated_at`. Omit for no upper bound."},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA zone a naive start_date/end_date is read in, e.g. America/Argentina/Buenos_Aires.","default":"UTC","title":"Timezone"},"description":"IANA zone a naive start_date/end_date is read in, e.g. America/Argentina/Buenos_Aires."},{"name":"account_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Case-insensitive match on Account.name. Mutually exclusive with kaption_account_id.","title":"Account Slug"},"description":"Case-insensitive match on Account.name. Mutually exclusive with kaption_account_id."},{"name":"kaption_account_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Integer Chatwoot account id. Mutually exclusive with account_slug.","title":"Kaption Account Id"},"description":"Integer Chatwoot account id. Mutually exclusive with account_slug."},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to one project (UUID).","title":"Project Id"},"description":"Filter to one project (UUID)."},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to one assistant — matches every version sharing this base_id.","title":"Playbook Base Id"},"description":"Filter to one assistant — matches every version sharing this base_id."},{"name":"conversation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to one conversation by external platform id (Chatwoot / Intercom / etc).","title":"Conversation Id"},"description":"Filter to one conversation by external platform id (Chatwoot / Intercom / etc)."},{"name":"only_failures","in":"query","required":false,"schema":{"type":"boolean","description":"Default true: only rows the model flagged (passed=false). Set false to also return passed checks — useful for sampling overall evaluator behavior, not just flagged rows.","default":true,"title":"Only Failures"},"description":"Default true: only rows the model flagged (passed=false). Set false to also return passed checks — useful for sampling overall evaluator behavior, not just flagged rows."},{"name":"include_reviewed","in":"query","required":false,"schema":{"type":"boolean","description":"Default false: only the unresolved review queue. Set true to also return rows an operator already dismissed via the superadmin panel.","default":false,"title":"Include Reviewed"},"description":"Default false: only the unresolved review queue. Set true to also return rows an operator already dismissed via the superadmin panel."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuardrailHitsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/guardrails/hits/{check_id}/review":{"post":{"tags":["guardrails"],"summary":"Review Hit","description":"Dismiss (or re-dismiss) a flagged check via the admin API key.\n\nRe-review is allowed — a later audit pass may refine the verdict or\nnotes; the fields are overwritten and `reviewed_at` re-stamped so\nthe row always reflects the latest decision. Reviewing a check the\nmodel marked `passed=True` is rejected: there is nothing to dismiss.","operationId":"review_hit_admin_guardrails_hits__check_id__review_post","parameters":[{"name":"check_id","in":"path","required":true,"schema":{"type":"string","title":"Check Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewHitRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewHitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/guardrails/hits/{check_id}/agent-clear":{"post":{"tags":["guardrails"],"summary":"Agent Clear Hit","description":"Narrow capability: move an UNREVIEWED hit to ``agent_cleared`` — nothing else.\n\nDeterministic by construction (independent of the token's scope):\n  - disposition is hardcoded to ``agent_cleared`` (not a request field), so\n    no other disposition can ever be set here;\n  - it refuses (409) if the row already has a review, so an existing human /\n    regex / agent decision is never overwritten;\n  - the reviewer identity comes from the caller's token, not the body.\n\nThis is what makes \"the guardrails agent can only agent-clear, never\nnot_a_risk, never re-review\" a code-level guarantee rather than a prompt\ninstruction. Humans keep the general POST /hits/{id}/review endpoint.","operationId":"agent_clear_hit_admin_guardrails_hits__check_id__agent_clear_post","parameters":[{"name":"check_id","in":"path","required":true,"schema":{"type":"string","title":"Check Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentClearRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewHitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/fgt/tokens/{agent_name}":{"get":{"tags":["fgt"],"summary":"Get Fgt Token State","description":"The token holder's active-token state (used to gate downstream steps).","operationId":"get_fgt_token_state_admin_fgt_tokens__agent_name__get","parameters":[{"name":"agent_name","in":"path","required":true,"schema":{"type":"string","title":"Agent Name"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FgtTokenState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/fgt/tokens/{agent_name}/reconcile":{"post":{"tags":["fgt"],"summary":"Reconcile Fgt Token","description":"Reconcile the holder's token against the desired scopes (server-side diff):\n\n  - active token, same perms   → no-op  (``exists``; the candidate is ignored)\n  - no active token            → store the candidate  (``minted``)\n  - active token, perms changed → revoke + store the candidate  (``rotated``)\n\nThe permission doc is validated + normalized so the stored↔desired diff is\nexact. Only the hash is persisted — the plaintext never reaches the BE.","operationId":"reconcile_fgt_token_admin_fgt_tokens__agent_name__reconcile_post","parameters":[{"name":"agent_name","in":"path","required":true,"schema":{"type":"string","title":"Agent Name"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FgtReconcileRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FgtReconcileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/conversations/{project_id}/{conversation_id}":{"get":{"tags":["superagents"],"summary":"Get Admin Conversation","description":"Read-only, cross-account conversation detail (messages + attachments).\n\nReuses the same builder as the customer-facing batch endpoint, so the agent\ngets the full message history with inline image/PDF attachments (base64) to\nverify echoes with vision.","operationId":"get_admin_conversation_admin_conversations__project_id___conversation_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/messages":{"post":{"tags":["webhooks"],"summary":"Receive Webhook","description":"Receive webhook events from Chatwoot.\n\nThis endpoint receives message_created events and stores them in the message queue\nfor processing autosuggestions. The queue maintains a sliding window of the last N\nmessages per conversation. For autosuggestion deployments, it also triggers background\nsuggestion calculation.\n\nArgs:\n    request: The incoming webhook request\n    background_tasks: FastAPI background tasks for async processing\n\nReturns:\n    dict: Success response with status","operationId":"receive_webhook_webhooks_messages_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/webhooks/kaption-agent-bot":{"post":{"tags":["webhooks"],"summary":"Receive Agent Bot Webhook","description":"Receive webhook events from the Kaption AI agent bot.\n\nThis endpoint receives events from the agent bot configured at the account level.\nThe agent bot acts as a router for new conversations, assigning them to the appropriate playbook user.\n\nArgs:\n    request: The incoming webhook request from Chatwoot agent bot\n\nReturns:\n    dict: Success response with status and optional content for the bot to send","operationId":"receive_agent_bot_webhook_webhooks_kaption_agent_bot_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/webhooks/callbacks/{token}":{"post":{"tags":["webhooks"],"summary":"Receive Async Operation Callback","description":"Where a worker posts the result of an async API tool's operation.\n\nThis is the only genuine webhook in the async-tool flow: the outbound trigger is an\nordinary API request, and *this* is the callback we asked to be pushed. Public by\nnecessity — the caller is somebody else's worker with no account here — and authorised\nsolely by the token in the path, which is a capability minted per operation, stored only\nas a hash, and good for exactly one row.\n\nThe body is stored **verbatim and uninterpreted**: no envelope is required, no status is\nread out of it, no shape is imposed. What \"done\" means belongs to the worker, and the\nassistant reads the body to find out.\n\nAlways answers 2xx, including for an unknown token or a body it could not parse. A 4xx\nwould teach a retrying worker to keep hammering an endpoint that will never accept it,\nand there is no caller here who can act on the distinction — the operator sees the truth\nin the operation itself, not in a status code returned into the void.","operationId":"receive_async_operation_callback_webhooks_callbacks__token__post","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"}}}}}}},"/webhooks/slack/interactivity":{"post":{"tags":["webhooks"],"summary":"Slack Interactivity","description":"Receive a Slack ``block_actions`` payload and ack within Slack's 3s budget.","operationId":"slack_interactivity_webhooks_slack_interactivity_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/webhooks/x/{x_account_id}":{"get":{"tags":["webhooks"],"summary":"X Crc","operationId":"x_crc_webhooks_x__x_account_id__get","parameters":[{"name":"x_account_id","in":"path","required":true,"schema":{"type":"string","title":"X Account Id"}},{"name":"crc_token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Crc Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["webhooks"],"summary":"X Events","operationId":"x_events_webhooks_x__x_account_id__post","parameters":[{"name":"x_account_id","in":"path","required":true,"schema":{"type":"string","title":"X Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/s/create":{"post":{"tags":["shared"],"summary":"Create Share Token","description":"Create a share token for a conversation the caller owns.\n\nThe returned token is a signed, expiring credential scoped to that one\nconversation in that one project — see `app.utils.crypto.encode_share_token`.\n\nArgs:\n    request: Contains the conversation_id to encode\n    current_user: Authenticated user or API key\n\nReturns:\n    CreateShareTokenResponse with the encoded token and, when the shortener\n    answers, a short link to the share page\n\nRaises:\n    404: The conversation doesn't exist, or doesn't belong to this account","operationId":"create_share_token_s_create_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateShareTokenRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateShareTokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/s/{token}":{"get":{"tags":["shared"],"summary":"Get Shared Conversation Endpoint","description":"Get a shared conversation by token (public endpoint, no authentication required).\n\nThis endpoint decodes the token to get the conversation ID, then returns\nthe conversation messages without tool calls or private metadata.\n\nArgs:\n    token: The signed share token, carrying the conversation and its project\n\nReturns:\n    SharedConversationResponse with:\n        - conversation_id: The conversation identifier\n        - playbook_name: Name of the assistant/playbook\n        - playbook_version: Version number of the playbook\n        - messages: List of messages (role, content, timestamp)\n        - created_at: When the conversation started\n\nRaises:\n    404: If the token is invalid or expired, or the conversation is gone.\n         Tokens minted before share links were signed land here too.","operationId":"get_shared_conversation_endpoint_s__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharedConversationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/consent/{token}":{"post":{"tags":["consent"],"summary":"Receive Consent Answer","description":"Record the answer the consent service posts for one case.","operationId":"receive_consent_answer_webhooks_consent__token__post","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"}}}}}}},"/projects/{project_id}/consent-cases":{"get":{"tags":["consent"],"summary":"List Consent Cases","description":"The consent record of the account that owns the project, newest first (from the service).","operationId":"list_consent_cases_projects__project_id__consent_cases_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["pending","accepted","declined","expired"],"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"external_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/team-calendar/members":{"get":{"tags":["team-calendar"],"summary":"List Members","operationId":"list_members_projects__project_id__team_calendar_members_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["team-calendar"],"summary":"Add Member","operationId":"add_member_projects__project_id__team_calendar_members_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/team-calendar/members/{member_id}":{"patch":{"tags":["team-calendar"],"summary":"Rename Member","operationId":"rename_member_projects__project_id__team_calendar_members__member_id__patch","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"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["team-calendar"],"summary":"Remove Member","operationId":"remove_member_projects__project_id__team_calendar_members__member_id__delete","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"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/team-calendar/members/{member_id}/invite":{"post":{"tags":["team-calendar"],"summary":"New Invite","description":"A new invite link for the person; the previous one stops working.","operationId":"new_invite_projects__project_id__team_calendar_members__member_id__invite_post","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"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/team-calendar/members/{member_id}/check":{"post":{"tags":["team-calendar"],"summary":"Check Member","description":"Re-test the person's calendar access (and pick up a delegation added since).","operationId":"check_member_projects__project_id__team_calendar_members__member_id__check_post","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"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/team-calendar/event-types":{"get":{"tags":["team-calendar"],"summary":"List Event Types","operationId":"list_event_types_projects__project_id__team_calendar_event_types_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["team-calendar"],"summary":"Create Event Type","operationId":"create_event_type_projects__project_id__team_calendar_event_types_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventTypeCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/team-calendar/event-types/{event_type_id}":{"get":{"tags":["team-calendar"],"summary":"Get Event Type","operationId":"get_event_type_projects__project_id__team_calendar_event_types__event_type_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"event_type_id","in":"path","required":true,"schema":{"type":"string","title":"Event Type Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["team-calendar"],"summary":"Update Event Type","operationId":"update_event_type_projects__project_id__team_calendar_event_types__event_type_id__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"event_type_id","in":"path","required":true,"schema":{"type":"string","title":"Event Type Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventTypeUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["team-calendar"],"summary":"Delete Event Type","operationId":"delete_event_type_projects__project_id__team_calendar_event_types__event_type_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"event_type_id","in":"path","required":true,"schema":{"type":"string","title":"Event Type Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/team-calendar/event-types/{event_type_id}/availability":{"get":{"tags":["team-calendar"],"summary":"Preview Availability","description":"The times the assistant would offer right now, with who is free at each.","operationId":"preview_availability_projects__project_id__team_calendar_event_types__event_type_id__availability_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"event_type_id","in":"path","required":true,"schema":{"type":"string","title":"Event Type Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"}},{"name":"max_slots","in":"query","required":false,"schema":{"type":"integer","maximum":60,"minimum":1,"default":20,"title":"Max Slots"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/team-calendar/availability-preview":{"post":{"tags":["team-calendar"],"summary":"Preview Draft Availability","description":"The times a meeting type configured like ``body`` would offer, without saving it (the editor's live preview).","operationId":"preview_draft_availability_projects__project_id__team_calendar_availability_preview_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"max_slots","in":"query","required":false,"schema":{"type":"integer","maximum":60,"minimum":1,"default":20,"title":"Max Slots"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventTypeCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/team-calendar/invites/{token}":{"get":{"tags":["team-calendar"],"summary":"Invite Info","description":"What the person's connect page shows (no login: the token is the authorization).","operationId":"invite_info_public_team_calendar_invites__token__get","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"}}}}}}},"/public/team-calendar/invites/{token}/start":{"post":{"tags":["team-calendar"],"summary":"Start Invite","description":"Send the person to Google's consent screen for this invite.\n\nOnly from our connect page, which first shows which organization is asking:\nGoogle's consent screen names only StudioChat. Browsers send ``Origin`` on a\nform POST, so a form on someone else's page that submits itself is refused.","operationId":"start_invite_public_team_calendar_invites__token__start_post","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"}}}}}}},"/anana/call-stats":{"get":{"tags":["anana"],"summary":"Get Call Stats","description":"Get call counts per endpoint. Used by E2E tests to verify tool execution.","operationId":"get_call_stats_anana_call_stats_get","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/call-stats/reset":{"post":{"tags":["anana"],"summary":"Reset Call Stats","description":"Reset all call counters.","operationId":"reset_call_stats_anana_call_stats_reset_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/products":{"get":{"tags":["anana"],"summary":"List Products","description":"List all available products with optional filters.","operationId":"list_products_anana_products_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ProductCategory"},{"type":"null"}],"title":"Category"}},{"name":"organic_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Organic Only"}},{"name":"in_stock","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"In Stock"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Product"},"title":"Response List Products Anana Products Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/products/{product_id}":{"get":{"tags":["anana"],"summary":"Get Product","description":"Get details of a specific product including stock information.","operationId":"get_product_anana_products__product_id__get","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","title":"Product Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/orders":{"get":{"tags":["anana"],"summary":"List Orders","description":"List all orders with optional status filter.","operationId":"list_orders_anana_orders_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/DeliveryStatus"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20,"title":"Limit"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Order"},"title":"Response List Orders Anana Orders Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["anana"],"summary":"Create Order","description":"Create a new order.\nAll fields are optional - missing data will be auto-generated.\nIf no items provided, random products will be selected.","operationId":"create_order_anana_orders_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/orders/{order_id}":{"get":{"tags":["anana"],"summary":"Get Order","description":"Get details of a specific order. Auto-generates if order doesn't exist.","operationId":"get_order_anana_orders__order_id__get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["anana"],"summary":"Modify Order","description":"Modify an existing order by adding or removing items.\nCan only modify orders that haven't been delivered or cancelled.\nAuto-generates if order doesn't exist.","operationId":"modify_order_anana_orders__order_id__patch","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModifyOrderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/orders/{order_id}/cancel":{"post":{"tags":["anana"],"summary":"Cancel Order","description":"Cancel an order if it hasn't been delivered yet. Auto-generates if order doesn't exist.","operationId":"cancel_order_anana_orders__order_id__cancel_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/orders/{order_id}/tracking":{"get":{"tags":["anana"],"summary":"Get Delivery Tracking","description":"Get delivery tracking history for an order. Auto-generates if order doesn't exist.","operationId":"get_delivery_tracking_anana_orders__order_id__tracking_get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryUpdate"},"title":"Response Get Delivery Tracking Anana Orders  Order Id  Tracking Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/orders/{order_id}/payment":{"get":{"tags":["anana"],"summary":"Get Payment","description":"Whether the order's payment has been credited yet.","operationId":"get_payment_anana_orders__order_id__payment_get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/orders/{order_id}/payment/confirm":{"post":{"tags":["anana"],"summary":"Confirm Payment","description":"The processor credits the payment (what the test does between checks).","operationId":"confirm_payment_anana_orders__order_id__payment_confirm_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/payments/link":{"post":{"tags":["anana"],"summary":"Create Payment Link","description":"Generate a checkout link — either for an existing order's total, or for a bare amount.\n\nThis is the artifact that closes a sale: the assistant builds the order and comes\nback with something the customer can actually pay. Pair it with\n``POST /orders {\"awaiting_payment\": true}`` so the order is still unpaid when the\nlink is issued.","operationId":"create_payment_link_anana_payments_link_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentLink"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/cases":{"post":{"tags":["anana"],"summary":"Open Case","description":"Open a case and return its number.\n\nThe number is the point: a customer who is being told no needs to leave with\nsomething, and a case number is what makes the refusal a decision rather than a\nbrush-off. ``resolution`` is for a case that opens already settled — the assistant\ndeclined the claim and offered the alternative in the same breath.","operationId":"open_case_anana_cases_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCaseRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportCase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/cases/{case_id}":{"get":{"tags":["anana"],"summary":"Get Case","description":"Look a case up by id.","operationId":"get_case_anana_cases__case_id__get","parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportCase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/invoices":{"get":{"tags":["anana"],"summary":"List Invoices","description":"List corporate-account invoices, newest first. Filter by status, CUIT or customer.","operationId":"list_invoices_anana_invoices_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/InvoiceStatus"},{"type":"null"}],"title":"Status"}},{"name":"cuit","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cuit"}},{"name":"customer_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Case-insensitive substring match","title":"Customer Name"},"description":"Case-insensitive substring match"},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"},"title":"Response List Invoices Anana Invoices Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/invoices/{invoice_id}":{"get":{"tags":["anana"],"summary":"Get Invoice","description":"One invoice, by id or by invoice number.","operationId":"get_invoice_anana_invoices__invoice_id__get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/invoices/{invoice_id}/payment-promise":{"post":{"tags":["anana"],"summary":"Register Payment Promise","description":"Record that the customer committed to a date.\n\nThe invoice deliberately stays overdue: a promise is not a payment, and a collections\nagent that closed the case on a promise would be reporting money it does not have.\nWhat the promise buys is a date to follow up on.","operationId":"register_payment_promise_anana_invoices__invoice_id__payment_promise_post","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentPromiseRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentPromise"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/anana/invoices/{invoice_id}/payment-promises":{"get":{"tags":["anana"],"summary":"List Payment Promises","description":"Every promise made on an invoice, newest first — so a second call sees the first.","operationId":"list_payment_promises_anana_invoices__invoice_id__payment_promises_get","parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PaymentPromise"},"title":"Response List Payment Promises Anana Invoices  Invoice Id  Payment Promises Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/demo/frutas":{"get":{"tags":["demo"],"summary":"Demo Fruit Catalog","description":"Demo fruit catalog endpoint for E2E testing.\n\nReturns a list of fruits with prices, stock, and origin information.\nCan filter by specific fruit name.\n\nArgs:\n    fruta: Optional fruit name to filter (case-insensitive)\n\nReturns:\n    If fruta is specified: Single fruit data or error message\n    Otherwise: Full catalog with all fruits","operationId":"demo_fruit_catalog_demo_frutas_get","parameters":[{"name":"fruta","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fruta"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/demo/quote":{"post":{"tags":["demo"],"summary":"Demo Quote","description":"Return a price quote based on plan, VIP flag, and seat count.","operationId":"demo_quote_demo_quote_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/demo/customer-lookup":{"post":{"tags":["demo"],"summary":"Demo Customer Lookup","description":"Lookup a customer by email.\n\nUsed by E2E tests to verify that ``{{ context.contact.email }}`` is resolved\nfrom the chat request context and sent in the POST body.","operationId":"demo_customer_lookup_demo_customer_lookup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerLookupRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/enrichments/intercom":{"get":{"tags":["enrichments"],"summary":"Get Intercom Enrichment","description":"Return current Intercom enrichment config status (API key is never echoed).","operationId":"get_intercom_enrichment_projects__project_id__enrichments_intercom_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomEnrichmentStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["enrichments"],"summary":"Upsert Intercom Enrichment","description":"Save (or update) the Intercom API key and enabled flag for a project.\n\nA new key is checked twice before it's stored: that it can read\nconversations at all, and that it sees this project's own recent\nconversations. The second catches a key from another Intercom workspace,\nwhich the first lets through — the sync would then call every run ok while\nimporting nothing.","operationId":"upsert_intercom_enrichment_projects__project_id__enrichments_intercom_put","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomEnrichmentUpsert"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomEnrichmentStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["enrichments"],"summary":"Delete Intercom Enrichment","operationId":"delete_intercom_enrichment_projects__project_id__enrichments_intercom_delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/enrichments/intercom/test":{"post":{"tags":["enrichments"],"summary":"Test Intercom Api Key","description":"Validate an Intercom API key without saving it — used by the Test button.","operationId":"test_intercom_api_key_projects__project_id__enrichments_intercom_test_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomEnrichmentTestRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomEnrichmentTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/enrichments/intercom/probe":{"post":{"tags":["enrichments"],"summary":"Probe Intercom Conversation","description":"End-to-end probe: uses the SAVED API key to fetch a specific Intercom\nconversation, and reports whether we also own that conversation in Studio Chat.\n\nThis is the real \"does the integration work?\" check — it exercises the\n`Read conversations` scope rather than just token validity.","operationId":"probe_intercom_conversation_projects__project_id__enrichments_intercom_probe_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomProbeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomProbeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/enrichments/intercom/verify":{"post":{"tags":["enrichments"],"summary":"Verify Intercom Enrichment","description":"Check the SAVED key against this project's most recent conversations.\n\nAnswers \"is this working?\" without waiting for the next scheduled run and\nwithout knowing a conversation id: the same search the sync makes, over\nconversations this project really has. Read-only — nothing is imported.","operationId":"verify_intercom_enrichment_projects__project_id__enrichments_intercom_verify_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomKeyCheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/enrichments/intercom/sync":{"post":{"tags":["enrichments"],"summary":"Sync Intercom Now","description":"Trigger a sync immediately. Useful for a small-window verification after\nconfiguring the integration. Long/heavy backfills should go through the CLI\nto avoid HTTP timeouts.","operationId":"sync_intercom_now_projects__project_id__enrichments_intercom_sync_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"window_days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Window Days"}},{"name":"concurrency","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Concurrency"}},{"name":"batch_size","in":"query","required":false,"schema":{"type":"integer","default":150,"title":"Batch Size"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntercomSyncResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversion-metrics":{"get":{"tags":["conversion-metrics"],"summary":"List Conversion Metrics","description":"List all conversion metric definitions for a project.\n\nRead-only — accepts JWT, admin keys, and project (`sbs_`) API keys so\nexternal analytics consumers can discover available slugs. Mutations\n(`POST` / `PATCH` / `DELETE`) still require an admin/JWT user.","operationId":"list_conversion_metrics_projects__project_id__conversion_metrics_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ConversionMetricDefinitionResponse"},"title":"Response List Conversion Metrics Projects  Project Id  Conversion Metrics Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["conversion-metrics"],"summary":"Create Conversion Metric","description":"Create a new conversion metric definition.","operationId":"create_conversion_metric_projects__project_id__conversion_metrics_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionMetricDefinitionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionMetricDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversion-metrics/{slug}":{"get":{"tags":["conversion-metrics"],"summary":"Get Conversion Metric","description":"Read a single conversion metric definition by slug.\n\nRead-only — same auth surface as the list endpoint (JWT / admin / project API key).","operationId":"get_conversion_metric_projects__project_id__conversion_metrics__slug__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionMetricDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["conversion-metrics"],"summary":"Update Conversion Metric","operationId":"update_conversion_metric_projects__project_id__conversion_metrics__slug__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionMetricDefinitionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionMetricDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["conversion-metrics"],"summary":"Delete Conversion Metric","description":"Delete a conversion metric definition (cascades to its events).","operationId":"delete_conversion_metric_projects__project_id__conversion_metrics__slug__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/conversion-metrics/{metric_id}/events":{"post":{"tags":["conversion-metrics"],"summary":"Ingest Conversion Events","description":"Ingest one or more conversion events for a metric.\n\nAccepts either a single event or `{\"events\": [...]}` for batches.\nCaller is expected to authenticate with a project API key (X-API-Key);\nJWT also works for admin/dev usage.\n\nPath is keyed by the metric's UUID so the URL stays the same even if the\nuser renames the slug, and so it never leaks the project_id.","operationId":"ingest_conversion_events_conversion_metrics__metric_id__events_post","parameters":[{"name":"metric_id","in":"path","required":true,"schema":{"type":"string","title":"Metric Id"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ConversionEventBatchIngest"},{"$ref":"#/components/schemas/ConversionEventIngest"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionIngestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/conversion-metrics/{slug}/analytics":{"get":{"tags":["conversion-metrics"],"summary":"Get Conversion Metric Analytics","description":"Dashboard payload for a single conversion metric.","operationId":"get_conversion_metric_analytics_projects__project_id__conversion_metrics__slug__analytics_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated; AND logic","title":"Tags"},"description":"Comma-separated; AND logic"},{"name":"tag_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JSON-encoded TagExpr (AND/OR/NOT)","title":"Tag Filter"},"description":"JSON-encoded TagExpr (AND/OR/NOT)"},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"}},{"name":"events_limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":25,"title":"Events Limit"}},{"name":"events_offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Events Offset"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA zone the time series is bucketed in (e.g. America/Argentina/Buenos_Aires). Also the zone a naive start_date/end_date is read in. Defaults to UTC, which reproduces the pre-timezone behaviour exactly.","default":"UTC","title":"Timezone"},"description":"IANA zone the time series is bucketed in (e.g. America/Argentina/Buenos_Aires). Also the zone a naive start_date/end_date is read in. Defaults to UTC, which reproduces the pre-timezone behaviour exactly."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionAnalytics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/csat/analytics":{"get":{"tags":["csat-analytics"],"summary":"Get Project Csat Analytics","description":"CSAT dashboard payload: summary KPIs, distribution, time series, ratings table.\n\nIf the project has no Intercom CSAT config, responds with `is_configured=false`\nand empty/zeroed fields — the FE shows a CTA to Settings → Enrichments.","operationId":"get_project_csat_analytics_projects__project_id__csat_analytics_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list; AND logic","title":"Tags"},"description":"Comma-separated list; AND logic"},{"name":"tag_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JSON-encoded TagExpr (AND/OR/NOT tree). Takes precedence over `tags` when provided.","title":"Tag Filter"},"description":"JSON-encoded TagExpr (AND/OR/NOT tree). Takes precedence over `tags` when provided."},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to a single assistant (playbook base)","title":"Playbook Base Id"},"description":"Filter to a single assistant (playbook base)"},{"name":"ratings_limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":10,"title":"Ratings Limit"}},{"name":"ratings_offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Ratings Offset"}},{"name":"max_rating","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":5,"minimum":1},{"type":"null"}],"description":"Filter the ratings table to rows with rating ≤ this value (drill-down). Applies to the table + its pagination only — KPIs, distribution, and time series stay on the unfiltered dataset.","title":"Max Rating"},"description":"Filter the ratings table to rows with rating ≤ this value (drill-down). Applies to the table + its pagination only — KPIs, distribution, and time series stay on the unfiltered dataset."},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA zone the time series is bucketed in (e.g. America/Argentina/Buenos_Aires). Also the zone a naive start_date/end_date is read in. Defaults to UTC, which reproduces the pre-timezone behaviour exactly.","default":"UTC","title":"Timezone"},"description":"IANA zone the time series is bucketed in (e.g. America/Argentina/Buenos_Aires). Also the zone a naive start_date/end_date is read in. Defaults to UTC, which reproduces the pre-timezone behaviour exactly."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CSATAnalytics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/metrics/{metric}/analytics":{"get":{"tags":["metric-analytics"],"summary":"Get Metric Dashboard Analytics","operationId":"get_metric_dashboard_analytics_projects__project_id__metrics__metric__analytics_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"metric","in":"path","required":true,"schema":{"type":"string","description":"One of: sentiment, sentiment_shift, recontact_risk, handoff_reason, deflection_quality, resources.","title":"Metric"},"description":"One of: sentiment, sentiment_shift, recontact_risk, handoff_reason, deflection_quality, resources."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated list; AND logic","title":"Tags"},"description":"Comma-separated list; AND logic"},{"name":"tag_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JSON-encoded TagExpr (AND/OR/NOT tree). Takes precedence over `tags` when provided.","title":"Tag Filter"},"description":"JSON-encoded TagExpr (AND/OR/NOT tree). Takes precedence over `tags` when provided."},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"}},{"name":"label_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Restrict the conversations table (and its pagination denominator) to rows matching this label. KPIs / distribution / time series stay on the unfiltered set.","title":"Label Filter"},"description":"Restrict the conversations table (and its pagination denominator) to rows matching this label. KPIs / distribution / time series stay on the unfiltered set."},{"name":"conversations_limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":10,"title":"Conversations Limit"}},{"name":"conversations_offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Conversations Offset"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA zone the time series is bucketed in (e.g. America/Argentina/Buenos_Aires). Also the zone a naive start_date/end_date is read in. Defaults to UTC, which reproduces the pre-timezone behaviour exactly.","default":"UTC","title":"Timezone"},"description":"IANA zone the time series is bucketed in (e.g. America/Argentina/Buenos_Aires). Also the zone a naive start_date/end_date is read in. Defaults to UTC, which reproduces the pre-timezone behaviour exactly."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricDashboardAnalytics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/eval-cases":{"post":{"tags":["evals"],"summary":"Create Case","description":"Create a new eval case for a playbook.","operationId":"create_case_playbooks__base_id__eval_cases_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalCaseCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalCase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["evals"],"summary":"List Cases","description":"List all eval cases for a playbook. Soft-deleted cases are excluded\nunless ``include_deleted`` (e.g. for a restore/trash view).","operationId":"list_cases_playbooks__base_id__eval_cases_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"enabled_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Enabled Only"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Deleted"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EvalCase"},"title":"Response List Cases Playbooks  Base Id  Eval Cases Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/eval-cases/batch":{"post":{"tags":["evals"],"summary":"Create Cases Batch","description":"Create multiple eval cases at once. Up to 100 cases per request.","operationId":"create_cases_batch_playbooks__base_id__eval_cases_batch_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalCaseBatchCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EvalCase"},"title":"Response Create Cases Batch Playbooks  Base Id  Eval Cases Batch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval-cases/{case_id}":{"get":{"tags":["evals"],"summary":"Get Case","description":"Get an eval case by ID. Pass ``include_deleted`` to also fetch a\nsoft-deleted case (e.g. the detail view showing a past run of a case that\nhas since been removed, with an ``is_deleted`` tombstone).","operationId":"get_case_eval_cases__case_id__get","parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}},{"name":"include_deleted","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Deleted"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalCase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["evals"],"summary":"Update Case","description":"Update an eval case.","operationId":"update_case_eval_cases__case_id__patch","parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalCaseUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalCase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["evals"],"summary":"Delete Case","description":"Soft-delete an eval case (recoverable).","operationId":"delete_case_eval_cases__case_id__delete","parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval-cases/{case_id}/history":{"get":{"tags":["evals"],"summary":"Get Case History","description":"Recent executions of a single test case (newest first) for the editor panel.","operationId":"get_case_history_eval_cases__case_id__history_get","parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CaseRunHistoryItem"},"title":"Response Get Case History Eval Cases  Case Id  History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval-cases/{case_id}/restore":{"post":{"tags":["evals"],"summary":"Restore Case","description":"Restore a soft-deleted eval case. 409 if a live case now occupies the\nsame (playbook, name).","operationId":"restore_case_eval_cases__case_id__restore_post","parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","title":"Case Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalCase"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/eval-runs":{"post":{"tags":["evals"],"summary":"Trigger an eval run","description":"Trigger an eval run for a playbook version.\n\nWalks every enabled ``EvalCase`` for ``base_id`` against the version\nnamed in ``data.playbook_id``. Each case kicks off a simulated\nconversation through the playbook agent, captures the full event +\ntool-call trace, and runs the case's assertions over the trace. The\nresponse returns immediately (202) with a pending ``EvalRun`` row.\n\nExecution venue: in production (``RENDER_API_KEY`` + ``RENDER_SERVICE_ID``\nconfigured) the run is offloaded to a Render one-off job — one job per\nrun, its own short-lived instance, so eval load never lands on the API\nserver. The job id is persisted on ``EvalRun.render_job_id``. Everywhere\nelse (and as fallback if job creation fails) the run executes in an\nin-process background task with ``concurrency`` clamped to 5.\n\nTunables on ``EvalRunCreate``:\n\n  - ``user_context`` — JSON dict merged into every case's runtime\n    context. Use ``eval_overrides.*`` for ground-truth values\n    judges read directly.\n  - ``model`` — model override applied to every case (top of the\n    resolver chain). OpenRouter syntax including fallback notation\n    (``primary{timeout}fallback``) and A/B (``a:50,b:50``).\n  - ``concurrency`` — 1..16. ``1`` = sequential walk; higher values\n    fan cases out across a thread pool. The full range only applies\n    on Render one-off jobs; in-process runs clamp to 5. Tune to your\n    provider's rate limits — recommended 4–8 for ad-hoc runs.\n  - ``judge_mode`` — ``llm`` (default), ``jev_then_llm`` (jev settles\n    confident text passes, everything else goes to the LLM judge) or\n    ``shadow`` (LLM decides, jev recorded for calibration). The jev\n    modes need ``TYPESAFE_API_KEY`` (422 otherwise).\n\nPolling: ``GET /eval-runs/{run_id}`` returns the same row with\nlive counters; ``GET /eval-runs/{run_id}/results`` returns the\nper-case ``EvalResult`` rows once they exist. Cancel mid-flight\nwith ``POST /eval-runs/{run_id}/cancel`` — in-flight cases finish\ntheir result row but the run-level summary stops advancing.","operationId":"run_evals_playbooks__base_id__eval_runs_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalRunCreate"}}}},"responses":{"202":{"description":"Run accepted; ``EvalRun`` body has status=``pending``.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalRun"}}}},"400":{"description":"Playbook has no enabled test cases (nothing to run)."},"404":{"description":"Playbook or playbook version not found."},"422":{"description":"Validation error (e.g. malformed ``model``, ``concurrency`` out of range, or a jev ``judge_mode`` on a deployment without ``TYPESAFE_API_KEY``)."}}},"get":{"tags":["evals"],"summary":"List Runs","description":"List eval runs for a playbook with pagination and optional filters.","operationId":"list_runs_playbooks__base_id__eval_runs_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Page Size"}},{"name":"trigger_source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by trigger source (e.g. ``ci`` for CI-check runs).","title":"Trigger Source"},"description":"Filter by trigger source (e.g. ``ci`` for CI-check runs)."},{"name":"playbook_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by playbook version id — e.g. the editor's check badge asks for the viewed version only.","title":"Playbook Id"},"description":"Filter by playbook version id — e.g. the editor's check badge asks for the viewed version only."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalRunsPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval-runs/{run_id}":{"get":{"tags":["evals"],"summary":"Get Run","description":"Get an eval run by ID with details.","operationId":"get_run_eval_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalRunWithDetails"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval-runs/{run_id}/cancel":{"post":{"tags":["evals"],"summary":"Cancel Run","description":"Cancel a running eval run.\n\nSets the status to 'cancelled'. The runner will check this status\nafter each test case and stop if cancelled.","operationId":"cancel_run_eval_runs__run_id__cancel_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalRunWithDetails"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/eval-matrix":{"get":{"tags":["evals"],"summary":"Get Eval Matrix","description":"Cases × recent-runs result matrix for one assistant. Run columns carry\nthe playbook version they exercised; cells carry per-case status + result\nid for drill-down.","operationId":"get_eval_matrix_playbooks__base_id__eval_matrix_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"runs","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":1,"description":"How many recent runs (columns) to include.","default":10,"title":"Runs"},"description":"How many recent runs (columns) to include."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalMatrix"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval-runs/{run_id}/results":{"get":{"tags":["evals"],"summary":"List Results","description":"List all results for an eval run.","operationId":"list_results_eval_runs__run_id__results_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EvalResultWithCase-Output"},"title":"Response List Results Eval Runs  Run Id  Results Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval-results/{result_id}":{"get":{"tags":["evals"],"summary":"Get Result","description":"Get an eval result by ID.","operationId":"get_result_eval_results__result_id__get","parameters":[{"name":"result_id","in":"path","required":true,"schema":{"type":"string","title":"Result Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval-runs/{run_a_id}/diff/{run_b_id}":{"get":{"tags":["evals"],"summary":"Diff Runs","description":"Diff two eval runs case-by-case.\n\nAnchors on case name (so a renamed case looks like one removal + one\naddition; that's intentional — keeps the algorithm simple, and rename\nflows are rare). Both runs must exist; they may belong to different\nplaybook versions (the diff is the whole point).","operationId":"diff_runs_eval_runs__run_a_id__diff__run_b_id__get","parameters":[{"name":"run_a_id","in":"path","required":true,"schema":{"type":"string","title":"Run A Id"}},{"name":"run_b_id","in":"path","required":true,"schema":{"type":"string","title":"Run B Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalRunDiff"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/eval-cases/dry-run":{"post":{"tags":["evals"],"summary":"Start Dry Run Route","description":"Kick off an in-process dry-run; the FE polls the GET endpoint below.","operationId":"start_dry_run_route_playbooks__base_id__eval_cases_dry_run_post","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DryRunStartRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DryRunStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval-cases/dry-run/{dry_run_id}":{"get":{"tags":["evals"],"summary":"Get Dry Run Route","description":"Return the current state of a dry-run (status + turns + results).","operationId":"get_dry_run_route_eval_cases_dry_run__dry_run_id__get","parameters":[{"name":"dry_run_id","in":"path","required":true,"schema":{"type":"string","title":"Dry Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DryRunState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval-cases/dry-run/{dry_run_id}/cancel":{"post":{"tags":["evals"],"summary":"Cancel Dry Run Route","description":"Signal a running dry-run to stop on the next turn boundary.\n\nReturns the (possibly already final) state. The simulator notices the\ncancel flag in its progress callback between turns and exits cleanly,\nso the FE typically does one more poll to render the ``cancelled``\nsnapshot with whatever partial turns were captured.","operationId":"cancel_dry_run_route_eval_cases_dry_run__dry_run_id__cancel_post","parameters":[{"name":"dry_run_id","in":"path","required":true,"schema":{"type":"string","title":"Dry Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DryRunState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/eval-metrics":{"get":{"tags":["evals"],"summary":"Get Eval Metrics","description":"Aggregate eval metrics for one assistant: pass-rate trend, per-assertion-type\nbreakdown, totals and cost. Computed on demand from existing run/result rows.","operationId":"get_eval_metrics_playbooks__base_id__eval_metrics_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalMetrics"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{base_id}/eval-coverage":{"get":{"tags":["evals"],"summary":"Get Eval Coverage","description":"Deterministic coverage for an assistant version: which configured tools,\nskills, knowledge bases and behaviours its eval suite exercises.","operationId":"get_eval_coverage_playbooks__base_id__eval_coverage_get","parameters":[{"name":"base_id","in":"path","required":true,"schema":{"type":"string","title":"Base Id"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Version number to report on. Defaults to the latest version.","title":"Version"},"description":"Version number to report on. Defaults to the latest version."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalCoverageReport"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/eval-metrics/overview":{"get":{"tags":["evals"],"summary":"Get Eval Overview","description":"Project-wide eval health: one summary row per assistant (pass-rate,\ncoverage, recency, composite health score) for the dashboard.","operationId":"get_eval_overview_projects__project_id__eval_metrics_overview_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvalOverview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/example-blocks":{"post":{"tags":["example-blocks"],"summary":"Create Example Block","description":"Create a new example block for a project.","operationId":"create_example_block_projects__project_id__example_blocks_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExampleBlockCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExampleBlock"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["example-blocks"],"summary":"List Example Blocks","description":"List a project's example blocks. Archived blocks are excluded unless\n``include_archived``.","operationId":"list_example_blocks_projects__project_id__example_blocks_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","description":"Also return archived blocks (hidden by default).","default":false,"title":"Include Archived"},"description":"Also return archived blocks (hidden by default)."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExampleBlock"},"title":"Response List Example Blocks Projects  Project Id  Example Blocks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/example-blocks/{block_id}":{"get":{"tags":["example-blocks"],"summary":"Get Example Block","description":"Get a specific example block. Archived blocks resolve too (pill hover\ncards and saved versions keep pointing at them) — read ``is_archived``.","operationId":"get_example_block_projects__project_id__example_blocks__block_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"block_id","in":"path","required":true,"schema":{"type":"string","title":"Block Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExampleBlock"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["example-blocks"],"summary":"Update Example Block","description":"Update an example block. 409 on an archived block — unarchive it first.\n\nThrough a Rumo MCP connection it queues for approval (account policy): the\nblock expands into every assistant that references it, live.","operationId":"update_example_block_projects__project_id__example_blocks__block_id__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"block_id","in":"path","required":true,"schema":{"type":"string","title":"Block Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExampleBlockUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExampleBlock"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["example-blocks"],"summary":"Delete Example Block","description":"Deprecated alias of POST /projects/{project_id}/example-blocks/{block_id}/archive.\n\nKept so existing integrations (and approvals queued before the rename) do\nnot 404. It archives — it no longer hard-deletes the row.","operationId":"delete_example_block_projects__project_id__example_blocks__block_id__delete","deprecated":true,"parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"block_id","in":"path","required":true,"schema":{"type":"string","title":"Block Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/example-blocks/{block_id}/archive":{"post":{"tags":["example-blocks"],"summary":"Archive Example Block","description":"Archive an example block — hide it from the list without deleting anything.\n\nBlocks are never deleted. Archiving has NO runtime effect: every\n``{{ examples: ID }}`` pill that references the block keeps expanding in\nevery saved playbook version (history and rollback targets included), so\nassistants keep answering exactly as before. It is reversible from\nPOST /unarchive and idempotent.","operationId":"archive_example_block_projects__project_id__example_blocks__block_id__archive_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"block_id","in":"path","required":true,"schema":{"type":"string","title":"Block Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExampleBlock"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/example-blocks/{block_id}/unarchive":{"post":{"tags":["example-blocks"],"summary":"Unarchive Example Block","description":"Un-archive an example block (idempotent on a live block).","operationId":"unarchive_example_block_projects__project_id__example_blocks__block_id__unarchive_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"block_id","in":"path","required":true,"schema":{"type":"string","title":"Block Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExampleBlock"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/preview/group-chat":{"post":{"tags":["group-chat"],"summary":"Send a group chat message","description":"Send a message as a persona in a group chat preview. The AI assistant will decide whether to respond based on the conversation context.","operationId":"send_group_chat_message_playbooks__playbook_id__preview_group_chat_post","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupChatMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupChatMessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/preview/group-chat/{conversation_id}/messages":{"get":{"tags":["group-chat"],"summary":"Get group chat messages","description":"Retrieve all messages in a group chat conversation.","operationId":"get_group_chat_messages_playbooks__playbook_id__preview_group_chat__conversation_id__messages_get","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupChatMessagesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/playbooks/{playbook_id}/preview/group-chat/{conversation_id}":{"delete":{"tags":["group-chat"],"summary":"Clear group chat","description":"Delete all messages in a group chat conversation.","operationId":"clear_group_chat_playbooks__playbook_id__preview_group_chat__conversation_id__delete","parameters":[{"name":"playbook_id","in":"path","required":true,"schema":{"type":"string","title":"Playbook Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/approvals":{"get":{"tags":["approvals"],"summary":"List Approvals","description":"List approval requests for the current account.\n\nOptional query param `status` filters by approval status (pending, approved,\nrejected, executed, failed, superseded, expired). Optional `project_id` keeps\nthat project's rows plus project-less rows whose queued request path targets\nit. Optional `target_id` keeps the rows computed against that target — an\nassistant's base_id lists that assistant's change requests.","operationId":"list_approvals_approvals_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"}},{"name":"target_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalResponse"},"title":"Response List Approvals Approvals Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/approval-policy":{"get":{"tags":["approvals"],"summary":"Get Approval Policy","description":"Read the account's approval policy.","operationId":"get_approval_policy_approval_policy_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalPolicy"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["approvals"],"summary":"Update Approval Policy","description":"Change the account's approval policy. A person in the dashboard only.\n\nNever through an MCP connection or a sandbox key: the policy is what holds\ntheir changes for review, so they must not be able to switch it off.","operationId":"update_approval_policy_approval_policy_put","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalPolicy"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalPolicy"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/approvals/{approval_id}":{"get":{"tags":["approvals"],"summary":"Get Approval","description":"Get a single approval request by ID.","operationId":"get_approval_approvals__approval_id__get","parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/approvals/{approval_id}/description":{"patch":{"tags":["approvals"],"summary":"Set Approval Description","description":"Attach a human-readable explanation of the queued change.\n\nIntended for the caller that triggered the operation — typically an agent:\nthe 202 response carries the approval_id, and calling this right after\ngives the reviewing admin a readable account of WHAT is changing instead\nof a raw payload. Deliberately NOT admin-gated: the sandbox identity that\nqueued the request is exactly who knows the intent. Pending-only — once\nreviewed, what the reviewer saw stays immutable (409 otherwise).","operationId":"set_approval_description_approvals__approval_id__description_patch","parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDescriptionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/approvals/notification-config":{"get":{"tags":["approvals"],"summary":"Get Approval Notification Config","description":"Return the project's approval notification config.\n\nIf none exists yet, return a default-disabled config so the FE always has a\nshape to render.","operationId":"get_approval_notification_config_projects__project_id__approvals_notification_config_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalNotificationConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["approvals"],"summary":"Update Approval Notification Config","description":"Create or update the project's approval notification config.","operationId":"update_approval_notification_config_projects__project_id__approvals_notification_config_put","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalNotificationConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalNotificationConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/approvals/{approval_id}/approve":{"post":{"tags":["approvals"],"summary":"Approve Request","description":"Approve a pending request and execute the original operation.\n\nOnly a human admin can approve — sandbox API keys are rejected even though\nrequire_admin() would otherwise treat them as admin (see require_human_admin()).\nThe transition and the replay live in ``app/services/approval_actions.py``\nso this route and the Slack button run the same code.\n\n``?activate=true`` also activates the assistant version the change created\n(see ``activation`` on GET /approvals/{id}); the result says whether it did.\n``expected_active_version`` / ``expected_latest_version`` are the offer the\nreviewer saw: if the assistant moved since, nothing is applied (409).","operationId":"approve_request_approvals__approval_id__approve_post","parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}},{"name":"activate","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Activate"}},{"name":"expected_active_version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Active Version"}},{"name":"expected_latest_version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Latest Version"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDecisionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/approvals/{approval_id}/reject":{"post":{"tags":["approvals"],"summary":"Reject Request","description":"Reject a pending approval request. Only a human admin can reject — see require_human_admin().","operationId":"reject_request_approvals__approval_id__reject_post","parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/approvals/{approval_id}/decide":{"post":{"tags":["approvals"],"summary":"Decide From Approval View","description":"Approve or reject from the approval view an MCP host renders in the chat.\n\nThe third way into ``app/services/approval_actions.py``, after the dashboard\nand Slack, running the very same transition and replay. It answers ONLY the\nStudioChat MCP service's in-process dispatch token, and only with a ticket\nthe view got from ``review_approval`` (``app/mcp_tokens.py``): a view's call\nand the model's arrive with the same credential, so the ticket — which hosts\ngive the view and keep from the model — is what tells them apart.\n\nThe person deciding is re-read from the database by the ticket's user id:\nan ACTIVE ADMIN of the approval's account, exactly like Slack resolves its\nclicker. Their name, not the connection's \"(MCP)\" label, is the reviewer.\nSee learning mcp-inline-approvals.","operationId":"decide_from_approval_view_approvals__approval_id__decide_post","parameters":[{"name":"approval_id","in":"path","required":true,"schema":{"type":"string","title":"Approval Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDecision"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalDecisionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/api-tools":{"get":{"tags":["resource-analytics"],"summary":"Get Api Tool Analytics","description":"Return analytics for custom API tool executions.","operationId":"get_api_tool_analytics_projects__project_id__analytics_api_tools_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"api_tool_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by specific API tool","title":"Api Tool Id"},"description":"Filter by specific API tool"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max recent items to return","default":50,"title":"Limit"},"description":"Max recent items to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset for pagination of recent items","default":0,"title":"Offset"},"description":"Offset for pagination of recent items"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search in input_params, output_result, conversation_id","title":"Search"},"description":"Search in input_params, output_result, conversation_id"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated tags (AND logic); use tag_filter for AND/OR/NOT","title":"Tags"},"description":"Comma-separated tags (AND logic); use tag_filter for AND/OR/NOT"},{"name":"tag_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JSON-encoded TagExpr (AND/OR/NOT tree)","title":"Tag Filter"},"description":"JSON-encoded TagExpr (AND/OR/NOT tree)"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"include_stats","in":"query","required":false,"schema":{"type":"boolean","description":"false: return only `recent` — the totals come back 0 and the breakdowns and the time series empty. For paging or searching the call log without recomputing the aggregates.","default":true,"title":"Include Stats"},"description":"false: return only `recent` — the totals come back 0 and the breakdowns and the time series empty. For paging or searching the call log without recomputing the aggregates."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToolAnalyticsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/toolkits":{"get":{"tags":["resource-analytics"],"summary":"Get Toolkit Analytics","description":"Return analytics for integration toolkit action executions.","operationId":"get_toolkit_analytics_projects__project_id__analytics_toolkits_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"toolkit_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by toolkit slug","title":"Toolkit Slug"},"description":"Filter by toolkit slug"},{"name":"action_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by action name","title":"Action Name"},"description":"Filter by action name"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max recent items to return","default":50,"title":"Limit"},"description":"Max recent items to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset for pagination of recent items","default":0,"title":"Offset"},"description":"Offset for pagination of recent items"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search in input_params, output_result, conversation_id","title":"Search"},"description":"Search in input_params, output_result, conversation_id"},{"name":"param_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by input_params JSON key:value (e.g. ticket_type_id:67)","title":"Param Filter"},"description":"Filter by input_params JSON key:value (e.g. ticket_type_id:67)"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated tags (AND logic); use tag_filter for AND/OR/NOT","title":"Tags"},"description":"Comma-separated tags (AND logic); use tag_filter for AND/OR/NOT"},{"name":"tag_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JSON-encoded TagExpr (AND/OR/NOT tree)","title":"Tag Filter"},"description":"JSON-encoded TagExpr (AND/OR/NOT tree)"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"include_stats","in":"query","required":false,"schema":{"type":"boolean","description":"false: return only `recent` — the totals come back 0 and the breakdowns and the time series empty. For paging or searching the call log without recomputing the aggregates.","default":true,"title":"Include Stats"},"description":"false: return only `recent` — the totals come back 0 and the breakdowns and the time series empty. For paging or searching the call log without recomputing the aggregates."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolkitAnalyticsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/api-tools/sparklines":{"get":{"tags":["resource-analytics"],"summary":"Get Api Tool Sparklines","description":"Return per-tool sparkline data (daily counts) for all API tools in the project.","operationId":"get_api_tool_sparklines_projects__project_id__analytics_api_tools_sparklines_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Number of trailing days","default":14,"title":"Days"},"description":"Number of trailing days"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SparklineItem"},"title":"Response Get Api Tool Sparklines Projects  Project Id  Analytics Api Tools Sparklines Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/toolkit-calls/sparklines":{"get":{"tags":["resource-analytics"],"summary":"Get Toolkit Sparklines","description":"Return per-toolkit sparkline data (daily counts) for all toolkits in the project.","operationId":"get_toolkit_sparklines_projects__project_id__analytics_toolkit_calls_sparklines_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Number of trailing days","default":14,"title":"Days"},"description":"Number of trailing days"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SparklineItem"},"title":"Response Get Toolkit Sparklines Projects  Project Id  Analytics Toolkit Calls Sparklines Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/skills":{"get":{"tags":["resource-analytics"],"summary":"Get Skill Analytics","description":"Return analytics for skill load events.","operationId":"get_skill_analytics_projects__project_id__analytics_skills_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"skill_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by skill name","title":"Skill Name"},"description":"Filter by skill name"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max recent items to return","default":50,"title":"Limit"},"description":"Max recent items to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset for pagination of recent items","default":0,"title":"Offset"},"description":"Offset for pagination of recent items"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search in skill_name, conversation_id, error_message","title":"Search"},"description":"Search in skill_name, conversation_id, error_message"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated tags (AND logic); use tag_filter for AND/OR/NOT","title":"Tags"},"description":"Comma-separated tags (AND logic); use tag_filter for AND/OR/NOT"},{"name":"tag_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JSON-encoded TagExpr (AND/OR/NOT tree)","title":"Tag Filter"},"description":"JSON-encoded TagExpr (AND/OR/NOT tree)"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"include_stats","in":"query","required":false,"schema":{"type":"boolean","description":"false: return only `recent` — the totals come back 0 and the breakdowns and the time series empty. For paging or searching the call log without recomputing the aggregates.","default":true,"title":"Include Stats"},"description":"false: return only `recent` — the totals come back 0 and the breakdowns and the time series empty. For paging or searching the call log without recomputing the aggregates."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillAnalyticsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/skills/sparklines":{"get":{"tags":["resource-analytics"],"summary":"Get Skill Sparklines","description":"Return per-skill sparkline data (daily counts) for all skills in the project.","operationId":"get_skill_sparklines_projects__project_id__analytics_skills_sparklines_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Number of trailing days","default":14,"title":"Days"},"description":"Number of trailing days"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SparklineItem"},"title":"Response Get Skill Sparklines Projects  Project Id  Analytics Skills Sparklines Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/followups":{"get":{"tags":["resource-analytics"],"summary":"Get Followup Analytics","description":"Return analytics for follow-up (winback) attempts: totals, the per-step funnel, and recent sends.","operationId":"get_followup_analytics_projects__project_id__analytics_followups_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"rule_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by follow-up rule id","title":"Rule Id"},"description":"Filter by follow-up rule id"},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by assistant","title":"Playbook Base Id"},"description":"Filter by assistant"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max recent items to return","default":50,"title":"Limit"},"description":"Max recent items to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset for pagination of recent items","default":0,"title":"Offset"},"description":"Offset for pagination of recent items"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search in conversation_id","title":"Search"},"description":"Search in conversation_id"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated tags (AND logic); use tag_filter for AND/OR/NOT","title":"Tags"},"description":"Comma-separated tags (AND logic); use tag_filter for AND/OR/NOT"},{"name":"tag_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JSON-encoded TagExpr (AND/OR/NOT tree)","title":"Tag Filter"},"description":"JSON-encoded TagExpr (AND/OR/NOT tree)"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"include_stats","in":"query","required":false,"schema":{"type":"boolean","description":"false: return only `recent` — the totals come back 0 and the breakdowns and the time series empty. For paging or searching the call log without recomputing the aggregates.","default":true,"title":"Include Stats"},"description":"false: return only `recent` — the totals come back 0 and the breakdowns and the time series empty. For paging or searching the call log without recomputing the aggregates."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowupAnalyticsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/followups/sparklines":{"get":{"tags":["resource-analytics"],"summary":"Get Followup Sparklines","description":"Per-rule sparkline data (daily sends, answered as success) for every follow-up rule in the project.\n\nKeyed by rule id. Attempts with no rule (older than the rules) have no card\nto draw on and are left out here; they still count in the aggregate.","operationId":"get_followup_sparklines_projects__project_id__analytics_followups_sparklines_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Number of trailing days","default":14,"title":"Days"},"description":"Number of trailing days"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SparklineItem"},"title":"Response Get Followup Sparklines Projects  Project Id  Analytics Followups Sparklines Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/kbs":{"get":{"tags":["resource-analytics"],"summary":"Get Kb Citation Analytics","description":"Return analytics for KB citation usage.","operationId":"get_kb_citation_analytics_projects__project_id__analytics_kbs_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"kb_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by specific KB","title":"Kb Id"},"description":"Filter by specific KB"},{"name":"item_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by specific item (FAQ, snippet, article)","title":"Item Id"},"description":"Filter by specific item (FAQ, snippet, article)"},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by source (copilot, playbook, suggestion)","title":"Source"},"description":"Filter by source (copilot, playbook, suggestion)"},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max recent items to return","default":50,"title":"Limit"},"description":"Max recent items to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset for pagination of recent items","default":0,"title":"Offset"},"description":"Offset for pagination of recent items"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search in conversation_id, kb_id","title":"Search"},"description":"Search in conversation_id, kb_id"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated tags (AND logic); use tag_filter for AND/OR/NOT","title":"Tags"},"description":"Comma-separated tags (AND logic); use tag_filter for AND/OR/NOT"},{"name":"tag_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"JSON-encoded TagExpr (AND/OR/NOT tree)","title":"Tag Filter"},"description":"JSON-encoded TagExpr (AND/OR/NOT tree)"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"include_stats","in":"query","required":false,"schema":{"type":"boolean","description":"false: return only `recent` — the totals come back 0 and the breakdowns and the time series empty. For paging or searching the call log without recomputing the aggregates.","default":true,"title":"Include Stats"},"description":"false: return only `recent` — the totals come back 0 and the breakdowns and the time series empty. For paging or searching the call log without recomputing the aggregates."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KbCitationAnalyticsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/kbs/sparklines":{"get":{"tags":["resource-analytics"],"summary":"Get Kb Citation Sparklines","description":"Return per-KB sparkline data (daily counts) for all cited KBs in the project.","operationId":"get_kb_citation_sparklines_projects__project_id__analytics_kbs_sparklines_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Number of trailing days","default":14,"title":"Days"},"description":"Number of trailing days"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/SparklineItem"},"title":"Response Get Kb Citation Sparklines Projects  Project Id  Analytics Kbs Sparklines Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/kbs/{kb_id}/items":{"get":{"tags":["resource-analytics"],"summary":"Get Kb Item Traffic","description":"Return per-item citation traffic for a specific KB.\n\nShows how many times each item (FAQ, snippet, article, etc.) was cited.\nSorted by citation count descending — most-cited items first.","operationId":"get_kb_item_traffic_projects__project_id__analytics_kbs__kb_id__items_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"kb_id","in":"path","required":true,"schema":{"type":"string","title":"Kb Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max items to return","default":50,"title":"Limit"},"description":"Max items to return"},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KbItemTrafficResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/api-tools/export":{"get":{"tags":["resource-analytics"],"summary":"Export Api Tool Csv","description":"Export all API tool usage rows as CSV for the given filters.","operationId":"export_api_tool_csv_projects__project_id__analytics_api_tools_export_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"api_tool_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Tool Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/toolkits/export":{"get":{"tags":["resource-analytics"],"summary":"Export Toolkit Csv","description":"Export all toolkit usage rows as CSV for the given filters.","operationId":"export_toolkit_csv_projects__project_id__analytics_toolkits_export_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"toolkit_slug","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Toolkit Slug"}},{"name":"action_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Name"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"param_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Param Filter"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/skills/export":{"get":{"tags":["resource-analytics"],"summary":"Export Skill Csv","description":"Export all skill usage rows as CSV for the given filters.","operationId":"export_skill_csv_projects__project_id__analytics_skills_export_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"skill_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skill Name"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/followups/export":{"get":{"tags":["resource-analytics"],"summary":"Export Followup Csv","description":"Export follow-up attempts as CSV for the given filters.","operationId":"export_followup_csv_projects__project_id__analytics_followups_export_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"rule_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Id"}},{"name":"playbook_base_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/kbs/export":{"get":{"tags":["resource-analytics"],"summary":"Export Kb Citation Csv","description":"Export all KB citation usage rows as CSV for the given filters.","operationId":"export_kb_citation_csv_projects__project_id__analytics_kbs_export_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"kb_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Id"}},{"name":"item_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id"}},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/kb-searches":{"get":{"tags":["resource-analytics"],"summary":"Get Kb Search Gaps","description":"Aggregated KB search queries for finding knowledge-base gaps.\n\nGroups every logged KB search by (lowercased) query text and returns, per\nquery: how often it was searched, the avg/min top relevance score, and how\nmany times it returned nothing. Most-frequent first. A continuous-improvement\nagent uses ``max_avg_score`` to surface frequent queries the KB answers\npoorly (or not at all) — i.e. the gaps to fill.","operationId":"get_kb_search_gaps_projects__project_id__analytics_kb_searches_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"kb_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Scope the analysis to a single knowledge base (analysis is typically per-KB).","title":"Kb Id"},"description":"Scope the analysis to a single knowledge base (analysis is typically per-KB)."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"max_avg_score","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Only queries whose avg top score is below this (or returned nothing). Surfaces weak/gap queries.","title":"Max Avg Score"},"description":"Only queries whose avg top score is below this (or returned nothing). Surfaces weak/gap queries."},{"name":"min_count","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Only queries searched at least this many times (drops the one-off long tail).","title":"Min Count"},"description":"Only queries searched at least this many times (drops the one-off long tail)."},{"name":"rerank_used","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by scoring mode (true=rerank, false=cosine). Scores aren't comparable across modes, so pass one when comparing avg scores.","title":"Rerank Used"},"description":"Filter by scoring mode (true=rerank, false=cosine). Scores aren't comparable across modes, so pass one when comparing avg scores."},{"name":"sort","in":"query","required":false,"schema":{"type":"string","description":"Worst-first ordering: 'frequency' (most searched, default), 'score' (lowest avg top score first — no-result queries rank worst), 'zero_results' (most empty first), 'last_seen' (most recent first).","default":"frequency","title":"Sort"},"description":"Worst-first ordering: 'frequency' (most searched, default), 'score' (lowest avg top score first — no-result queries rank worst), 'zero_results' (most empty first), 'last_seen' (most recent first)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KbSearchGapsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/analytics/api-tool-failures":{"get":{"tags":["resource-analytics"],"summary":"Get Api Tool Failures","description":"Failed API-tool calls only — each with its error payload, for diagnosis.\n\nReturns **only** calls where ``success`` is false. Successful calls, and their\nresponse payloads (which may hold sensitive data), are never included. Stats\nshow the failing window (per-day counts) and which tools fail; ``items`` lists\nthe failures themselves (newest first, paginated), each carrying the error\nmessage, the error response body, the request that was sent, and the\nconversation it happened in. Filter by ``api_tool_id`` and/or ``search``.","operationId":"get_api_tool_failures_projects__project_id__analytics_api_tool_failures_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"api_tool_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter to a single API tool.","title":"Api Tool Id"},"description":"Filter to a single API tool."},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Substring match in the error message or the error payload.","title":"Search"},"description":"Substring match in the error message or the error payload."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date (YYYY-MM-DD)","title":"Start Date"},"description":"Start date (YYYY-MM-DD)"},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"End date (YYYY-MM-DD)","title":"End Date"},"description":"End date (YYYY-MM-DD)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max failures returned (pagination).","default":50,"title":"Limit"},"description":"Max failures returned (pagination)."},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Pagination offset.","default":0,"title":"Offset"},"description":"Pagination offset."},{"name":"timezone","in":"query","required":false,"schema":{"type":"string","description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC.","default":"UTC","title":"Timezone"},"description":"IANA timezone the day buckets and the date window are evaluated in (e.g. America/Argentina/Buenos_Aires). Defaults to UTC."},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToolFailuresResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/reports":{"post":{"tags":["reports"],"summary":"Create Report","operationId":"create_report_projects__project_id__reports_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDefinitionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["reports"],"summary":"List Reports","operationId":"list_reports_projects__project_id__reports_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"include_one_off","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include One Off"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDefinitionsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/reports/one-off":{"post":{"tags":["reports"],"summary":"Run One Off Report","description":"Define a report and run it once, in one call.\n\nFor the question asked in a thread — \"what came in over the last 24 hours,\nand why did it hand off?\" — that wants the report pipeline (Sami, the\nBlock Kit artifact, the branded PDF) and none of the report lifecycle. The\ndefinition is written with `is_one_off=True`: it never appears in the\nproject's report list, has no schedule and no delivery target, and exists\nso the run, the artifact and the cost line have something to point at.\nThe caller polls the run and collects the PDF from `/reports/runs/{id}/pdf`.\n\nSame executor, same per-run cost cap, same foreground session as a manual\n\"Run now\" — the only thing this route adds is not having to create, run,\nand remember to delete.","operationId":"run_one_off_report_projects__project_id__reports_one_off_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportOneOffCreate"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportOneOffResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reports/{report_id}":{"get":{"tags":["reports"],"summary":"Get Report","operationId":"get_report_reports__report_id__get","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["reports"],"summary":"Update Report","operationId":"update_report_reports__report_id__patch","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDefinitionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["reports"],"summary":"Delete Report","operationId":"delete_report_reports__report_id__delete","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reports/{report_id}/run":{"post":{"tags":["reports"],"summary":"Trigger Report Run","description":"Trigger a report run.\n\nFor manual reports: time_window_days can be passed in the request body.\nFalls back to the definition's time_window_days, then defaults to 7.\n\nFor cron reports: time_window_days is auto-calculated from the cron interval.","operationId":"trigger_report_run_reports__report_id__run_post","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/TriggerRunRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reports/runs/{run_id}/retry":{"post":{"tags":["reports"],"summary":"Retry Report Run","description":"Retry a failed report run using the same window_start/window_end.","operationId":"retry_report_run_reports_runs__run_id__retry_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reports/runs/{run_id}/cancel":{"post":{"tags":["reports"],"summary":"Cancel Report Run Endpoint","description":"Stop an in-flight report run.\n\nAllowed only while the run is ``pending`` or ``running``. The cancel\nfunction sends ``user.interrupt`` + archives the upstream Anthropic\nsession BEFORE writing ``status='cancelled'`` on our side; if either\nupstream call fails we return 502 so the FE can offer a retry instead\nof misleadingly showing the run as cancelled.","operationId":"cancel_report_run_endpoint_reports_runs__run_id__cancel_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reports/{report_id}/runs":{"get":{"tags":["reports"],"summary":"List Report Runs","operationId":"list_report_runs_reports__report_id__runs_get","parameters":[{"name":"report_id","in":"path","required":true,"schema":{"type":"string","title":"Report Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRunsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reports/runs/{run_id}":{"get":{"tags":["reports"],"summary":"Get Report Run","operationId":"get_report_run_reports_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reports/runs/{run_id}/artifact":{"get":{"tags":["reports"],"summary":"Get Report Artifact","operationId":"get_report_artifact_reports_runs__run_id__artifact_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportArtifactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/reports/runs/{run_id}/pdf":{"get":{"tags":["reports"],"summary":"Get Report Pdf","description":"Generate and return PDF for a report run.","operationId":"get_report_pdf_reports_runs__run_id__pdf_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/alerts":{"post":{"tags":["alerts"],"summary":"Create Alert","operationId":"create_alert_projects__project_id__alerts_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertDefinitionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["alerts"],"summary":"List Alerts","operationId":"list_alerts_projects__project_id__alerts_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertDefinitionsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/alerts/{alert_id}":{"get":{"tags":["alerts"],"summary":"Get Alert","operationId":"get_alert_alerts__alert_id__get","parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","title":"Alert Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["alerts"],"summary":"Update Alert","operationId":"update_alert_alerts__alert_id__patch","parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","title":"Alert Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertDefinitionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["alerts"],"summary":"Delete Alert","operationId":"delete_alert_alerts__alert_id__delete","parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","title":"Alert Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/alerts/{alert_id}/test":{"post":{"tags":["alerts"],"summary":"Test Alert","description":"Trigger a manual test run using the alert's cron interval as window.","operationId":"test_alert_alerts__alert_id__test_post","parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","title":"Alert Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/alerts/runs/{run_id}/cancel":{"post":{"tags":["alerts"],"summary":"Cancel Alert Run Endpoint","description":"Stop an in-flight alert run. See\n``app/routers/reports.py:cancel_report_run_endpoint`` — same contract.","operationId":"cancel_alert_run_endpoint_alerts_runs__run_id__cancel_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/alerts/{alert_id}/runs":{"get":{"tags":["alerts"],"summary":"List Alert Runs","operationId":"list_alert_runs_alerts__alert_id__runs_get","parameters":[{"name":"alert_id","in":"path","required":true,"schema":{"type":"string","title":"Alert Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRunsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/alerts/runs/{run_id}":{"get":{"tags":["alerts"],"summary":"Get Alert Run","operationId":"get_alert_run_alerts_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/monitors/preview":{"post":{"tags":["monitors"],"summary":"Preview Monitor","description":"Live count preview for the monitor form.\n\nReturns the per-day conversation count over the last 7 days plus the\ntotal over the configured lookback window. The FE re-issues this on\nfilter / playbook / window changes (debounced) so the operator sees\nhow many conversations the rule would actually catch.","operationId":"preview_monitor_projects__project_id__monitors_preview_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorPreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/monitors":{"post":{"tags":["monitors"],"summary":"Create Monitor","operationId":"create_monitor_projects__project_id__monitors_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorDefinitionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["monitors"],"summary":"List Monitors","operationId":"list_monitors_projects__project_id__monitors_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorDefinitionsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/monitors/{monitor_id}":{"get":{"tags":["monitors"],"summary":"Get Monitor","operationId":"get_monitor_monitors__monitor_id__get","parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","title":"Monitor Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["monitors"],"summary":"Update Monitor","operationId":"update_monitor_monitors__monitor_id__patch","parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","title":"Monitor Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorDefinitionUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["monitors"],"summary":"Delete Monitor","operationId":"delete_monitor_monitors__monitor_id__delete","parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","title":"Monitor Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/monitors/{monitor_id}/duplicate":{"post":{"tags":["monitors"],"summary":"Duplicate Monitor","description":"Create a disabled copy of a monitor under the same account.\n\nThe new monitor is named ``copy-{original.name}`` and starts disabled\nso the operator can review or rename before the cron worker picks it\nup. Same scope, schedule, comparison, and delivery as the source.","operationId":"duplicate_monitor_monitors__monitor_id__duplicate_post","parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","title":"Monitor Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/monitors/{monitor_id}/test":{"post":{"tags":["monitors"],"summary":"Test Monitor","description":"Inline manual evaluation. Persists a MonitorRun row and — when the\nrule fires — delivers Slack/email notifications clearly marked as a\nTEST run, so operators can validate end-to-end without confusing the\nmessage with a real fire.","operationId":"test_monitor_monitors__monitor_id__test_post","parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","title":"Monitor Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/monitors/{monitor_id}/runs":{"get":{"tags":["monitors"],"summary":"List Monitor Runs","operationId":"list_monitor_runs_monitors__monitor_id__runs_get","parameters":[{"name":"monitor_id","in":"path","required":true,"schema":{"type":"string","title":"Monitor Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorRunsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/monitors/runs/{run_id}":{"get":{"tags":["monitors"],"summary":"Get Monitor Run","operationId":"get_monitor_run_monitors_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitorRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp-connections":{"get":{"tags":["mcp-connections"],"summary":"List Mcp Connections","description":"List MCP connections: the whole account for an admin, your own otherwise.","operationId":"list_mcp_connections_mcp_connections_get","parameters":[{"name":"include_revoked","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Revoked"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/McpConnectionResponse"},"title":"Response List Mcp Connections Mcp Connections Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp-connections/{grant_id}":{"delete":{"tags":["mcp-connections"],"summary":"Revoke Mcp Connection","description":"Revoke a connection: refresh tokens die immediately (cascade in\nrevoke_mcp_grant), live access tokens die within 60s via the Redis cache.\n\nAn admin may cut any connection in the account; anyone else may cut their\nown. Ownership rides along as a condition on the same UPDATE, so a member\naiming at someone else's grant id gets the same 404 as a made-up one — it\ndoes not confirm the connection exists.\n\nA member reaches this route like most others now (``app/role_policy.py``\nprotects the assistant, not the whole app), so the ownership condition\nabove is the entire guard — it is not backed up by a role check.","operationId":"revoke_mcp_connection_mcp_connections__grant_id__delete","parameters":[{"name":"grant_id","in":"path","required":true,"schema":{"type":"string","title":"Grant Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/segments/condition-check":{"post":{"tags":["segments"],"summary":"Check Segment Condition","description":"Dry-run a segment definition: validate it and optionally evaluate it against\na sample context or a real conversation's latest context snapshot.\n\nAccount-scoped mirror of the skill condition-check. The conversation is\nresolved to whichever of the account's assistants owns it, so the caller need\nnot know the project. Read-only. `check.condition` carries the definition AST.","operationId":"check_segment_condition_segments_condition_check_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillConditionCheckRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillConditionCheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/segments":{"get":{"tags":["segments"],"summary":"List Segments","description":"List every segment in the current account (newest first).","operationId":"list_segments_segments_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Segment"},"title":"Response List Segments Segments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["segments"],"summary":"Create Segment","description":"Create a segment. Name must be unique within the account.","operationId":"create_segment_segments_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/segments/{segment_id}":{"get":{"tags":["segments"],"summary":"Get Segment","description":"Fetch a single segment owned by the current account.","operationId":"get_segment_segments__segment_id__get","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["segments"],"summary":"Update Segment","description":"Partial update. Omitted fields are unchanged; description=\"\" clears it.","operationId":"update_segment_segments__segment_id__patch","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Segment"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["segments"],"summary":"Delete Segment","description":"Delete a segment. Skills that reference it fail-closed (silently disable).","operationId":"delete_segment_segments__segment_id__delete","parameters":[{"name":"segment_id","in":"path","required":true,"schema":{"type":"string","title":"Segment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/saved-filters":{"get":{"tags":["saved-filters"],"summary":"List Saved Filters","description":"List every saved filter in the current account (newest first).","operationId":"list_saved_filters_saved_filters_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SavedFilter"},"title":"Response List Saved Filters Saved Filters Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["saved-filters"],"summary":"Create Saved Filter","description":"Create a saved filter. Name must be unique within the account.","operationId":"create_saved_filter_saved_filters_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedFilterCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedFilter"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/saved-filters/{saved_filter_id}":{"get":{"tags":["saved-filters"],"summary":"Get Saved Filter","description":"Fetch a single saved filter owned by the current account.","operationId":"get_saved_filter_saved_filters__saved_filter_id__get","parameters":[{"name":"saved_filter_id","in":"path","required":true,"schema":{"type":"string","title":"Saved Filter Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedFilter"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["saved-filters"],"summary":"Update Saved Filter","description":"Partial update. Omitted fields are unchanged; description=\"\" clears it.","operationId":"update_saved_filter_saved_filters__saved_filter_id__patch","parameters":[{"name":"saved_filter_id","in":"path","required":true,"schema":{"type":"string","title":"Saved Filter Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedFilterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedFilter"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["saved-filters"],"summary":"Delete Saved Filter","description":"Delete a saved filter.","operationId":"delete_saved_filter_saved_filters__saved_filter_id__delete","parameters":[{"name":"saved_filter_id","in":"path","required":true,"schema":{"type":"string","title":"Saved Filter Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-tool-alerts/default":{"get":{"tags":["api-tool-alerts"],"summary":"Get Default Config","operationId":"get_default_config_projects__project_id__api_tool_alerts_default_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ApiToolAlertConfigResponse"},{"type":"null"}],"title":"Response Get Default Config Projects  Project Id  Api Tool Alerts Default Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["api-tool-alerts"],"summary":"Upsert Default Config","operationId":"upsert_default_config_projects__project_id__api_tool_alerts_default_put","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToolAlertDefaultUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToolAlertConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-tools/{api_tool_id}/alert":{"get":{"tags":["api-tool-alerts"],"summary":"Get Effective Alert For Tool","description":"Return what the runtime would use for this tool — override if present,\nelse the project default. ``source='none'`` means no alerts watch this\ntool right now (no override and default is disabled or missing).","operationId":"get_effective_alert_for_tool_projects__project_id__api_tools__api_tool_id__alert_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"api_tool_id","in":"path","required":true,"schema":{"type":"string","title":"Api Tool Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToolEffectiveAlertResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["api-tool-alerts"],"summary":"Upsert Override","operationId":"upsert_override_projects__project_id__api_tools__api_tool_id__alert_put","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"api_tool_id","in":"path","required":true,"schema":{"type":"string","title":"Api Tool Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToolAlertOverrideUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToolAlertConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["api-tool-alerts"],"summary":"Delete Override","description":"Hard delete the override row so the tool falls back to the default.","operationId":"delete_override_projects__project_id__api_tools__api_tool_id__alert_delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"api_tool_id","in":"path","required":true,"schema":{"type":"string","title":"Api Tool Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-tool-alerts/runs":{"get":{"tags":["api-tool-alerts"],"summary":"List Runs","operationId":"list_runs_projects__project_id__api_tool_alerts_runs_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToolAlertRunsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-tool-alerts/status":{"get":{"tags":["api-tool-alerts"],"summary":"Get Live Status","description":"Evaluate the project's configured alerts right now and return which\ntools are currently above threshold. Used by the Tools list to show\nreal-time badges without waiting for the 10-min cron tick.\n\nNo persistence (does not write a run), no notifications. Evaluator is\na single batched COUNT query so this is cheap to call on every page load.","operationId":"get_live_status_projects__project_id__api_tool_alerts_status_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToolAlertStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/projects/{project_id}/api-tool-alerts/test":{"post":{"tags":["api-tool-alerts"],"summary":"Test Run","description":"Evaluate now using the current config + log + send Slack/email\nnotifications marked as ``is_test=True`` so recipients can distinguish\ntest fires from real ones.","operationId":"test_run_projects__project_id__api_tool_alerts_test_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiToolAlertRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sami/v2/sessions":{"post":{"tags":["sami-v2"],"summary":"Create Session","description":"Create a new Sami session record.\n\nUnlike v1, we do *not* eagerly provision a sandbox here. The upstream\nAnthropic session is created on the first chat turn (it's cheap and we\navoid orphan sessions if the user closes the tab before sending a message).","operationId":"create_session_sami_v2_sessions_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SamiCreateSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["sami-v2"],"summary":"List Sessions","description":"List Sami sessions for the current account. Identical DB shape to v1.","operationId":"list_sessions_sami_v2_sessions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SamiSessionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sami/v2/chat/stream":{"post":{"tags":["sami-v2"],"summary":"Chat Stream","description":"SSE streaming endpoint for Sami v2 chat.\n\nAll orchestration lives in `app.sami_v2.service.stream_chat()`. This\nhandler is just auth + setup + a StreamingResponse wrapper.","operationId":"chat_stream_sami_v2_chat_stream_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Chat Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sami/v2/chat":{"post":{"tags":["sami-v2"],"summary":"Chat","description":"Kick off a background chat task — clients poll /state for progress.\n\nThis is the primary entry point used by the FE today (multi-user safe:\nmany viewers can poll /state in parallel; only the single bg task writes).\nThe streaming variant `/chat/stream` is kept for clients that prefer SSE.","operationId":"chat_sami_v2_chat_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Chat Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Chat Sami V2 Chat Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sami/v2/sessions/{session_id}/interrupt":{"post":{"tags":["sami-v2"],"summary":"Interrupt","operationId":"interrupt_sami_v2_sessions__session_id__interrupt_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sami/v2/sessions/{session_id}":{"delete":{"tags":["sami-v2"],"summary":"Delete Session","operationId":"delete_session_sami_v2_sessions__session_id__delete","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sami/v2/sessions/{session_id}/messages":{"get":{"tags":["sami-v2"],"summary":"Get Messages","description":"Return persisted messages for a session.\n\nReads `message_history` first (the v1+v2 canonical store); falls back to\nchat_store for very old sessions that pre-date the column.","operationId":"get_messages_sami_v2_sessions__session_id__messages_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SamiMessage"},"title":"Response Get Messages Sami V2 Sessions  Session Id  Messages Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sami/v2/sessions/{session_id}/state":{"get":{"tags":["sami-v2"],"summary":"Get Session State","description":"Polling endpoint — returns the same shape as v1 so the FE works unchanged.\n\nSynthesizes an in-progress assistant message from `pending_assistant_message`\nwhile the runner is mid-turn, so the FE shows partial output without\nwaiting for completion.","operationId":"get_session_state_sami_v2_sessions__session_id__state_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Session State Sami V2 Sessions  Session Id  State Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sami/v2/sessions/{session_id}/files":{"get":{"tags":["sami-v2"],"summary":"List Session Files","description":"List the downloadable artifacts Sami wrote to the session sandbox.","operationId":"list_session_files_sami_v2_sessions__session_id__files_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SamiSessionFilesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sami/v2/sessions/{session_id}/files/{file_id}/download":{"get":{"tags":["sami-v2"],"summary":"Download Session File","description":"Download one session artifact by id.\n\nMembership is verified inside ``download_session_output_file`` (the id must\nbelong to this session's scope), so a caller can't pull arbitrary Files API\nids by guessing.","operationId":"download_session_file_sami_v2_sessions__session_id__files__file_id__download_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/sami/v2/sessions/{session_id}/attachments":{"post":{"tags":["sami-v2"],"summary":"Upload Attachment","description":"Upload one file for a session; returns a ref to attach to a chat turn.","operationId":"upload_attachment_sami_v2_sessions__session_id__attachments_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_attachment_sami_v2_sessions__session_id__attachments_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SamiAttachmentRef"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sami/v2/sessions/{session_id}/attachments/{file_id}/file":{"get":{"tags":["sami-v2"],"summary":"Get Attachment File","description":"Serve an attachment's bytes **inline** so the FE can preview it.\n\nInline (not ``attachment;``) so an <img>/<iframe> renders it. Scoped to the\nsession (ownership on the session + the attachment row) so a caller can't\npull arbitrary bytes by guessing a file_id.","operationId":"get_attachment_file_sami_v2_sessions__session_id__attachments__file_id__file_get","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}},{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"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"}}}}}}},"/sami/v2/sessions/export-pdf":{"post":{"tags":["sami-v2"],"summary":"Export Html To Pdf","description":"Convert pre-rendered HTML from the frontend to PDF via the PDF worker.","operationId":"export_html_to_pdf_sami_v2_sessions_export_pdf_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportPdfRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sami/sessions/export-pdf":{"post":{"tags":["sami-v2"],"summary":"Export Html To Pdf Legacy","description":"Legacy path for `POST /sami/v2/sessions/export-pdf`.","operationId":"export_html_to_pdf_legacy_sami_sessions_export_pdf_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportPdfRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supersami/accounts":{"get":{"tags":["supersami"],"summary":"List accounts (clients) and their projects","description":"Resolve a client → account_id + project_ids. Cross-account, read-only.","operationId":"list_accounts_supersami_accounts_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Substring match against account name OR any of its project (assistant) names.","title":"Q"},"description":"Substring match against account name OR any of its project (assistant) names."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supersami/projects/{project_id}/conversations":{"get":{"tags":["supersami"],"summary":"List a project's conversations","description":"List conversations for a project (assistant), most recent first.","operationId":"list_project_conversations_supersami_projects__project_id__conversations_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Conversation ID substring search.","title":"Search"},"description":"Conversation ID substring search."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date/time lower bound.","title":"Start Date"},"description":"ISO date/time lower bound."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date/time upper bound.","title":"End Date"},"description":"ISO date/time upper bound."},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supersami/projects/{project_id}/conversations/{conversation_id}":{"get":{"tags":["supersami"],"summary":"Read one conversation's full detail","description":"Full conversation detail (messages + image/PDF attachments as base64).","operationId":"get_project_conversation_supersami_projects__project_id__conversations__conversation_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supersami/projects/{project_id}/sandbox-key":{"get":{"tags":["supersami"],"summary":"Get (or create) a project's account-scoped sandbox key (sbs_)","description":"Return the project's sandbox key (``sbs_``), creating it if absent.\n\nThe agent uses this token as the account-scoped credential (``STUDIO_API_TOKEN``)\nfor the account-specific skills. Cross-account; account-scoped writes made with\nthe returned key still go through the backend's human-approval queue.","operationId":"get_project_sandbox_key_supersami_projects__project_id__sandbox_key_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/app__routers__supersami__SandboxKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supersami/projects/{project_id}/issues":{"post":{"tags":["supersami"],"summary":"Create a issue","operationId":"create_issue_supersami_projects__project_id__issues_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["supersami"],"summary":"List a project's issues","operationId":"list_issues_supersami_projects__project_id__issues_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectIssueStatusEnum"},{"type":"null"}],"title":"Status"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ProjectIssueCategoryEnum"},{"type":"null"}],"title":"Category"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssuesListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supersami/projects/{project_id}/issues/{suggestion_id}":{"get":{"tags":["supersami"],"summary":"Read one issue (with follow-ups)","operationId":"get_issue_supersami_projects__project_id__issues__suggestion_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"integer","title":"Suggestion Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supersami/projects/{project_id}/issues/{suggestion_id}/followups":{"post":{"tags":["supersami"],"summary":"Append a follow-up to a issue (regression)","operationId":"add_followup_supersami_projects__project_id__issues__suggestion_id__followups_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"integer","title":"Suggestion Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueFollowupCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supersami/projects/{project_id}/issues/{suggestion_id}/resolve":{"post":{"tags":["supersami"],"summary":"Resolve a issue","operationId":"resolve_issue_supersami_projects__project_id__issues__suggestion_id__resolve_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"integer","title":"Suggestion Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supersami/projects/{project_id}/issues/{suggestion_id}/reopen":{"post":{"tags":["supersami"],"summary":"Reopen a issue","operationId":"reopen_issue_supersami_projects__project_id__issues__suggestion_id__reopen_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"suggestion_id","in":"path","required":true,"schema":{"type":"integer","title":"Suggestion Id"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIssueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AccountActivityResponse":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"users":{"items":{"$ref":"#/components/schemas/UserActivityResponse"},"type":"array","title":"Users","description":"Most recently active first; never seen last"}},"type":"object","required":["account_id","account_name","users"],"title":"AccountActivityResponse"},"AccountAnalytics":{"properties":{"total_conversations":{"type":"integer","title":"Total Conversations","description":"Total number of conversations across all assistants"},"total_messages":{"type":"integer","title":"Total Messages","description":"Total number of messages across all conversations"},"total_ai_messages":{"type":"integer","title":"Total Ai Messages","description":"Total AI/assistant messages (for time saved calculation)"},"conversations_with_handoff":{"type":"integer","title":"Conversations With Handoff","description":"Conversations that required human handoff"},"conversations_without_handoff":{"type":"integer","title":"Conversations Without Handoff","description":"Conversations resolved by AI"},"deflection_rate":{"type":"number","title":"Deflection Rate","description":"Percentage of conversations resolved without handoff (0-100)"},"avg_messages_per_conversation":{"type":"number","title":"Avg Messages Per Conversation","description":"Average messages per conversation"},"by_assistant":{"items":{"$ref":"#/components/schemas/AssistantAnalyticsMetrics"},"type":"array","title":"By Assistant","description":"Metrics grouped by assistant/project"},"time_series":{"items":{"$ref":"#/components/schemas/app__models__TimeSeriesPoint"},"type":"array","title":"Time Series","description":"Daily time series data"}},"type":"object","required":["total_conversations","total_messages","total_ai_messages","conversations_with_handoff","conversations_without_handoff","deflection_rate","avg_messages_per_conversation"],"title":"AccountAnalytics","description":"Account-wide aggregated analytics for conversations across all assistants."},"AccountBalance":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"is_credit_tracked":{"type":"boolean","title":"Is Credit Tracked"},"total_credited_usd":{"type":"number","title":"Total Credited Usd"},"total_billed_usd":{"type":"number","title":"Total Billed Usd"},"metered_billed_usd":{"type":"number","title":"Metered Billed Usd","default":0.0},"minimum_shortfall_usd":{"type":"number","title":"Minimum Shortfall Usd","default":0.0},"monthly_minimum_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Monthly Minimum Usd"},"minimum_starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Minimum Starts On"},"minimum_adjustments":{"items":{"$ref":"#/components/schemas/MinimumAdjustment"},"type":"array","title":"Minimum Adjustments"},"balance_usd":{"type":"number","title":"Balance Usd"},"price_cents_per_conversation":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Cents Per Conversation"},"price_basis":{"type":"string","title":"Price Basis","default":"resolved"},"billed_conversations":{"type":"integer","title":"Billed Conversations","default":0},"has_rate":{"type":"boolean","title":"Has Rate","default":false},"refill_count":{"type":"integer","title":"Refill Count","default":0},"last_refill_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refill At"}},"type":"object","required":["account_id","is_credit_tracked","total_credited_usd","total_billed_usd","balance_usd"],"title":"AccountBalance"},"AccountBalanceSummary":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"is_credit_tracked":{"type":"boolean","title":"Is Credit Tracked","description":"True when the account has >=1 ledger entry (prepaid). False = post-paid, no balance."},"total_credited_usd":{"type":"number","title":"Total Credited Usd","description":"Sum of all refills (ledger amount_usd)."},"total_billed_usd":{"type":"number","title":"Total Billed Usd","description":"Full drawdown over all time: metered_billed_usd + minimum_shortfall_usd."},"metered_billed_usd":{"type":"number","title":"Metered Billed Usd","description":"Metered part of the drawdown: billed conversations × the account's rate, over all time.","default":0.0},"minimum_shortfall_usd":{"type":"number","title":"Minimum Shortfall Usd","description":"Charged on top for closed months whose usage came in under the account's contractual monthly minimum. 0 when the account has no minimum, or cleared it every month.","default":0.0},"monthly_minimum_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Monthly Minimum Usd","description":"The account's full-month contractual minimum in USD, or null when it has none."},"minimum_starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Minimum Starts On","description":"Day the minimum started applying (partial months are prorated by days)."},"minimum_adjustments":{"items":{"$ref":"#/components/schemas/MinimumAdjustmentModel"},"type":"array","title":"Minimum Adjustments","description":"One row per closed month the minimum covered, newest first (shortfall 0 when it was cleared)."},"balance_usd":{"type":"number","title":"Balance Usd","description":"total_credited_usd − total_billed_usd."},"non_billable_conversations":{"type":"integer","title":"Non Billable Conversations","description":"Conversations marked non-billable at reconciliation. Already excluded from the drawdown; this is how many.","default":0},"price_cents_per_conversation":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Cents Per Conversation","description":"The account's billed rate in cents, or null when no rate is configured."},"price_basis":{"type":"string","title":"Price Basis","description":"'resolved' (per deflected) or 'conversation' (per total).","default":"resolved"},"billed_conversations":{"type":"integer","title":"Billed Conversations","description":"Conversations counted toward the drawdown.","default":0},"has_rate":{"type":"boolean","title":"Has Rate","description":"False when the account is funded but has no configured rate (drawdown is 0 until one exists)."},"refill_count":{"type":"integer","title":"Refill Count"},"last_refill_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refill At"},"burn_usd_per_day":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Burn Usd Per Day","description":"Drawdown over the trailing 30 days / 30. Null when the account has no configured rate; 0 when it had no traffic in the window."},"runway_days":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Runway Days","description":"balance_usd / burn_usd_per_day — days of credit left at the recent rate. 0 when the balance is already spent. Null when it cannot be projected (no rate, or burn is 0)."},"projected_zero_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Projected Zero At","description":"When the balance hits zero at the recent rate. Null whenever runway_days is null or 0."}},"type":"object","required":["account_id","is_credit_tracked","total_credited_usd","total_billed_usd","balance_usd","has_rate","refill_count"],"title":"AccountBalanceSummary"},"AccountBreakdownRow":{"properties":{"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"},"account_name":{"type":"string","title":"Account Name"},"account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Type"},"cost_usd":{"type":"number","title":"Cost Usd"},"llm_requests":{"type":"integer","title":"Llm Requests"},"total_tokens":{"type":"integer","title":"Total Tokens"},"pct_of_total":{"type":"number","title":"Pct Of Total"}},"type":"object","required":["account_id","account_name","account_type","cost_usd","llm_requests","total_tokens","pct_of_total"],"title":"AccountBreakdownRow"},"AccountCostRow":{"properties":{"playbook_cost_usd":{"type":"number","title":"Playbook Cost Usd","description":"Playbook-agent LLM cost (ChatMessage.cost_usd sum)","default":0.0},"postprocessing_cost_usd":{"type":"number","title":"Postprocessing Cost Usd","description":"Conversation-metrics / scoring LLM cost (ConversationMetrics.cost_usd sum)","default":0.0},"eval_cost_usd":{"type":"number","title":"Eval Cost Usd","description":"Eval-only overhead cost (EvalRun.eval_overhead_cost_usd sum) — simulator + LLM-judge OpenRouter spend. Populated for account-level and per-playbook rows; 0 on dimensions where eval cost is not well-defined (tags, models, individual conversations).","default":0.0},"total_cost_usd":{"type":"number","title":"Total Cost Usd","description":"playbook_cost_usd + postprocessing_cost_usd + eval_cost_usd","default":0.0},"account_name":{"type":"string","title":"Account Name"},"account_id":{"type":"string","title":"Account Id"},"total_input_tokens":{"type":"integer","title":"Total Input Tokens"},"total_output_tokens":{"type":"integer","title":"Total Output Tokens"},"total_messages":{"type":"integer","title":"Total Messages"},"total_conversations":{"type":"integer","title":"Total Conversations"},"total_llm_requests":{"type":"integer","title":"Total Llm Requests"}},"type":"object","required":["account_name","account_id","total_input_tokens","total_output_tokens","total_messages","total_conversations","total_llm_requests"],"title":"AccountCostRow"},"AccountDealModel":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"type":"string","title":"Account Name"},"configured":{"type":"boolean","title":"Configured","description":"False means the platform has no deal terms for this account."},"billing_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Unit","description":"deflected or all conversations."},"billing_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Basis","description":"resolved/deflected or total conversation."},"unit_price_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unit Price Usd"},"tiers":{"items":{"$ref":"#/components/schemas/DealTierModel"},"type":"array","title":"Tiers"},"monthly_minimum":{"anyOf":[{"$ref":"#/components/schemas/MonthlyMinimumModel"},{"type":"null"}]}},"type":"object","required":["account_id","account_name","configured"],"title":"AccountDealModel"},"AccountLedger":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"},"prepaid_usd":{"type":"number","title":"Prepaid Usd"},"post_paid_usd":{"type":"number","title":"Post Paid Usd"},"total_usd":{"type":"number","title":"Total Usd"},"entries":{"items":{"$ref":"#/components/schemas/PaymentEntry"},"type":"array","title":"Entries","description":"Newest first."}},"type":"object","required":["account_id","prepaid_usd","post_paid_usd","total_usd"],"title":"AccountLedger"},"AccountListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AccountSummary"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"AccountListResponse"},"AccountLogoResponse":{"properties":{"account_id":{"type":"string","title":"Account Id"},"data_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data Uri"}},"type":"object","required":["account_id"],"title":"AccountLogoResponse","description":"The account's logo, inline — or None when there is none worth inlining."},"AccountPnlResponse":{"properties":{"account_id":{"type":"string","title":"Account Id"},"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"has_billing":{"type":"boolean","title":"Has Billing"},"income_usd":{"type":"number","title":"Income Usd"},"billable_qty":{"type":"integer","title":"Billable Qty"},"billable_unit":{"type":"string","title":"Billable Unit"},"unit_price_usd":{"type":"number","title":"Unit Price Usd"},"cost_usd":{"type":"number","title":"Cost Usd"},"net_usd":{"type":"number","title":"Net Usd"},"cost_breakdown":{"items":{"$ref":"#/components/schemas/PnlCostBucket"},"type":"array","title":"Cost Breakdown"}},"type":"object","required":["account_id","start_date","end_date","has_billing","income_usd","billable_qty","billable_unit","unit_price_usd","cost_usd","net_usd","cost_breakdown"],"title":"AccountPnlResponse","description":"One account's P&L over an arbitrary window: usage income vs LLM cost.\n\nIncome is what the window's usage will be INVOICED at (billable\nconversations × the client's per-conversation price — see\napp/services/client_billing.py). Same window semantics as the overview,\nso the FE can pass the dashboard's selected range verbatim.\n``has_billing`` is False when the account has no billing config — the FE\nshows an explicit \"no pricing\" state instead of inventing a number."},"AccountRenameRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"AccountRenameRequest","description":"New name for an account. Same slug rule as creating one (app.utils.account_name)."},"AccountResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Account UUID"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Account display name"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the account is active"},"created_at":{"type":"string","title":"Created At","description":"ISO 8601 creation timestamp"}},"type":"object","required":["id","is_active","created_at"],"title":"AccountResponse"},"AccountRevenue":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"prepaid_usd":{"type":"number","title":"Prepaid Usd","description":"Credit (is_credit) payments dated in the year."},"post_paid_usd":{"type":"number","title":"Post Paid Usd","description":"Non-credit payments dated in the year."},"total_usd":{"type":"number","title":"Total Usd"},"entry_count":{"type":"integer","title":"Entry Count"}},"type":"object","required":["account_id","prepaid_usd","post_paid_usd","total_usd","entry_count"],"title":"AccountRevenue"},"AccountRevenueDetail":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year"},"prepaid_usd":{"type":"number","title":"Prepaid Usd"},"post_paid_usd":{"type":"number","title":"Post Paid Usd"},"total_usd":{"type":"number","title":"Total Usd"},"entries":{"items":{"$ref":"#/components/schemas/RevenueEntryModel"},"type":"array","title":"Entries","description":"The account's ledger, newest first."}},"type":"object","required":["account_id","prepaid_usd","post_paid_usd","total_usd"],"title":"AccountRevenueDetail"},"AccountRevenueModel":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"prepaid_usd":{"type":"number","title":"Prepaid Usd","description":"Credit (is_credit) payments dated in the year."},"post_paid_usd":{"type":"number","title":"Post Paid Usd","description":"Non-credit payments dated in the year."},"total_usd":{"type":"number","title":"Total Usd"},"entry_count":{"type":"integer","title":"Entry Count"}},"type":"object","required":["account_id","prepaid_usd","post_paid_usd","total_usd","entry_count"],"title":"AccountRevenueModel"},"AccountSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"account_type":{"type":"string","title":"Account Type"},"is_active":{"type":"boolean","title":"Is Active"},"projects":{"items":{"$ref":"#/components/schemas/ProjectSummary"},"type":"array","title":"Projects"}},"type":"object","required":["id","name","account_type","is_active","projects"],"title":"AccountSummary"},"AccountUserActivity":{"properties":{"id":{"type":"integer","title":"Id"},"username":{"type":"string","title":"Username","description":"The login name; for invited users this is their email."},"is_admin":{"type":"boolean","title":"Is Admin"},"is_active":{"type":"boolean","title":"Is Active"},"is_studiochat_operator":{"type":"boolean","title":"Is Studiochat Operator","description":"True when the username is a StudioChat operator's email: our own seat in the account, not the customer. Leave these out when asking whether the customer came in."},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_login":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login","description":"Last time they signed in with their password (UTC). Null = never signed in."},"last_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Seen At","description":"Last request they made with their own session (UTC), accurate to ~5 minutes. Impersonation does not count. Null = not seen since tracking started (2026-10)."}},"type":"object","required":["id","username","is_admin","is_active","is_studiochat_operator","created_at"],"title":"AccountUserActivity"},"AccountUsersResponse":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"items":{"items":{"$ref":"#/components/schemas/AccountUserActivity"},"type":"array","title":"Items","description":"Every user in the account, most recently seen first; never seen last."}},"type":"object","required":["account_id","account_name","items"],"title":"AccountUsersResponse"},"AccountsPnlResponse":{"properties":{"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"accounts":{"items":{"$ref":"#/components/schemas/AccountPnlResponse"},"type":"array","title":"Accounts"}},"type":"object","required":["start_date","end_date","accounts"],"title":"AccountsPnlResponse","description":"Every standalone account's P&L for one window, idle accounts included\nwith zeros — the same row account-pnl would have returned for each."},"ActiveHours-Input":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"false = keep the window but stop applying it","default":true},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone the slots are read in (e.g. 'America/Argentina/Buenos_Aires')"},"weekly_schedule":{"$ref":"#/components/schemas/WeeklySchedule-Input","description":"Days and slots when the assistant is ON. A slot whose end is not after its start crosses midnight into the next day."},"date_overrides":{"items":{"$ref":"#/components/schemas/ActiveHoursDateOverride-Input"},"type":"array","title":"Date Overrides","description":"Special dates (holidays): each decides its calendar day, 00:00 to 24:00, in place of the weekly window — off all day, or on during its own slots. The weekly night that starts on that day still runs into the next morning."}},"type":"object","required":["timezone","weekly_schedule"],"title":"ActiveHours","description":"When an assistant is ON. Outside the window the kill switch is on.\n\nSame weekly shape as office hours, read differently: a slot whose end is\nnot after its start crosses midnight (``18:00–09:00`` on Monday is Monday\n18:00 to Tuesday 09:00; ``18:00–00:00`` runs to midnight; ``00:00–00:00``\nis the whole day), and the end is exclusive (off AT 09:00, not at 09:01).\nThe ``active-hours`` cron applies it every 10 minutes, at the edges only:\na manual toggle holds until the next edge. See app/services/active_hours.py."},"ActiveHours-Output":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"false = keep the window but stop applying it","default":true},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone the slots are read in (e.g. 'America/Argentina/Buenos_Aires')"},"weekly_schedule":{"$ref":"#/components/schemas/WeeklySchedule-Output","description":"Days and slots when the assistant is ON. A slot whose end is not after its start crosses midnight into the next day."},"date_overrides":{"items":{"$ref":"#/components/schemas/ActiveHoursDateOverride-Output"},"type":"array","title":"Date Overrides","description":"Special dates (holidays): each decides its calendar day, 00:00 to 24:00, in place of the weekly window — off all day, or on during its own slots. The weekly night that starts on that day still runs into the next morning."}},"type":"object","required":["timezone","weekly_schedule"],"title":"ActiveHours","description":"When an assistant is ON. Outside the window the kill switch is on.\n\nSame weekly shape as office hours, read differently: a slot whose end is\nnot after its start crosses midnight (``18:00–09:00`` on Monday is Monday\n18:00 to Tuesday 09:00; ``18:00–00:00`` runs to midnight; ``00:00–00:00``\nis the whole day), and the end is exclusive (off AT 09:00, not at 09:01).\nThe ``active-hours`` cron applies it every 10 minutes, at the edges only:\na manual toggle holds until the next edge. See app/services/active_hours.py."},"ActiveHoursDateOverride-Input":{"properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","title":"Date","description":"YYYY-MM-DD, in the window's timezone"},"label":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Label","description":"What the date is (e.g. 'Navidad')"},"is_available":{"type":"boolean","title":"Is Available","description":"true = on during override_schedule's slots; false = off the whole day","default":true},"override_schedule":{"anyOf":[{"$ref":"#/components/schemas/OverrideSchedule"},{"type":"null"}],"description":"The slots it is on that day (required when is_available=true)"}},"type":"object","required":["date"],"title":"ActiveHoursDateOverride","description":"A special date in an assistant's active hours (a holiday, a closing day).\n\nSame shape as the office-hours date overrides. It decides that calendar day,\n00:00 to 24:00, in place of the weekly window: is_available=false = off all\nday; true = on during its slots (``00:00–00:00`` = all day). A night that\nruns into it from the day before is cut at 00:00; the weekly night that\nSTARTS on it still runs into the next morning, so \"on all day on the 25th\"\nwith an 18:00–09:00 window stays on until 09:00 on the 26th."},"ActiveHoursDateOverride-Output":{"properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","title":"Date","description":"YYYY-MM-DD, in the window's timezone"},"label":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Label","description":"What the date is (e.g. 'Navidad')"},"is_available":{"type":"boolean","title":"Is Available","description":"true = on during override_schedule's slots; false = off the whole day","default":true},"override_schedule":{"anyOf":[{"$ref":"#/components/schemas/OverrideSchedule"},{"type":"null"}],"description":"The slots it is on that day (required when is_available=true)"}},"type":"object","required":["date"],"title":"ActiveHoursDateOverride","description":"A special date in an assistant's active hours (a holiday, a closing day).\n\nSame shape as the office-hours date overrides. It decides that calendar day,\n00:00 to 24:00, in place of the weekly window: is_available=false = off all\nday; true = on during its slots (``00:00–00:00`` = all day). A night that\nruns into it from the day before is cut at 00:00; the weekly night that\nSTARTS on it still runs into the next morning, so \"on all day on the 25th\"\nwith an 18:00–09:00 window stays on until 09:00 on the 26th."},"ActiveVersionHistoryItem":{"properties":{"id":{"type":"string","title":"Id","description":"History record ID"},"version_number":{"type":"integer","title":"Version Number","description":"The version number that was set as active"},"set_at":{"type":"string","format":"date-time","title":"Set At","description":"When this version was set as active"},"set_by_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Set By User Id","description":"User ID who set this version (if available)"}},"type":"object","required":["id","version_number","set_at"],"title":"ActiveVersionHistoryItem","description":"A single item in the active version history."},"ActiveVersionHistoryResponse":{"properties":{"base_id":{"type":"string","title":"Base Id","description":"Base ID of the playbook"},"history":{"items":{"$ref":"#/components/schemas/ActiveVersionHistoryItem"},"type":"array","title":"History","description":"History of active version changes, ordered by set_at descending"}},"type":"object","required":["base_id"],"title":"ActiveVersionHistoryResponse","description":"Response for active version history endpoint."},"ActiveVersionResponse":{"properties":{"base_id":{"type":"string","title":"Base Id","description":"Base ID of the playbook"},"version_number":{"type":"integer","title":"Version Number","description":"The active version number"},"set_at":{"type":"string","format":"date-time","title":"Set At","description":"When this version was set as active"},"playbook":{"anyOf":[{"$ref":"#/components/schemas/Playbook"},{"type":"null"}],"description":"The full playbook at the active version"}},"type":"object","required":["base_id","version_number","set_at"],"title":"ActiveVersionResponse","description":"Response for active version endpoints."},"AddCreditRequest":{"properties":{"amount_usd":{"type":"number","title":"Amount Usd","description":"USD to add to the account. Positive = refill/top-up; negative = manual correction. Non-zero."},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note","description":"Optional memo (invoice ref, reason)."}},"type":"object","required":["amount_usd"],"title":"AddCreditRequest"},"AddNoteRequest":{"properties":{"note":{"type":"string","title":"Note"}},"type":"object","required":["note"],"title":"AddNoteRequest","description":"Request body for adding a note."},"AddPaymentRequest":{"properties":{"amount_usd":{"type":"number","title":"Amount Usd","description":"USD paid by the client. Positive = a payment/invoice; negative = correction/refund. Non-zero."},"is_credit":{"type":"boolean","title":"Is Credit","description":"True books a prepaid credit that also feeds the Balance feature; False (default) is a plain post-paid payment (revenue only).","default":false},"paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid At","description":"Date the payment counts toward (drives the revenue year). Defaults to now."},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note","description":"Optional memo (invoice ref, reason)."}},"type":"object","required":["amount_usd"],"title":"AddPaymentRequest"},"AddUserRequest":{"properties":{"username":{"type":"string","maxLength":100,"minLength":1,"title":"Username","description":"Username for the new user"},"is_admin":{"type":"boolean","title":"Is Admin","description":"Whether the user should be an admin","default":false},"send_email":{"type":"boolean","title":"Send Email","description":"Send welcome email with credentials to the new user","default":false}},"type":"object","required":["username"],"title":"AddUserRequest"},"AddUserResponse":{"properties":{"user":{"$ref":"#/components/schemas/app__routers__account_management__UserResponse"},"temporary_password":{"type":"string","title":"Temporary Password","description":"Temporary password for the user (shown once)"}},"type":"object","required":["user","temporary_password"],"title":"AddUserResponse"},"AdminAccountDetail":{"properties":{"id":{"type":"string","title":"Id"},"kaption_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Kaption Account Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"is_active":{"type":"boolean","title":"Is Active"},"copilot_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Copilot Model"},"playbooks_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbooks Model"},"chatwoot_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chatwoot Base Url"},"effective_chatwoot_base_url":{"type":"string","title":"Effective Chatwoot Base Url"},"has_chatwoot_platform_token":{"type":"boolean","title":"Has Chatwoot Platform Token"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"playbook_count":{"type":"integer","title":"Playbook Count"}},"type":"object","required":["id","kaption_account_id","name","is_active","copilot_model","playbooks_model","chatwoot_base_url","effective_chatwoot_base_url","has_chatwoot_platform_token","created_at","updated_at","playbook_count"],"title":"AdminAccountDetail"},"AdminAccountListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminAccountSummary"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"deploy_chatwoot_base_url":{"type":"string","title":"Deploy Chatwoot Base Url"}},"type":"object","required":["items","total","limit","offset","deploy_chatwoot_base_url"],"title":"AdminAccountListResponse"},"AdminAccountSummary":{"properties":{"id":{"type":"string","title":"Id"},"kaption_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Kaption Account Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"is_active":{"type":"boolean","title":"Is Active"},"copilot_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Copilot Model"},"playbooks_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbooks Model"},"chatwoot_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chatwoot Base Url"},"has_chatwoot_platform_token":{"type":"boolean","title":"Has Chatwoot Platform Token"},"playbook_count":{"type":"integer","title":"Playbook Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","kaption_account_id","name","is_active","copilot_model","playbooks_model","chatwoot_base_url","has_chatwoot_platform_token","playbook_count","created_at"],"title":"AdminAccountSummary"},"AdminAccountUpdate":{"properties":{"copilot_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Copilot Model","description":"Copilot-specific override. Free-text — `provider/model_id` (e.g. `openai/gpt-4o-mini`), optional `[reasoning=...]` suffix. Pass `null` to clear and fall through to playbooks_model."},"playbooks_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbooks Model","description":"Account-wide fallback. Used by every playbook without its own override, and by the copilot when copilot_model is also NULL. Same free-text format. Pass `null` to clear and fall through to env defaults."},"chatwoot_base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chatwoot Base Url","description":"Chatwoot instance this account's API calls target, e.g. `https://chat.example.com`. Scheme required; no credentials, query string or fragment. Pass `null` (or an empty string) to clear and fall back to the deploy's KAPTION_BASE_URL."},"chatwoot_platform_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chatwoot Platform Token","description":"Platform-app token for that instance, required whenever chatwoot_base_url is set — the deploy-wide KAPTION_PLATFORM_TOKEN is never sent to another Chatwoot. Write-only: stored encrypted and never returned. Pass `null` (or an empty string) to clear."}},"type":"object","title":"AdminAccountUpdate","description":"Either or both fields may be present. Pass `null` to clear an\noverride (the layer below takes over). Omit a field to leave it\nuntouched. At least one field must be present."},"AdminCustomKBCreate":{"properties":{"title":{"type":"string","title":"Title","description":"Title of the knowledge base"},"description":{"type":"string","title":"Description","description":"Description of what this custom knowledge base provides"},"metadata_filter_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Filter Fields","description":"Optional list of metadata filter field names for RAG query filtering"},"metadata_filter_guidance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata Filter Guidance","description":"Optional free-text guidance on how the LLM should use the filters (e.g. 'if filtering by modelo, omit categoria'); injected into the search tool description"},"retrieval_config":{"anyOf":[{"$ref":"#/components/schemas/RetrievalConfig"},{"type":"null"}],"description":"Optional retrieval tuning (rerank, wide top-k) for this knowledge base"},"chunking_config":{"anyOf":[{"$ref":"#/components/schemas/ChunkingConfig"},{"type":"null"}],"description":"Optional ingest-time chunking (chunk_size, chunk_overlap); applied when documents are ingested"},"is_temporary":{"type":"boolean","title":"Is Temporary","description":"Create as a temporary KB (hidden from FE list; admin-only, e.g. eval/sweep scratch)","default":false}},"type":"object","required":["title","description"],"title":"AdminCustomKBCreate","description":"Request body for creating a custom knowledge base via admin API."},"AdminCustomProjectCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the custom project"},"description":{"type":"string","title":"Description","description":"Description of what this custom project does"}},"type":"object","required":["name","description"],"title":"AdminCustomProjectCreate","description":"Request body for creating a custom project via admin API."},"AdminDeleteCustomKBResponse":{"properties":{"kb_id":{"type":"string","title":"Kb Id","description":"The deleted knowledge base ID"},"deleted":{"type":"boolean","title":"Deleted","description":"Whether the KB row was deleted"},"collection_deleted":{"type":"boolean","title":"Collection Deleted","description":"Whether the dedicated Chroma collection was deleted"}},"type":"object","required":["kb_id","deleted","collection_deleted"],"title":"AdminDeleteCustomKBResponse","description":"Response from hard-deleting a custom knowledge base (KB row + Chroma collection)."},"AdminLoginCompleteResponse":{"properties":{"authenticated":{"type":"boolean","title":"Authenticated","default":true},"email":{"type":"string","title":"Email"},"scope":{"type":"string","title":"Scope"},"session_token":{"type":"string","title":"Session Token"}},"type":"object","required":["email","scope","session_token"],"title":"AdminLoginCompleteResponse","description":"POST /login/totp success response. Carries the session JWT in\n`session_token` — the FE stores it in localStorage and attaches it\nas `Authorization: Bearer <session_token>` on subsequent calls.\n\nWhy not a cookie: the project's `allow_origins=[\"*\"]` CORS config\nemits a literal `*` in simple-response headers, which the browser\nrejects on credentialed requests (`withCredentials=true`). Bearer\ntokens don't trip CORS' credential rules and match the customer\nsurface (lib/api.ts auth/login).\n\nDeliberately NOT an AdminMeResponse, though it used to be. This route knows\nwho signed in, not what they may see: role and the client list come from\nthe DB per request, and defaulting them here would have this payload\nannounce every KAM as a full superadmin to anyone who trusted the type. The\npanel asks /me — one answer, one place."},"AdminLoginRequest":{"properties":{"email":{"type":"string","maxLength":255,"minLength":1,"title":"Email"},"password":{"type":"string","maxLength":512,"minLength":1,"title":"Password"}},"type":"object","required":["email","password"],"title":"AdminLoginRequest","description":"Step 1: email + password. The response decides whether step 2 is\nenrollment (show QR) or verification (just ask for the code)."},"AdminLoginTotpRequest":{"properties":{"pending_token":{"type":"string","maxLength":2048,"minLength":1,"title":"Pending Token"},"totp_code":{"type":"string","maxLength":10,"minLength":6,"title":"Totp Code","description":"6-digit TOTP code from the operator's authenticator app."}},"type":"object","required":["pending_token","totp_code"],"title":"AdminLoginTotpRequest","description":"Step 2: submit the 6-digit code with the pending_token from step 1."},"AdminMeResponse":{"properties":{"authenticated":{"type":"boolean","title":"Authenticated","default":true},"email":{"type":"string","title":"Email"},"scope":{"type":"string","title":"Scope"},"role":{"type":"string","title":"Role","default":"superadmin"},"clients":{"items":{"type":"string"},"type":"array","title":"Clients"}},"type":"object","required":["email","scope"],"title":"AdminMeResponse","description":"Whoami — returned by GET /me on every authenticated request.\n\n``role`` and ``clients`` exist so the panel renders what the server says it\nmay render, instead of keeping its own copy of the rules. A frontend list of\n\"tabs a KAM can see\" would be a second permission table, and the two would\ndisagree the first time either side changed."},"AdminPatchCustomKBRequest":{"properties":{"is_temporary":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Temporary","description":"Set false to promote a temporary eval KB to definitive"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"New title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"New description"},"metadata_filter_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Filter Fields","description":"Replace the KB's metadata filter field names (e.g. add 'modelo'). Re-ingest or delete a document afterwards to recompute the cached filter values for the new set."},"metadata_filter_guidance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata Filter Guidance","description":"Replace the free-text guidance on how the LLM should use the filters (injected into the search tool description). Takes effect immediately, no re-ingest."}},"type":"object","title":"AdminPatchCustomKBRequest","description":"All-optional patch for a CUSTOM KB's top-level fields. Used to PROMOTE a temporary\neval KB to definitive in place (is_temporary=false) and/or rename it. Omitted fields\nare left unchanged."},"AdminPatchRetrievalConfigRequest":{"properties":{"rerank_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Rerank Enabled","description":"Enable Cohere rerank as a second retrieval stage"},"rerank_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rerank Model","description":"Cohere rerank model to use"},"top_k_wide":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":10.0},{"type":"null"}],"title":"Top K Wide","description":"Wide top-k for the dense first stage"},"top_n":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Top N","description":"Final chunk count after rerank"},"min_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Score","description":"Minimum rerank relevance score; chunks below are dropped"}},"type":"object","title":"AdminPatchRetrievalConfigRequest","description":"All-optional patch for a CUSTOM KB's retrieval_config (promote tuned/sweep params).\n\nNon-None fields are merged onto the KB's existing retrieval_config (defaults applied\nwhere the KB had none). Omitted fields are left unchanged."},"AdminPlaybookListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminPlaybookSummary"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"AdminPlaybookListResponse"},"AdminPlaybookModelUpdate":{"properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Per-playbook-version model. Free-text — `provider/model_id`, optional `[reasoning=...]` suffix. Pass `null` to clear and fall back to the account default (then env)."}},"type":"object","title":"AdminPlaybookModelUpdate"},"AdminPlaybookSummary":{"properties":{"id":{"type":"string","title":"Id"},"base_id":{"type":"string","title":"Base Id"},"project_id":{"type":"string","title":"Project Id"},"name":{"type":"string","title":"Name"},"version_number":{"type":"integer","title":"Version Number"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"effective_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective Model"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","base_id","project_id","name","version_number","model","effective_model","updated_at"],"title":"AdminPlaybookSummary"},"AdminSetCollectionRequest":{"properties":{"collection_id":{"type":"string","title":"Collection Id","description":"UUID of the Chroma collection to associate with the project"},"database_name":{"type":"string","title":"Database Name","description":"Chroma database name: \"local\" for local storage at ~/ai_studio_chroma.db, or cloud database name like \"AIStudio-PROD\"","default":"local"}},"type":"object","required":["collection_id"],"title":"AdminSetCollectionRequest","description":"Request body for setting a Chroma collection for an assistant via admin API."},"AdminSetCustomKBCollectionRequest":{"properties":{"collection_id":{"type":"string","title":"Collection Id","description":"UUID of the Chroma collection to associate with the custom KB"},"database_name":{"type":"string","title":"Database Name","description":"Chroma database name: \"local\" for local storage at ~/ai_studio_chroma.db, or cloud database name like \"AIStudio-PROD\"","default":"local"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"Optional markdown instructions for LLM on how to use this KB"},"metadata_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Fields","description":"Optional list of additional metadata field names"},"metadata_filter_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Filter Fields","description":"Optional list of metadata filter field names for RAG query filtering"},"retrieval_config":{"anyOf":[{"$ref":"#/components/schemas/RetrievalConfig"},{"type":"null"}],"description":"Optional retrieval tuning (rerank, wide top-k) for this knowledge base"}},"type":"object","required":["collection_id"],"title":"AdminSetCustomKBCollectionRequest","description":"Request body for setting a Chroma collection for a custom knowledge base via admin API."},"AdminValidateMetadataFieldsRequest":{"properties":{"proposed_fields":{"items":{"type":"string"},"type":"array","title":"Proposed Fields","description":"Candidate metadata field names to check in the collection"},"sample_size":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Sample Size","description":"Max example values to return per validated field","default":10}},"type":"object","required":["proposed_fields"],"title":"AdminValidateMetadataFieldsRequest","description":"Request body for validating proposed metadata filter fields against an ingested collection."},"AdminValidateMetadataFieldsResponse":{"properties":{"validated":{"items":{"$ref":"#/components/schemas/MetadataFieldValidation"},"type":"array","title":"Validated","description":"Proposed fields found in the collection, with distinct counts + examples"},"unknown":{"items":{"type":"string"},"type":"array","title":"Unknown","description":"Proposed fields not present on any chunk in the collection"}},"type":"object","title":"AdminValidateMetadataFieldsResponse","description":"Response from validating proposed metadata filter fields."},"AgentClearRequest":{"properties":{"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes","description":"Why the hit is safe (mask any identifier). Recorded as reviewer_notes."}},"type":"object","title":"AgentClearRequest"},"AgentEvent-Input":{"properties":{"event_type":{"type":"string","enum":["message","label","note","handoff_agent","handoff_team","image","file","buttons","cards","flow","template","close"],"title":"Event Type","description":"Type of event to execute"},"data":{"anyOf":[{"$ref":"#/components/schemas/MessageEventData"},{"$ref":"#/components/schemas/LabelEventData"},{"$ref":"#/components/schemas/NoteEventData"},{"$ref":"#/components/schemas/HandoffAgentEventData-Input"},{"$ref":"#/components/schemas/HandoffTeamEventData"},{"$ref":"#/components/schemas/ImageEventData"},{"$ref":"#/components/schemas/FileEventData"},{"$ref":"#/components/schemas/ButtonsEventData"},{"$ref":"#/components/schemas/CardsEventData"},{"$ref":"#/components/schemas/FlowEventData"},{"$ref":"#/components/schemas/TemplateEventData"},{"$ref":"#/components/schemas/CloseEventData"}],"title":"Data","description":"Event-specific data"}},"additionalProperties":false,"type":"object","required":["event_type","data"],"title":"AgentEvent","description":"A single event that the agent wants to execute.\n\nThe agent returns these events and the endpoint executes them\nusing the InboxInterface (ChatwootInbox for production)."},"AgentEvent-Output":{"properties":{"event_type":{"type":"string","enum":["message","label","note","handoff_agent","handoff_team","image","file","buttons","cards","flow","template","close"],"title":"Event Type","description":"Type of event to execute"},"data":{"anyOf":[{"$ref":"#/components/schemas/MessageEventData"},{"$ref":"#/components/schemas/LabelEventData"},{"$ref":"#/components/schemas/NoteEventData"},{"$ref":"#/components/schemas/HandoffAgentEventData-Output"},{"$ref":"#/components/schemas/HandoffTeamEventData"},{"$ref":"#/components/schemas/ImageEventData"},{"$ref":"#/components/schemas/FileEventData"},{"$ref":"#/components/schemas/ButtonsEventData"},{"$ref":"#/components/schemas/CardsEventData"},{"$ref":"#/components/schemas/FlowEventData"},{"$ref":"#/components/schemas/TemplateEventData"},{"$ref":"#/components/schemas/CloseEventData"}],"title":"Data","description":"Event-specific data"}},"additionalProperties":false,"type":"object","required":["event_type","data"],"title":"AgentEvent","description":"A single event that the agent wants to execute.\n\nThe agent returns these events and the endpoint executes them\nusing the InboxInterface (ChatwootInbox for production)."},"AgentMessageAuthor":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Id","description":"The human agent's id on the channel's platform."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"The human agent's display name."}},"type":"object","title":"AgentMessageAuthor"},"AgentMessageRequest":{"properties":{"content":{"type":"string","minLength":1,"title":"Content","description":"What the human agent wrote to the customer."},"agent":{"anyOf":[{"$ref":"#/components/schemas/AgentMessageAuthor"},{"type":"null"}],"description":"Who wrote it."},"message_id":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Message Id","description":"The platform's message id. Idempotency key: the same id is stored once."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"When it was sent (ISO 8601), as the platform says."},"private":{"type":"boolean","title":"Private","description":"A private note. Private notes are refused (400): the customer never saw them.","default":false}},"type":"object","required":["content"],"title":"AgentMessageRequest","description":"Body for POST /playbooks/{base_id}/conversations/{cid}/agent-message."},"AgentMessageResponse":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"message_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Message Index","description":"Index of the stored row; null on a duplicate."},"duplicate":{"type":"boolean","title":"Duplicate","description":"True when this message_id was already stored; nothing was written.","default":false}},"type":"object","required":["conversation_id"],"title":"AgentMessageResponse"},"AggregateMetricsResponse":{"properties":{"total_conversations":{"type":"integer","title":"Total Conversations","description":"Total conversations in the filter range"},"total_scored_conversations":{"type":"integer","title":"Total Scored Conversations","description":"Conversations that have been scored"},"coverage_percentage":{"type":"number","title":"Coverage Percentage","description":"Percentage of conversations with metrics"},"sentiment_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Sentiment Distribution","description":"Distribution of sentiment labels: {negative, neutral, positive}"},"resources_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Resources Distribution","description":"Distribution of resources labels: {irrelevant, partial, relevant}"},"sentiment_shift_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Sentiment Shift Distribution","description":"Distribution: {improved, stable, degraded}"},"deflection_quality_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Deflection Quality Distribution","description":"Distribution (non-handoff): {resolved, actioned, partial, no_response}"},"handoff_reason_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Handoff Reason Distribution","description":"Distribution (handoff): {policy, user_request, frustration, bot_limitation}"},"recontact_risk_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Recontact Risk Distribution","description":"Distribution: {low, medium, high}"}},"type":"object","required":["total_conversations","total_scored_conversations","coverage_percentage","sentiment_distribution","resources_distribution"],"title":"AggregateMetricsResponse","description":"Aggregated quality metrics across multiple conversations."},"AlertDefinitionCreate":{"properties":{"name":{"type":"string","title":"Name"},"instructions":{"type":"string","title":"Instructions"},"cron_expression":{"type":"string","title":"Cron Expression"},"playbook_base_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Playbook Base Ids"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Recipients"}},"type":"object","required":["name","instructions","cron_expression"],"title":"AlertDefinitionCreate"},"AlertDefinitionResponse":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id"},"name":{"type":"string","title":"Name"},"instructions":{"type":"string","title":"Instructions"},"cron_expression":{"type":"string","title":"Cron Expression"},"playbook_base_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Playbook Base Ids"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Recipients"},"is_enabled":{"type":"boolean","title":"Is Enabled"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run At"},"last_triggered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Triggered At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","project_id","name","instructions","cron_expression","playbook_base_ids","slack_channel","email_recipients","is_enabled","created_at","updated_at"],"title":"AlertDefinitionResponse"},"AlertDefinitionUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions"},"cron_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cron Expression"},"playbook_base_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Playbook Base Ids"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Recipients"},"is_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Enabled"}},"type":"object","title":"AlertDefinitionUpdate"},"AlertDefinitionsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AlertDefinitionResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"AlertDefinitionsListResponse"},"AlertRunLogEntry":{"properties":{"ts":{"type":"string","title":"Ts"},"step":{"type":"string","title":"Step"},"detail":{"type":"string","title":"Detail","default":""}},"type":"object","required":["ts","step"],"title":"AlertRunLogEntry"},"AlertRunResponse":{"properties":{"id":{"type":"string","title":"Id"},"alert_definition_id":{"type":"string","title":"Alert Definition Id"},"status":{"$ref":"#/components/schemas/AlertRunStatus"},"triggered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Triggered"},"trigger_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Summary"},"window_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Window Start"},"window_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Window End"},"sami_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sami Session Id"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"execution_log":{"anyOf":[{"items":{"$ref":"#/components/schemas/AlertRunLogEntry"},"type":"array"},{"type":"null"}],"title":"Execution Log"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","alert_definition_id","status","triggered","trigger_summary","sami_session_id","error_message","started_at","completed_at","created_at"],"title":"AlertRunResponse"},"AlertRunStatus":{"type":"string","enum":["pending","running","completed","failed","cancelled"],"title":"AlertRunStatus"},"AlertRunsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AlertRunResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"AlertRunsListResponse"},"ApiTool":{"properties":{"name":{"type":"string","maxLength":64,"pattern":"^[a-zA-Z0-9_.-]{1,64}$","title":"Name","description":"Tool name. Allowed: a-z A-Z 0-9 _ . - (max 64 chars). Required by OpenAI/Azure/Anthropic."},"description":{"type":"string","title":"Description","description":"What the tool does and when to use it"},"url":{"type":"string","title":"Url","description":"URL template with {{ parameter }} placeholders"},"method":{"type":"string","title":"Method","description":"HTTP method: GET, POST, PUT, PATCH, DELETE"},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers","description":"Authentication headers"},"parameters":{"items":{"$ref":"#/components/schemas/ToolParameter"},"type":"array","title":"Parameters","description":"Parameter definitions"},"body_fields":{"items":{"$ref":"#/components/schemas/BodyField"},"type":"array","title":"Body Fields","description":"Body field definitions for POST/PUT/PATCH"},"body_type":{"type":"string","title":"Body Type","description":"Body mode: 'fields' or 'json'","default":"fields"},"body_json":{"type":"string","title":"Body Json","description":"Raw JSON template (used when body_type='json')","default":""},"data_expiration_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Data Expiration Hours","description":"Hours until tool data expires. 0=always re-fetch, null=never expires"},"response_jmespath":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Jmespath","description":"Optional JMESPath expression applied to the JSON response before it's returned to the LLM. Lets tool authors trim/reshape verbose API responses (drop noisy keys, filter collections, project a subset of fields). null/empty = no transformation. If parsing or evaluation fails the raw response is returned unchanged."},"response_mode":{"type":"string","enum":["sync","async"],"title":"Response Mode","description":"How this tool answers. 'sync' (default): the HTTP response IS the result. 'async': the call only STARTS the work — the response is an acknowledgement, and the real result arrives later when the worker POSTs it to the per-run callback URL the runtime mints. That URL is not configurable: it is always added to the body as a top-level `callback_url` key and sent on the X-Studiochat-Callback-Url header, written last so nothing configured can shadow it. Async tools also give the assistant a tool that returns whatever the worker last posted back — Studio Chat imposes no status of its own; the worker's own payload says what happened.","default":"sync"},"is_handoff":{"type":"boolean","title":"Is Handoff","description":"This tool hands the conversation to a person: a routing service that picks who takes over and assigns the conversation itself. Every assistant that uses it (and can hand off) hands off ONLY through it: the built-in handoff is removed, and a call that succeeds counts as a handoff.","default":false},"timeout_seconds":{"anyOf":[{"type":"integer","maximum":90.0,"minimum":1.0},{"type":"null"}],"title":"Timeout Seconds","description":"Seconds the HTTP request may take before the call fails with a timeout (1-90). null = the default, 30s. The ceiling is 90s because the call runs inside the turn, which has 120s in total; for work that takes longer use response_mode='async'."},"id":{"type":"string","title":"Id","description":"Unique tool ID"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this tool belongs to"},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Legacy flag: true only for tools removed before archiving existed. Those rows are inert — the agent never sees them and unarchiving does not bring them back. Archiving sets is_archived, never this.","default":false},"is_archived":{"type":"boolean","title":"Is Archived","description":"Whether this tool is archived. Archiving is organizational: the tool is hidden from the list by default and from the pickers, and every assistant that references it KEEPS calling it. To stop an assistant from using a tool, remove the reference from the assistant (that is a new, rollback-able version).","default":false},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Archived At","description":"When this tool was archived (null if live)"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When this tool was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When this tool was last updated"},"is_managed":{"type":"boolean","title":"Is Managed","description":"Whether Studio Chat hosts and maintains what this tool calls — the `stdcht.io` zone, i.e. a dedicated `<customer>.stdcht.io` worker or the shared `apis.stdcht.io/<customer>`. Read-only and DERIVED FROM `url` on every read: it is not a column, it is not accepted on write, and it cannot drift from where the tool actually points. Changing the URL to another host changes this on the next read.","readOnly":true}},"type":"object","required":["name","description","url","method","id","project_id","created_at","updated_at","is_managed"],"title":"ApiTool","description":"Full API tool model with all fields.\n\nTools are stored at the project level.\nEach playbook version references which tools are active via the api_tools field."},"ApiToolAlertConfigResponse":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id"},"account_id":{"type":"string","title":"Account Id"},"api_tool_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Tool Id"},"is_enabled":{"type":"boolean","title":"Is Enabled"},"error_threshold":{"type":"integer","title":"Error Threshold"},"window_minutes":{"type":"integer","title":"Window Minutes"},"cron_expression":{"type":"string","title":"Cron Expression"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Recipients"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","project_id","account_id","api_tool_id","is_enabled","error_threshold","window_minutes","cron_expression","slack_channel","email_recipients","created_at","updated_at"],"title":"ApiToolAlertConfigResponse"},"ApiToolAlertDefaultUpdate":{"properties":{"error_threshold":{"type":"integer","minimum":1.0,"title":"Error Threshold","description":"Absolute error count that triggers the alert."},"window_minutes":{"type":"integer","minimum":1.0,"title":"Window Minutes","description":"Lookback window in minutes (e.g. 15, 30, 60)."},"cron_expression":{"type":"string","title":"Cron Expression","description":"When to evaluate.","default":"*/10 * * * *"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Recipients"},"is_enabled":{"type":"boolean","title":"Is Enabled","default":true}},"type":"object","required":["error_threshold","window_minutes"],"title":"ApiToolAlertDefaultUpdate","description":"Upsert payload for the project default. ``is_enabled`` is the master\nswitch — when False, no alerts fire anywhere in the project."},"ApiToolAlertOverrideUpdate":{"properties":{"error_threshold":{"type":"integer","minimum":1.0,"title":"Error Threshold","description":"Absolute error count that triggers the alert."},"window_minutes":{"type":"integer","minimum":1.0,"title":"Window Minutes","description":"Lookback window in minutes (e.g. 15, 30, 60)."},"cron_expression":{"type":"string","title":"Cron Expression","description":"When to evaluate.","default":"*/10 * * * *"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Recipients"}},"type":"object","required":["error_threshold","window_minutes"],"title":"ApiToolAlertOverrideUpdate","description":"Upsert payload for a per-tool override. Has no ``is_enabled`` — to\nsilence a tool the user sets a very high threshold."},"ApiToolAlertRunResponse":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id"},"account_id":{"type":"string","title":"Account Id"},"status":{"type":"string","title":"Status"},"triggered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Triggered"},"triggered_tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/TriggeredToolEntry"},"type":"array"},{"type":"null"}],"title":"Triggered Tools"},"evaluated_tools_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Evaluated Tools Count"},"window_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Window End"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","project_id","account_id","status","triggered","triggered_tools","evaluated_tools_count","window_end","error_message","started_at","completed_at","created_at"],"title":"ApiToolAlertRunResponse"},"ApiToolAlertRunsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ApiToolAlertRunResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"ApiToolAlertRunsListResponse"},"ApiToolAlertStatusResponse":{"properties":{"configured":{"type":"boolean","title":"Configured"},"default_enabled":{"type":"boolean","title":"Default Enabled"},"triggered":{"type":"boolean","title":"Triggered"},"triggered_tools":{"items":{"$ref":"#/components/schemas/TriggeredToolEntry"},"type":"array","title":"Triggered Tools"},"evaluated_tools_count":{"type":"integer","title":"Evaluated Tools Count"},"tools_with_override":{"items":{"type":"string"},"type":"array","title":"Tools With Override"}},"type":"object","required":["configured","default_enabled","triggered","triggered_tools","evaluated_tools_count","tools_with_override"],"title":"ApiToolAlertStatusResponse","description":"Live status of API tool alerts for a project — runs the evaluator on\ndemand so the FE doesn't depend on the 10-min cron tick. Used by the\nTools list to show which tools are currently firing and which have a\ncustom override configured."},"ApiToolAnalyticsResponse":{"properties":{"total_calls":{"type":"integer","title":"Total Calls"},"successful_calls":{"type":"integer","title":"Successful Calls"},"failed_calls":{"type":"integer","title":"Failed Calls"},"avg_duration_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Duration Ms"},"tool_config":{"anyOf":[{"$ref":"#/components/schemas/ApiToolConfig"},{"type":"null"}]},"time_series":{"items":{"$ref":"#/components/schemas/ApiToolTimeSeriesPoint"},"type":"array","title":"Time Series"},"recent":{"items":{"$ref":"#/components/schemas/ApiToolRecentItem"},"type":"array","title":"Recent"}},"type":"object","required":["total_calls","successful_calls","failed_calls"],"title":"ApiToolAnalyticsResponse"},"ApiToolConfig":{"properties":{"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","title":"ApiToolConfig","description":"Static metadata about the API tool (endpoint, method)."},"ApiToolCreate":{"properties":{"name":{"type":"string","maxLength":64,"pattern":"^[a-zA-Z0-9_.-]{1,64}$","title":"Name","description":"Tool name. Allowed: a-z A-Z 0-9 _ . - (max 64 chars). Required by OpenAI/Azure/Anthropic."},"description":{"type":"string","title":"Description","description":"What the tool does and when to use it"},"url":{"type":"string","title":"Url","description":"URL template with {{ parameter }} placeholders"},"method":{"type":"string","title":"Method","description":"HTTP method: GET, POST, PUT, PATCH, DELETE"},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers","description":"Authentication headers"},"parameters":{"items":{"$ref":"#/components/schemas/ToolParameter"},"type":"array","title":"Parameters","description":"Parameter definitions"},"body_fields":{"items":{"$ref":"#/components/schemas/BodyField"},"type":"array","title":"Body Fields","description":"Body field definitions for POST/PUT/PATCH"},"body_type":{"type":"string","title":"Body Type","description":"Body mode: 'fields' or 'json'","default":"fields"},"body_json":{"type":"string","title":"Body Json","description":"Raw JSON template (used when body_type='json')","default":""},"data_expiration_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Data Expiration Hours","description":"Hours until tool data expires. 0=always re-fetch, null=never expires"},"response_jmespath":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Jmespath","description":"Optional JMESPath expression applied to the JSON response before it's returned to the LLM. Lets tool authors trim/reshape verbose API responses (drop noisy keys, filter collections, project a subset of fields). null/empty = no transformation. If parsing or evaluation fails the raw response is returned unchanged."},"response_mode":{"type":"string","enum":["sync","async"],"title":"Response Mode","description":"How this tool answers. 'sync' (default): the HTTP response IS the result. 'async': the call only STARTS the work — the response is an acknowledgement, and the real result arrives later when the worker POSTs it to the per-run callback URL the runtime mints. That URL is not configurable: it is always added to the body as a top-level `callback_url` key and sent on the X-Studiochat-Callback-Url header, written last so nothing configured can shadow it. Async tools also give the assistant a tool that returns whatever the worker last posted back — Studio Chat imposes no status of its own; the worker's own payload says what happened.","default":"sync"},"is_handoff":{"type":"boolean","title":"Is Handoff","description":"This tool hands the conversation to a person: a routing service that picks who takes over and assigns the conversation itself. Every assistant that uses it (and can hand off) hands off ONLY through it: the built-in handoff is removed, and a call that succeeds counts as a handoff.","default":false},"timeout_seconds":{"anyOf":[{"type":"integer","maximum":90.0,"minimum":1.0},{"type":"null"}],"title":"Timeout Seconds","description":"Seconds the HTTP request may take before the call fails with a timeout (1-90). null = the default, 30s. The ceiling is 90s because the call runs inside the turn, which has 120s in total; for work that takes longer use response_mode='async'."}},"type":"object","required":["name","description","url","method"],"title":"ApiToolCreate","description":"Model for creating a new API tool."},"ApiToolEffectiveAlertResponse":{"properties":{"api_tool_id":{"type":"string","title":"Api Tool Id"},"source":{"type":"string","enum":["override","default","none"],"title":"Source"},"config":{"anyOf":[{"$ref":"#/components/schemas/ApiToolAlertConfigResponse"},{"type":"null"}]}},"type":"object","required":["api_tool_id","source","config"],"title":"ApiToolEffectiveAlertResponse","description":"What the runtime would use for a given tool — either an override (if\npresent) or the inherited default. ``source`` tells the FE which one\ndrove the values so it can render the correct copy/buttons."},"ApiToolFailure":{"properties":{"id":{"type":"string","title":"Id"},"api_tool_id":{"type":"string","title":"Api Tool Id"},"tool_name":{"type":"string","title":"Tool Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Code"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"error_payload":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Payload"},"request":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Request"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"}},"type":"object","required":["id","api_tool_id","tool_name","created_at"],"title":"ApiToolFailure"},"ApiToolFailureByTool":{"properties":{"api_tool_id":{"type":"string","title":"Api Tool Id"},"tool_name":{"type":"string","title":"Tool Name"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["api_tool_id","tool_name","count"],"title":"ApiToolFailureByTool"},"ApiToolFailureDay":{"properties":{"date":{"type":"string","title":"Date"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["date","count"],"title":"ApiToolFailureDay"},"ApiToolFailuresResponse":{"properties":{"total_failures":{"type":"integer","title":"Total Failures"},"distinct_tools":{"type":"integer","title":"Distinct Tools"},"first_failure_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Failure At"},"last_failure_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Failure At"},"by_day":{"items":{"$ref":"#/components/schemas/ApiToolFailureDay"},"type":"array","title":"By Day"},"by_tool":{"items":{"$ref":"#/components/schemas/ApiToolFailureByTool"},"type":"array","title":"By Tool"},"items":{"items":{"$ref":"#/components/schemas/ApiToolFailure"},"type":"array","title":"Items"}},"type":"object","required":["total_failures","distinct_tools"],"title":"ApiToolFailuresResponse"},"ApiToolRecentItem":{"properties":{"id":{"type":"string","title":"Id"},"tool_name":{"type":"string","title":"Tool Name"},"input_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Params"},"output_result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output Result"},"request_meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Request Meta"},"success":{"type":"boolean","title":"Success"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"}},"type":"object","required":["id","tool_name","success","created_at"],"title":"ApiToolRecentItem"},"ApiToolTestRequest":{"properties":{"url":{"type":"string","title":"Url"},"method":{"type":"string","title":"Method"},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers"},"body":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"string"},{"type":"null"}],"title":"Body"},"tool_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Id"},"timeout_seconds":{"anyOf":[{"type":"integer","maximum":90.0,"minimum":1.0},{"type":"null"}],"title":"Timeout Seconds"}},"type":"object","required":["url","method"],"title":"ApiToolTestRequest","description":"Request body for the API tool test proxy."},"ApiToolTimeSeriesPoint":{"properties":{"date":{"type":"string","title":"Date"},"count":{"type":"integer","title":"Count"},"success_count":{"type":"integer","title":"Success Count"},"avg_duration_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Duration Ms"}},"type":"object","required":["date","count","success_count"],"title":"ApiToolTimeSeriesPoint"},"ApiToolUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":64,"pattern":"^[a-zA-Z0-9_.-]{1,64}$"},{"type":"null"}],"title":"Name","description":"Updated tool name. Allowed: a-z A-Z 0-9 _ . - (max 64 chars)."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Updated tool description"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Updated URL template"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method","description":"Updated HTTP method"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Headers","description":"Updated headers"},"parameters":{"anyOf":[{"items":{"$ref":"#/components/schemas/ToolParameter"},"type":"array"},{"type":"null"}],"title":"Parameters","description":"Updated parameters"},"body_fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/BodyField"},"type":"array"},{"type":"null"}],"title":"Body Fields","description":"Updated body field definitions"},"body_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Type","description":"Updated body mode: 'fields' or 'json'"},"body_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Json","description":"Updated raw JSON template"},"data_expiration_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Data Expiration Hours","description":"Updated data expiration hours"},"response_jmespath":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Jmespath","description":"Updated JMESPath response filter (null/empty = no transformation)"},"response_mode":{"anyOf":[{"type":"string","enum":["sync","async"]},{"type":"null"}],"title":"Response Mode","description":"Updated response mode"},"is_handoff":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Handoff","description":"Updated: whether this tool hands the conversation to a person"},"timeout_seconds":{"anyOf":[{"type":"integer","maximum":90.0,"minimum":1.0},{"type":"null"}],"title":"Timeout Seconds","description":"Updated request timeout. Seconds the HTTP request may take before the call fails with a timeout (1-90). null = the default, 30s. The ceiling is 90s because the call runs inside the turn, which has 120s in total; for work that takes longer use response_mode='async'. Send null to go back to the default."}},"type":"object","title":"ApiToolUpdate","description":"Model for updating an API tool."},"ApiToolWithUsage-Input":{"properties":{"name":{"type":"string","maxLength":64,"pattern":"^[a-zA-Z0-9_.-]{1,64}$","title":"Name","description":"Tool name. Allowed: a-z A-Z 0-9 _ . - (max 64 chars). Required by OpenAI/Azure/Anthropic."},"description":{"type":"string","title":"Description","description":"What the tool does and when to use it"},"url":{"type":"string","title":"Url","description":"URL template with {{ parameter }} placeholders"},"method":{"type":"string","title":"Method","description":"HTTP method: GET, POST, PUT, PATCH, DELETE"},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers","description":"Authentication headers"},"parameters":{"items":{"$ref":"#/components/schemas/ToolParameter"},"type":"array","title":"Parameters","description":"Parameter definitions"},"body_fields":{"items":{"$ref":"#/components/schemas/BodyField"},"type":"array","title":"Body Fields","description":"Body field definitions for POST/PUT/PATCH"},"body_type":{"type":"string","title":"Body Type","description":"Body mode: 'fields' or 'json'","default":"fields"},"body_json":{"type":"string","title":"Body Json","description":"Raw JSON template (used when body_type='json')","default":""},"data_expiration_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Data Expiration Hours","description":"Hours until tool data expires. 0=always re-fetch, null=never expires"},"response_jmespath":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Jmespath","description":"Optional JMESPath expression applied to the JSON response before it's returned to the LLM. Lets tool authors trim/reshape verbose API responses (drop noisy keys, filter collections, project a subset of fields). null/empty = no transformation. If parsing or evaluation fails the raw response is returned unchanged."},"response_mode":{"type":"string","enum":["sync","async"],"title":"Response Mode","description":"How this tool answers. 'sync' (default): the HTTP response IS the result. 'async': the call only STARTS the work — the response is an acknowledgement, and the real result arrives later when the worker POSTs it to the per-run callback URL the runtime mints. That URL is not configurable: it is always added to the body as a top-level `callback_url` key and sent on the X-Studiochat-Callback-Url header, written last so nothing configured can shadow it. Async tools also give the assistant a tool that returns whatever the worker last posted back — Studio Chat imposes no status of its own; the worker's own payload says what happened.","default":"sync"},"is_handoff":{"type":"boolean","title":"Is Handoff","description":"This tool hands the conversation to a person: a routing service that picks who takes over and assigns the conversation itself. Every assistant that uses it (and can hand off) hands off ONLY through it: the built-in handoff is removed, and a call that succeeds counts as a handoff.","default":false},"timeout_seconds":{"anyOf":[{"type":"integer","maximum":90.0,"minimum":1.0},{"type":"null"}],"title":"Timeout Seconds","description":"Seconds the HTTP request may take before the call fails with a timeout (1-90). null = the default, 30s. The ceiling is 90s because the call runs inside the turn, which has 120s in total; for work that takes longer use response_mode='async'."},"id":{"type":"string","title":"Id","description":"Unique tool ID"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this tool belongs to"},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Legacy flag: true only for tools removed before archiving existed. Those rows are inert — the agent never sees them and unarchiving does not bring them back. Archiving sets is_archived, never this.","default":false},"is_archived":{"type":"boolean","title":"Is Archived","description":"Whether this tool is archived. Archiving is organizational: the tool is hidden from the list by default and from the pickers, and every assistant that references it KEEPS calling it. To stop an assistant from using a tool, remove the reference from the assistant (that is a new, rollback-able version).","default":false},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Archived At","description":"When this tool was archived (null if live)"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When this tool was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When this tool was last updated"},"used_by_playbooks":{"items":{"$ref":"#/components/schemas/PlaybookReference"},"type":"array","title":"Used By Playbooks","description":"One entry per assistant whose active/connected OR latest version references this tool. Empty when nothing uses it."}},"type":"object","required":["name","description","url","method","id","project_id","created_at","updated_at"],"title":"ApiToolWithUsage","description":"API tool model extended with playbook usage information.\n\nReturned by ``GET /projects/{id}/api-tools?include_playbook_usage=true``. The\ntwin of ``KnowledgeBaseWithUsage`` — keep the two in step."},"ApiToolWithUsage-Output":{"properties":{"name":{"type":"string","maxLength":64,"pattern":"^[a-zA-Z0-9_.-]{1,64}$","title":"Name","description":"Tool name. Allowed: a-z A-Z 0-9 _ . - (max 64 chars). Required by OpenAI/Azure/Anthropic."},"description":{"type":"string","title":"Description","description":"What the tool does and when to use it"},"url":{"type":"string","title":"Url","description":"URL template with {{ parameter }} placeholders"},"method":{"type":"string","title":"Method","description":"HTTP method: GET, POST, PUT, PATCH, DELETE"},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers","description":"Authentication headers"},"parameters":{"items":{"$ref":"#/components/schemas/ToolParameter"},"type":"array","title":"Parameters","description":"Parameter definitions"},"body_fields":{"items":{"$ref":"#/components/schemas/BodyField"},"type":"array","title":"Body Fields","description":"Body field definitions for POST/PUT/PATCH"},"body_type":{"type":"string","title":"Body Type","description":"Body mode: 'fields' or 'json'","default":"fields"},"body_json":{"type":"string","title":"Body Json","description":"Raw JSON template (used when body_type='json')","default":""},"data_expiration_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Data Expiration Hours","description":"Hours until tool data expires. 0=always re-fetch, null=never expires"},"response_jmespath":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Jmespath","description":"Optional JMESPath expression applied to the JSON response before it's returned to the LLM. Lets tool authors trim/reshape verbose API responses (drop noisy keys, filter collections, project a subset of fields). null/empty = no transformation. If parsing or evaluation fails the raw response is returned unchanged."},"response_mode":{"type":"string","enum":["sync","async"],"title":"Response Mode","description":"How this tool answers. 'sync' (default): the HTTP response IS the result. 'async': the call only STARTS the work — the response is an acknowledgement, and the real result arrives later when the worker POSTs it to the per-run callback URL the runtime mints. That URL is not configurable: it is always added to the body as a top-level `callback_url` key and sent on the X-Studiochat-Callback-Url header, written last so nothing configured can shadow it. Async tools also give the assistant a tool that returns whatever the worker last posted back — Studio Chat imposes no status of its own; the worker's own payload says what happened.","default":"sync"},"is_handoff":{"type":"boolean","title":"Is Handoff","description":"This tool hands the conversation to a person: a routing service that picks who takes over and assigns the conversation itself. Every assistant that uses it (and can hand off) hands off ONLY through it: the built-in handoff is removed, and a call that succeeds counts as a handoff.","default":false},"timeout_seconds":{"anyOf":[{"type":"integer","maximum":90.0,"minimum":1.0},{"type":"null"}],"title":"Timeout Seconds","description":"Seconds the HTTP request may take before the call fails with a timeout (1-90). null = the default, 30s. The ceiling is 90s because the call runs inside the turn, which has 120s in total; for work that takes longer use response_mode='async'."},"id":{"type":"string","title":"Id","description":"Unique tool ID"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this tool belongs to"},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Legacy flag: true only for tools removed before archiving existed. Those rows are inert — the agent never sees them and unarchiving does not bring them back. Archiving sets is_archived, never this.","default":false},"is_archived":{"type":"boolean","title":"Is Archived","description":"Whether this tool is archived. Archiving is organizational: the tool is hidden from the list by default and from the pickers, and every assistant that references it KEEPS calling it. To stop an assistant from using a tool, remove the reference from the assistant (that is a new, rollback-able version).","default":false},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Archived At","description":"When this tool was archived (null if live)"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When this tool was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When this tool was last updated"},"used_by_playbooks":{"items":{"$ref":"#/components/schemas/PlaybookReference"},"type":"array","title":"Used By Playbooks","description":"One entry per assistant whose active/connected OR latest version references this tool. Empty when nothing uses it."},"is_managed":{"type":"boolean","title":"Is Managed","description":"Whether Studio Chat hosts and maintains what this tool calls — the `stdcht.io` zone, i.e. a dedicated `<customer>.stdcht.io` worker or the shared `apis.stdcht.io/<customer>`. Read-only and DERIVED FROM `url` on every read: it is not a column, it is not accepted on write, and it cannot drift from where the tool actually points. Changing the URL to another host changes this on the next read.","readOnly":true}},"type":"object","required":["name","description","url","method","id","project_id","created_at","updated_at","is_managed"],"title":"ApiToolWithUsage","description":"API tool model extended with playbook usage information.\n\nReturned by ``GET /projects/{id}/api-tools?include_playbook_usage=true``. The\ntwin of ``KnowledgeBaseWithUsage`` — keep the two in step."},"ApprovalDecision":{"properties":{"decision":{"type":"string","enum":["approve","reject"],"title":"Decision"},"activate":{"type":"boolean","title":"Activate","default":false},"ticket":{"type":"string","maxLength":4096,"title":"Ticket"},"grant_id":{"type":"string","maxLength":255,"title":"Grant Id"},"expected_active_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Active Version"},"expected_latest_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expected Latest Version"}},"type":"object","required":["decision","ticket","grant_id"],"title":"ApprovalDecision"},"ApprovalDecisionResponse":{"properties":{"id":{"type":"string","title":"Id"},"account_id":{"type":"string","title":"Account Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"request_method":{"type":"string","title":"Request Method"},"request_path":{"type":"string","title":"Request Path"},"request_query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Query"},"request_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Body"},"request_content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Content Type"},"description":{"type":"string","title":"Description"},"change_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Description"},"status":{"type":"string","title":"Status"},"submitted_by_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Submitted By User Id"},"submitted_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Submitted By Name"},"reviewed_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reviewed By"},"reviewed_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewed By Name"},"reviewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reviewed At"},"execution_status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Execution Status Code"},"execution_result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Execution Result"},"executed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Executed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"url":{"type":"string","title":"Url"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"reviewed_via":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewed Via"},"target_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Type"},"target_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Id"},"target_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Label"},"change_diff":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Change Diff"},"activation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Activation"},"activation_result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Activation Result"}},"type":"object","required":["id","account_id","project_id","request_method","request_path","request_query","request_body","request_content_type","description","change_description","status","submitted_by_user_id","submitted_by_name","reviewed_by","reviewed_by_name","reviewed_at","execution_status_code","execution_result","executed_at","created_at","updated_at","url"],"title":"ApprovalDecisionResponse"},"ApprovalDescriptionUpdate":{"properties":{"description":{"type":"string","maxLength":20000,"minLength":1,"title":"Description"}},"type":"object","required":["description"],"title":"ApprovalDescriptionUpdate"},"ApprovalNotificationConfigResponse":{"properties":{"project_id":{"type":"string","title":"Project Id"},"is_enabled":{"type":"boolean","title":"Is Enabled"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["project_id","is_enabled","slack_channel"],"title":"ApprovalNotificationConfigResponse"},"ApprovalNotificationConfigUpdate":{"properties":{"is_enabled":{"type":"boolean","title":"Is Enabled","default":true},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"}},"type":"object","title":"ApprovalNotificationConfigUpdate"},"ApprovalPolicy":{"properties":{"mcp_changes_require_approval":{"type":"boolean","title":"Mcp Changes Require Approval"}},"type":"object","required":["mcp_changes_require_approval"],"title":"ApprovalPolicy","description":"The account's approval policy.\n\n``mcp_changes_require_approval``: a change an AI makes to an assistant\nthrough a Rumo MCP connection waits here for a person instead of going live."},"ApprovalResponse":{"properties":{"id":{"type":"string","title":"Id"},"account_id":{"type":"string","title":"Account Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"request_method":{"type":"string","title":"Request Method"},"request_path":{"type":"string","title":"Request Path"},"request_query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Query"},"request_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Body"},"request_content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Content Type"},"description":{"type":"string","title":"Description"},"change_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Description"},"status":{"type":"string","title":"Status"},"submitted_by_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Submitted By User Id"},"submitted_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Submitted By Name"},"reviewed_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reviewed By"},"reviewed_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewed By Name"},"reviewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reviewed At"},"execution_status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Execution Status Code"},"execution_result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Execution Result"},"executed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Executed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"url":{"type":"string","title":"Url"},"origin":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"reviewed_via":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewed Via"},"target_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Type"},"target_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Id"},"target_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Label"},"change_diff":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Change Diff"},"activation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Activation"}},"type":"object","required":["id","account_id","project_id","request_method","request_path","request_query","request_body","request_content_type","description","change_description","status","submitted_by_user_id","submitted_by_name","reviewed_by","reviewed_by_name","reviewed_at","execution_status_code","execution_result","executed_at","created_at","updated_at","url"],"title":"ApprovalResponse"},"AssertionFlip":{"properties":{"description":{"type":"string","title":"Description","description":"Short label for the assertion (matches ``AssertionResult.criteria``)"},"passed_a":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Passed A","description":"Outcome in run A; ``None`` if the assertion didn't run"},"passed_b":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Passed B","description":"Outcome in run B; ``None`` if the assertion didn't run"},"explanation_a":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation A"},"explanation_b":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation B"}},"type":"object","required":["description"],"title":"AssertionFlip","description":"One assertion's delta between run A and run B for a given case."},"AssertionResult":{"properties":{"criteria":{"type":"string","title":"Criteria","description":"Human-readable label for the assertion"},"passed":{"type":"boolean","title":"Passed","description":"Legacy binary verdict. ``ambiguous`` verdicts map to True here (an unverifiable criterion is not a failure) — prefer ``verdict``."},"verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verdict","description":"Ternary verdict: ``passed`` / ``failed`` / ``ambiguous``. ``ambiguous`` means the criterion is too vague to verify taskly — see ``rewrite_suggestion``. ``None`` on rows persisted before this field existed."},"explanation":{"type":"string","title":"Explanation","description":"Explanation of why it passed or failed"},"rewrite_suggestion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rewrite Suggestion","description":"Only on ``ambiguous`` verdicts: a judge-proposed rewrite of the criterion that would be taskly verifiable. Invitation to fix the test, not a verdict."},"assertion":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/TextAssertion"},{"$ref":"#/components/schemas/ToolCalledAssertion"},{"$ref":"#/components/schemas/ToolNotCalledAssertion"},{"$ref":"#/components/schemas/ToolCallSequenceAssertion"},{"$ref":"#/components/schemas/HandoffAssertion"},{"$ref":"#/components/schemas/HandoffAgentAssertion"},{"$ref":"#/components/schemas/HandoffTeamAssertion"},{"$ref":"#/components/schemas/NoHandoffAssertion"},{"$ref":"#/components/schemas/TagAddedAssertion"},{"$ref":"#/components/schemas/PrivateNoteContainsAssertion"},{"$ref":"#/components/schemas/SkillLoadedAssertion"}]},{"type":"null"}],"title":"Assertion","description":"The full typed assertion (None for legacy result rows)"},"judged_by":{"anyOf":[{"type":"string","enum":["llm","jev"]},{"type":"null"}],"title":"Judged By","description":"Which judge produced the verdict of a ``text`` assertion in a ``jev_then_llm`` or ``shadow`` run: ``jev`` (a pass jev settled on its own, with no LLM explanation) or ``llm``. Absent in ``llm`` runs, on structured assertions and on older rows."},"jev_probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Jev Probability","description":"jev's probability (0-1) that the criterion is satisfied. Absent when jev gave no answer (``llm`` runs, structured assertions, a jev outage)."},"jev_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Jev Confidence","description":"Confidence (0-1) of jev's pass/fail call. jev's yes/no answers report none, so it is derived as ``min(1, 2·|jev_probability − jev_pass_threshold|)``. Absent when jev gave no answer."},"escalated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Escalated","description":"Whether jev's answer fell short of settling the assertion (a fail, or a pass below the confidence floor), which sends it to the LLM judge. ``false`` together with ``judged_by='llm'`` marks an audit sample in a ``jev_then_llm`` run, or, in a ``shadow`` run, a pass jev would have settled. Absent when jev gave no answer."}},"type":"object","required":["criteria","passed","explanation"],"title":"AssertionResult","description":"Result of evaluating a single assertion.\n\n``criteria`` is the human-readable label for the assertion (the original\nfree-text criteria for ``text`` assertions; a synthesized one-liner like\n``\"tool_called: load_skill\"`` for structured assertions). It exists for\nlegacy frontends and the YAML export. ``assertion`` is the full typed\nassertion when available — frontends should prefer it for rendering.\n``explanation`` is the judge output: LLM rationale for text-type, or a\ndeterministic trace for structured types."},"AssertionTypeStat":{"properties":{"type":{"type":"string","title":"Type","description":"Assertion type (text, tool_called, handoff_to_agent, …)"},"total":{"type":"integer","title":"Total"},"passed":{"type":"integer","title":"Passed"},"pass_rate":{"type":"number","title":"Pass Rate","description":"passed / total (0–100)"}},"type":"object","required":["type","total","passed","pass_rate"],"title":"AssertionTypeStat","description":"Pass-rate for one assertion type within the latest completed run."},"AssignTaskRequest":{"properties":{"task_id":{"type":"string","title":"Task Id","description":"Task to pursue, by id, from this assistant's catalog.","examples":["tsk_7f3ab2c19d04"]},"inputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Inputs","description":"What this task gets to work with in THIS conversation — the part of the job that differs per person (the questions to ask, the amount owed). A free-form JSON object, yours to shape. Stored on the task run for as long as the task lives and shown to the assistant inside its task block on every turn (one `key: value` line per top-level key), so the task text can read a value with `{{ input: preguntas }}` or simply say 'las preguntas del input'. Separate from `context` on purpose: context is the channel's per-turn view of the conversation, inputs are the assigner's. Ignored when this same task is already running: re-assigning is a no-op, and a retry must not rewrite what the running task was given.","examples":[{"preguntas":["¿A qué actividad te dedicás?","¿De quién recibís los fondos?"]}]},"start_now":{"type":"boolean","title":"Start Now","description":"Have the assistant write the task's first message right away, instead of waiting for the customer's next message (or for the task follow-up cron) to carry it. Off by default, which is what every assignment did before the field existed. Only for a conversation that is already underway on a channel: the message is delivered the way a follow-up is, through the channel the conversation is stamped with — except that a conversation closed on the platform is reopened to deliver it, where the channel can (Intercom), instead of being skipped like a follow-up. Refused before anything is written when it could not be delivered — 409 if nobody has spoken there yet (open it with POST /playbooks/{base_id}/conversations/start instead) or if the conversation was handed off to a human, 400 if no channel can deliver into it. Re-assigning the task that is already running stays a no-op and sends nothing.","default":false},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Extra context for the turn `start_now` runs, like `context` on /chat — what the tools and `{{ }}` macros of that first message read. The turn already runs with the context the channel stored with the conversation's last inbound message (the contact's attributes, the platform's conversation id); this is merged on top, nested objects key by key, and wins where both set a value. Not persisted, and ignored without `start_now`."}},"type":"object","required":["task_id"],"title":"AssignTaskRequest","description":"Assign a task to a conversation."},"AssistantAnalyticsMetrics":{"properties":{"assistant_id":{"type":"string","title":"Assistant Id","description":"Assistant/Project ID"},"assistant_name":{"type":"string","title":"Assistant Name","description":"Assistant name"},"total_conversations":{"type":"integer","title":"Total Conversations","description":"Total conversations for this assistant"},"total_ai_messages":{"type":"integer","title":"Total Ai Messages","description":"Total AI messages sent by this assistant"},"conversations_with_handoff":{"type":"integer","title":"Conversations With Handoff","description":"Conversations that required handoff"},"deflection_rate":{"type":"number","title":"Deflection Rate","description":"Percentage of conversations resolved without handoff (0-100)"}},"type":"object","required":["assistant_id","assistant_name","total_conversations","total_ai_messages","conversations_with_handoff","deflection_rate"],"title":"AssistantAnalyticsMetrics","description":"Analytics metrics for a specific assistant/project."},"AssistantDateOverride":{"properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","title":"Date","description":"Date in YYYY-MM-DD format"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Optional label (e.g., 'Christmas', 'Vacation')"},"is_available":{"type":"boolean","title":"Is Available","description":"False = completely unavailable (OOO), True = available with modified hours","default":false},"override_schedule":{"anyOf":[{"$ref":"#/components/schemas/OverrideSchedule"},{"type":"null"}],"description":"Custom schedule for this date (required if is_available=True)"},"id":{"type":"string","title":"Id","description":"Unique override ID"},"playbook_base_id":{"type":"string","title":"Playbook Base Id","description":"Playbook base ID this override belongs to"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the override was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When the override was last updated"}},"type":"object","required":["date","id","playbook_base_id","created_at","updated_at"],"title":"AssistantDateOverride","description":"Full assistant date override model with all fields."},"AssistantDateOverrideCreate":{"properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","title":"Date","description":"Date in YYYY-MM-DD format"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Optional label (e.g., 'Christmas', 'Vacation')"},"is_available":{"type":"boolean","title":"Is Available","description":"False = completely unavailable (OOO), True = available with modified hours","default":false},"override_schedule":{"anyOf":[{"$ref":"#/components/schemas/OverrideSchedule"},{"type":"null"}],"description":"Custom schedule for this date (required if is_available=True)"}},"type":"object","required":["date"],"title":"AssistantDateOverrideCreate","description":"Model for creating an assistant date override."},"AssistantDateOverrideUpdate":{"properties":{"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"title":"Date","description":"Updated date"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Updated label"},"is_available":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Available","description":"Updated availability status"},"override_schedule":{"anyOf":[{"$ref":"#/components/schemas/OverrideSchedule"},{"type":"null"}],"description":"Updated override schedule"}},"type":"object","title":"AssistantDateOverrideUpdate","description":"Model for updating an assistant date override."},"AssistantDefaultMessages":{"properties":{"unsupported_media":{"anyOf":[{"$ref":"#/components/schemas/DefaultMessage"},{"type":"null"}],"description":"The user sent something the assistant cannot read: a video, a voice note, a file it cannot open."},"unavailable":{"anyOf":[{"$ref":"#/components/schemas/DefaultMessage"},{"type":"null"}],"description":"Studio Chat could not answer this turn (kill switch, timeout, 5xx). Not used for conversations a rollout percentage keeps away from the AI — those never involved the user."}},"additionalProperties":false,"type":"object","title":"AssistantDefaultMessages","description":"The canned replies, one slot per situation a channel can hit.\n\nBoth slots are optional and `None` means *not configured*: the channel keeps\nwhatever default it already had. That is what makes this safe to ship to\nbridges that are already live — nothing changes until somebody saves the\nform."},"AssistantDefaultMessagesResponse":{"properties":{"playbook_base_id":{"type":"string","title":"Playbook Base Id","description":"Base ID of the assistant these messages belong to"},"messages":{"$ref":"#/components/schemas/AssistantDefaultMessages","description":"Configured slots. A null slot means the channel keeps its own default."},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"When the assistant's settings last changed (null when none were ever saved)"}},"type":"object","required":["playbook_base_id","messages"],"title":"AssistantDefaultMessagesResponse","description":"What a channel reads to know what to say for it.\n\nDeliberately narrower than `PlaybookSettings`: bridges are external\nprocesses holding an account-wide API key, and none of them needs the\nwinback webhook URL to answer \"what do I reply to a video\"."},"AssistantEvalSummary-Input":{"properties":{"playbook_base_id":{"type":"string","title":"Playbook Base Id"},"playbook_id":{"type":"string","title":"Playbook Id","description":"Latest version UUID — used to trigger a run from the dashboard"},"name":{"type":"string","title":"Name"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"case_count":{"type":"integer","title":"Case Count","default":0},"pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pass Rate","description":"Latest completed run case pass-rate (0–100)"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run At","description":"created_at of the most recent run (any status)"},"last_run_status":{"anyOf":[{"$ref":"#/components/schemas/EvalRunStatus"},{"type":"null"}],"description":"Status of the most recent run (any status)"},"last_run_passed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Run Passed"},"last_run_failed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Run Failed"},"last_run_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Run Total"},"enabled_case_count":{"type":"integer","title":"Enabled Case Count","default":0},"total_runs":{"type":"integer","title":"Total Runs","default":0},"last_suite":{"anyOf":[{"$ref":"#/components/schemas/RunTrendPoint"},{"type":"null"}],"description":"Most recent completed full-suite run"},"suite_trend":{"items":{"$ref":"#/components/schemas/RunTrendPoint"},"type":"array","title":"Suite Trend","description":"Recent completed full-suite runs, oldest→newest (≤6)"},"failing_cases":{"items":{"$ref":"#/components/schemas/CaseResultBrief"},"type":"array","title":"Failing Cases","description":"Cases that failed (or errored) in the last completed suite"},"error_cases":{"type":"integer","title":"Error Cases","description":"Infra-error cases in the last completed suite","default":0},"flaky_count":{"type":"integer","title":"Flaky Count","description":"Cases with mixed pass/fail outcomes across recent runs","default":0}},"type":"object","required":["playbook_base_id","playbook_id","name"],"title":"AssistantEvalSummary","description":"One row in the multi-assistant overview dashboard.\n\nDeliberately minimal: just enough to show how many cases an assistant has,\nits latest pass rate, and to fire a quick run. No composite \"quality\" score."},"AssistantEvalSummary-Output":{"properties":{"playbook_base_id":{"type":"string","title":"Playbook Base Id"},"playbook_id":{"type":"string","title":"Playbook Id","description":"Latest version UUID — used to trigger a run from the dashboard"},"name":{"type":"string","title":"Name"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"},"case_count":{"type":"integer","title":"Case Count","default":0},"pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pass Rate","description":"Latest completed run case pass-rate (0–100)"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run At","description":"created_at of the most recent run (any status)"},"last_run_status":{"anyOf":[{"$ref":"#/components/schemas/EvalRunStatus"},{"type":"null"}],"description":"Status of the most recent run (any status)"},"last_run_passed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Run Passed"},"last_run_failed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Run Failed"},"last_run_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Run Total"},"enabled_case_count":{"type":"integer","title":"Enabled Case Count","default":0},"total_runs":{"type":"integer","title":"Total Runs","default":0},"last_suite":{"anyOf":[{"$ref":"#/components/schemas/RunTrendPoint"},{"type":"null"}],"description":"Most recent completed full-suite run"},"suite_trend":{"items":{"$ref":"#/components/schemas/RunTrendPoint"},"type":"array","title":"Suite Trend","description":"Recent completed full-suite runs, oldest→newest (≤6)"},"failing_cases":{"items":{"$ref":"#/components/schemas/CaseResultBrief"},"type":"array","title":"Failing Cases","description":"Cases that failed (or errored) in the last completed suite"},"error_cases":{"type":"integer","title":"Error Cases","description":"Infra-error cases in the last completed suite","default":0},"flaky_count":{"type":"integer","title":"Flaky Count","description":"Cases with mixed pass/fail outcomes across recent runs","default":0}},"type":"object","required":["playbook_base_id","playbook_id","name"],"title":"AssistantEvalSummary","description":"One row in the multi-assistant overview dashboard.\n\nDeliberately minimal: just enough to show how many cases an assistant has,\nits latest pass rate, and to fire a quick run. No composite \"quality\" score."},"AssistantSchedule":{"properties":{"name":{"type":"string","title":"Name","description":"User-friendly name for this schedule","default":"Working Hours"},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone (e.g., 'America/New_York')","default":"UTC"},"weekly_schedule":{"$ref":"#/components/schemas/WeeklySchedule-Output","description":"Weekly schedule configuration"},"enabled":{"type":"boolean","title":"Enabled","description":"Whether this assistant schedule override is enabled","default":true},"id":{"type":"string","title":"Id","description":"Unique schedule ID"},"playbook_base_id":{"type":"string","title":"Playbook Base Id","description":"Playbook base ID this schedule belongs to"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the schedule was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When the schedule was last updated"}},"type":"object","required":["id","playbook_base_id","created_at","updated_at"],"title":"AssistantSchedule","description":"Full assistant schedule model with all fields."},"AssistantScheduleCreate":{"properties":{"name":{"type":"string","title":"Name","description":"User-friendly name for this schedule","default":"Working Hours"},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone (e.g., 'America/New_York')","default":"UTC"},"weekly_schedule":{"$ref":"#/components/schemas/WeeklySchedule-Input","description":"Weekly schedule configuration"},"enabled":{"type":"boolean","title":"Enabled","description":"Whether this assistant schedule override is enabled","default":true}},"type":"object","title":"AssistantScheduleCreate","description":"Model for creating an assistant schedule."},"AssistantScheduleUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Updated schedule name"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone","description":"Updated timezone"},"weekly_schedule":{"anyOf":[{"$ref":"#/components/schemas/WeeklySchedule-Input"},{"type":"null"}],"description":"Updated weekly schedule"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","description":"Updated enabled status"}},"type":"object","title":"AssistantScheduleUpdate","description":"Model for updating an assistant schedule."},"AssistantScheduleWithOverrides":{"properties":{"schedule":{"anyOf":[{"$ref":"#/components/schemas/AssistantSchedule"},{"type":"null"}],"description":"The assistant's schedule override (null if not configured)"},"date_overrides":{"items":{"$ref":"#/components/schemas/AssistantDateOverride"},"type":"array","title":"Date Overrides","description":"All date overrides for the assistant"}},"type":"object","title":"AssistantScheduleWithOverrides","description":"Combined response with assistant schedule and all date overrides."},"Attachment":{"properties":{"type":{"$ref":"#/components/schemas/AttachmentType","description":"Type of attachment"},"media_type":{"type":"string","title":"Media Type","description":"MIME type (e.g., 'image/png', 'audio/ogg')"},"data":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Data","description":"Base64-encoded file data"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Public http(s) link to the file, instead of base64 data. An image or document sent as a link only is downloaded when the message arrives (public hosts only, up to 25 MB, 20 s) and then handled exactly like base64 data; if the download fails the model is told a file arrived that could not be read (see download_status). A video always travels by link and is never downloaded here."},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Original filename"},"transcript":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transcript","description":"Audio transcript (audio attachments only). Populated server-side after transcription succeeds; absent or null when transcription failed or the voice note held no speech."},"audio_status":{"anyOf":[{"type":"string","enum":["speech","noise","too_long","failed"]},{"type":"null"}],"title":"Audio Status","description":"What a voice note turned out to be (audio attachments only): 'speech' (transcript holds the text), 'noise' (no intelligible speech — noise, silence, a faulty microphone; no transcript is kept), 'too_long' (over the 5-minute cap, never transcribed) or 'failed' (transcription did not run)."},"noise_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Noise Reason","description":"Why a voice note was judged noise: empty, known_phrase, no_letters, repetition, low_confidence or no_speech."},"document_status":{"anyOf":[{"type":"string","enum":["too_large","password_protected","unreadable","unsupported","parsed"]},{"type":"null"}],"title":"Document Status","description":"Why a document is not shown to the model as the file (document attachments only): 'parsed' (its text is, see parsed_text: a text, Word .docx, Excel .xlsx or PowerPoint .pptx file, or a PDF past the native limits — over 10 MB or 30 pages, or past 20 MB / 80 pages of documents in the conversation), 'too_large' (not parsed; over 25 MB its bytes are not kept either), 'password_protected' or 'unreadable' (a file that does not open), 'unsupported' (any other format). Set server-side; the model gets a note in its place."},"download_status":{"anyOf":[{"type":"string","enum":["failed","too_large"]},{"type":"null"}],"title":"Download Status","description":"Why an image or document sent as a link only has no bytes: 'too_large' (over 25 MB) or 'failed' (unreachable, not a public host, an error answer, a timeout). Set server-side; the model gets a note in its place."},"page_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Count","description":"Pages of a PDF the model was shown or that was parsed (documents only). Set server-side."},"ocr_pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Ocr Pages","description":"Pages of a parsed PDF that went through OCR, billed per page. Set server-side."},"parsed_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parsed Text","description":"What the model reads for a parsed document: a header saying which kind of document it was and that it is an extraction, then the text."},"asset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset Id","description":"Media-library file id (assistant-sent files only)"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Media-library title (assistant-sent files only)"},"caption":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caption","description":"Caption the assistant gave the file"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url","description":"Thumbnail for images (assistant-sent files only)"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes","description":"File size (assistant-sent files only)"}},"type":"object","required":["type","media_type"],"title":"Attachment","description":"Base attachment model for chat messages.\n\nAttachments allow sending files (like images, documents, or audio) along with\nchat messages. Supported types: images (png, jpeg, gif, webp), documents\n(pdf, text, Word .docx, Excel .xlsx, PowerPoint .pptx — all but PDFs reach\nthe model as extracted text), and audio (ogg, mpeg, wav, m4a). Audio attachments are\ntranscribed to text before reaching the LLM; the raw bytes are persisted\non the message but never passed as multimodal content.\n\nVideo attachments travel by ``url`` (channels never inline them — they are\nfar above the request's base64 cap): the LLM sees a short note that a video\narrived, and the Video Analysis toolkit fetches the bytes on demand."},"AttachmentRewriteRequest":{"properties":{"suggestion_text":{"type":"string","title":"Suggestion Text","description":"Suggestion text with file URLs replaced by placeholders like <attachment-1>"},"filenames":{"items":{"type":"string"},"type":"array","title":"Filenames","description":"List of filenames corresponding to the placeholders (in order)"},"conversation_context":{"anyOf":[{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array"},{"type":"null"}],"title":"Conversation Context","description":"Optional conversation history for language detection"}},"type":"object","required":["suggestion_text","filenames"],"title":"AttachmentRewriteRequest","description":"Request to rewrite a suggestion message for attachment delivery.\n\nThe frontend should:\n1. Extract file URLs from the suggestion text\n2. Replace each URL with a placeholder: <attachment-1>, <attachment-2>, etc.\n3. Send the text with placeholders and the list of filenames\n\nThis saves tokens and prevents URL mangling by the LLM."},"AttachmentRewriteResponse":{"properties":{"rewritten_message":{"type":"string","title":"Rewritten Message","description":"Message rewritten to naturally reference attachments (no URLs or placeholders)"}},"type":"object","required":["rewritten_message"],"title":"AttachmentRewriteResponse","description":"Response containing the rewritten message for attachment delivery."},"AttachmentType":{"type":"string","enum":["image","document","audio","video"],"title":"AttachmentType","description":"Supported attachment types."},"AutosuggestionRequest":{"properties":{"conversation":{"items":{"$ref":"#/components/schemas/ConversationMessage"},"type":"array","title":"Conversation","description":"Conversation history between user and assistant"},"user_metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Metadata","description":"Optional metadata about the user"},"agent_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Prompt","description":"Optional agent prompt for specific information requests (e.g., 'answer with the address of the new store in NY'). When provided, bypasses triage filter."},"personality_tone":{"anyOf":[{"$ref":"#/components/schemas/PersonalityToneEnum"},{"type":"null"}],"description":"Optional personality tone for the assistant responses"},"knowledgebase_ids":{"anyOf":[{"items":{"type":"string"},"type":"array","minItems":1},{"type":"null"}],"title":"Knowledgebase Ids","description":"Optional list of knowledge base IDs to filter search results. If provided, must contain at least one ID. If not provided, all knowledge bases are searched."},"contact_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id","description":"Optional contact ID."}},"type":"object","required":["conversation"],"title":"AutosuggestionRequest","description":"Request for autosuggestions (playground endpoint)."},"AutosuggestionResponse":{"properties":{"suggestion":{"anyOf":[{"$ref":"#/components/schemas/SuggestionContent"},{"type":"null"}],"description":"Suggestion with text and confidence, or null if no suggestion can be provided"},"explanation":{"type":"string","title":"Explanation","description":"Explanation of why this suggestion was generated or why no suggestion was provided"},"knowledgebases_used":{"items":{"$ref":"#/components/schemas/KnowledgeBaseRetrievalMetadata"},"type":"array","title":"Knowledgebases Used","description":"Knowledge base documents that were used"},"generation_time_ms":{"type":"integer","title":"Generation Time Ms","description":"Time taken to generate suggestion in milliseconds"},"ts":{"type":"string","format":"date-time","title":"Ts","description":"Timestamp right before the suggestion was generated"}},"type":"object","required":["explanation","generation_time_ms","ts"],"title":"AutosuggestionResponse","description":"Response containing a single autosuggestion."},"AvailableAssistant":{"properties":{"base_id":{"type":"string","title":"Base Id","description":"Base ID of the playbook"},"name":{"type":"string","title":"Name","description":"Name of the playbook"},"version_number":{"type":"integer","title":"Version Number","description":"Latest version number"},"has_user":{"type":"boolean","title":"Has User","description":"Whether a PlaybookUser exists for this playbook"}},"type":"object","required":["base_id","name","version_number","has_user"],"title":"AvailableAssistant","description":"A playbook available for campaign linking (has a PlaybookUser)."},"BasesSpaceAssign":{"properties":{"spaceId":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Spaceid"}},"type":"object","required":["spaceId"],"title":"BasesSpaceAssign"},"BasesSpaceProvision":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Name","description":"The space's label (the account's name by default); in Bases, its slug («Acme SA» → acme-sa)."}},"type":"object","title":"BasesSpaceProvision"},"BasesSpaceRegister":{"properties":{"spaceId":{"type":"string","maxLength":128,"minLength":1,"title":"Spaceid","description":"The Bases space id."},"token":{"type":"string","maxLength":256,"minLength":8,"title":"Token","description":"The space key (bst_…)."},"label":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Label","description":"What the panel calls the space."}},"type":"object","required":["spaceId","token"],"title":"BasesSpaceRegister"},"BodyField":{"properties":{"name":{"type":"string","title":"Name","description":"Field name in the JSON body"},"type":{"type":"string","title":"Type","description":"Field type: string, number, integer, boolean","default":"string"},"value":{"type":"string","title":"Value","description":"Hardcoded value or {{ template }} placeholder","default":""},"description":{"type":"string","title":"Description","description":"Hint for the LLM (only relevant for templated values)","default":""},"required":{"type":"boolean","title":"Required","description":"Whether this field is required","default":true}},"type":"object","required":["name"],"title":"BodyField","description":"Body field definition for an API tool (POST/PUT/PATCH).\n\nValue can be a hardcoded literal (e.g. \"false\", \"premium\") or a\n{{ template }} placeholder (e.g. \"{{ plan_number }}\").  When the value\ncontains a template, the description is shown to the LLM so it knows\nwhat to fill in.  Hardcoded values are sent as-is with no LLM input."},"Body_create_file_knowledgebase_projects__project_id__knowledgebases_file_post":{"properties":{"title":{"type":"string","title":"Title"},"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["title","file"],"title":"Body_create_file_knowledgebase_projects__project_id__knowledgebases_file_post"},"Body_upload_attachment_sami_v2_sessions__session_id__attachments_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_attachment_sami_v2_sessions__session_id__attachments_post"},"Body_upload_logo_account_management_accounts__account_id__logo_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_logo_account_management_accounts__account_id__logo_post"},"Body_upload_logo_accounts_logo_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_logo_accounts_logo_post"},"Body_upload_media_projects__project_id__media_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tags":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tags","description":"Comma-separated or JSON list"},"attributes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attributes","description":"JSON object, e.g. {\"location\": \"Colegiales\"}"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","description":"Language for AI-written fields (es/en/pt)"},"generate":{"type":"boolean","title":"Generate","description":"Write description and tags with AI, filling only empty fields","default":false}},"type":"object","required":["file"],"title":"Body_upload_media_projects__project_id__media_post"},"ButtonItem":{"properties":{"title":{"type":"string","title":"Title"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"action":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Action","description":"navigate/link action checked against the catalogue"},"short_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Title"},"exclude_channels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Exclude Channels"}},"additionalProperties":false,"type":"object","required":["title"],"title":"ButtonItem","description":"One button: a reply (title + stable value) or a navigate/link action (title + action, no value)."},"ButtonSet-Input":{"properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","title":"Id","description":"snake_case id, unique within the assistant. Instructions reference it as {{ buttons: id }}.","examples":["cobro_duplicado"]},"kind":{"type":"string","enum":["buttons","suggestions"],"title":"Kind","default":"buttons"},"prompt":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Prompt","description":"Default question shown with the buttons. The assistant may write its own each turn."},"layout":{"type":"string","enum":["auto","list"],"title":"Layout","description":"auto: up to 3 buttons, more become a list.","default":"auto"},"items":{"items":{"$ref":"#/components/schemas/ButtonSetItem"},"type":"array","maxItems":10,"minItems":1,"title":"Items"}},"additionalProperties":false,"type":"object","required":["id","items"],"title":"ButtonSet","description":"A predefined set of reply buttons, or of suggestion chips, the assistant offers by id."},"ButtonSet-Output":{"properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","title":"Id","description":"snake_case id, unique within the assistant. Instructions reference it as {{ buttons: id }}.","examples":["cobro_duplicado"]},"kind":{"type":"string","enum":["buttons","suggestions"],"title":"Kind","default":"buttons"},"prompt":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Prompt","description":"Default question shown with the buttons. The assistant may write its own each turn."},"layout":{"type":"string","enum":["auto","list"],"title":"Layout","description":"auto: up to 3 buttons, more become a list.","default":"auto"},"items":{"items":{"$ref":"#/components/schemas/ButtonSetItem"},"type":"array","maxItems":10,"minItems":1,"title":"Items"}},"additionalProperties":false,"type":"object","required":["id","items"],"title":"ButtonSet","description":"A predefined set of reply buttons, or of suggestion chips, the assistant offers by id."},"ButtonSetAction":{"properties":{"type":{"type":"string","enum":["navigate","link"],"title":"Type"},"destination":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","title":"Destination","examples":["activity_detail"]},"params":{"additionalProperties":{"type":"string"},"type":"object","title":"Params","description":"Destination params. A value is fixed text or a {placeholder} the assistant fills per turn (e.g. {'id': '{movement_id}'}). Never a URL or a path.","examples":[{"id":"{movement_id}"}]}},"additionalProperties":false,"type":"object","required":["type","destination"],"title":"ButtonSetAction","description":"Where a navigation item goes: a destination id from the inbox's Widget Studio catalogue."},"ButtonSetItem":{"properties":{"title":{"type":"string","maxLength":25,"minLength":1,"title":"Title","examples":["Desconocer el cobro"]},"short_title":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Short Title","description":"Used where the channel allows fewer characters (WhatsApp reply buttons: 20). Optional.","examples":["Desconocer"]},"value":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_.:-]{0,63}$"},{"type":"null"}],"title":"Value","description":"Stable reply value the assistant receives when this option is picked.","examples":["dispute"]},"action":{"anyOf":[{"$ref":"#/components/schemas/ButtonSetAction"},{"type":"null"}]},"exclude_channels":{"items":{"type":"string","enum":["web_widget","sdk","whatsapp","instagram","messenger","telegram","line","sms","email","api"]},"type":"array","title":"Exclude Channels","description":"Channels where this item is not offered (e.g. an item that opens the app, on WhatsApp)."}},"additionalProperties":false,"type":"object","required":["title"],"title":"ButtonSetItem","description":"One option: a reply (title + stable value) or a navigation (title + action)."},"ButtonsEventData":{"properties":{"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt","description":"Question shown with the buttons; None reuses the last message"},"layout":{"type":"string","enum":["auto","buttons","list"],"title":"Layout","default":"auto"},"items":{"items":{"$ref":"#/components/schemas/ButtonItem"},"type":"array","maxItems":10,"minItems":1,"title":"Items"},"suggestions":{"items":{"$ref":"#/components/schemas/SuggestionItem"},"type":"array","maxItems":6,"title":"Suggestions"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"The same question as a numbered text list, for a caller that shows the buttons differently (set by shape_buttons_events; None inside the agent loop)"},"set_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set Id","description":"The button set the items come from"},"suggestion_set_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggestion Set Id","description":"The suggestion set the chips come from"},"suggestions_only":{"type":"boolean","title":"Suggestions Only","description":"A suggestion set offered on its own: its chips are shown as the options","default":false}},"additionalProperties":false,"type":"object","required":["items"],"title":"ButtonsEventData","description":"Data for a reply-buttons event (Chatwoot input_select, protocol v1)."},"CSATAnalytics":{"properties":{"is_configured":{"type":"boolean","title":"Is Configured","description":"True when an Intercom CSAT config exists for this project"},"total_rated":{"type":"integer","title":"Total Rated","default":0},"csat_score_pct":{"type":"number","title":"Csat Score Pct","description":"% of rated convos with rating in {4, 5}","default":0.0},"dsat_score_pct":{"type":"number","title":"Dsat Score Pct","description":"% of rated convos with rating in {1, 2}","default":0.0},"eligible_deflected":{"type":"integer","title":"Eligible Deflected","default":0},"response_rate_pct":{"type":"number","title":"Response Rate Pct","default":0.0},"rating_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Rating Distribution"},"positive_count":{"type":"integer","title":"Positive Count","default":0},"neutral_count":{"type":"integer","title":"Neutral Count","default":0},"negative_count":{"type":"integer","title":"Negative Count","default":0},"time_series":{"items":{"$ref":"#/components/schemas/CSATTimeSeriesPoint"},"type":"array","title":"Time Series"},"time_granularity":{"type":"string","title":"Time Granularity","default":"day"},"ratings":{"items":{"$ref":"#/components/schemas/CSATRatingItem"},"type":"array","title":"Ratings"},"ratings_offset":{"type":"integer","title":"Ratings Offset","description":"Offset into total_rated that `ratings` starts at","default":0}},"type":"object","required":["is_configured"],"title":"CSATAnalytics","description":"Aggregate CSAT metrics for a project in a time window."},"CSATRatingItem":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"External conversation id (for linking to the detail view)"},"rating":{"type":"integer","title":"Rating"},"remark":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remark"},"rated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Rated At"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"first_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Message At"}},"type":"object","required":["conversation_id","rating"],"title":"CSATRatingItem"},"CSATTimeSeriesPoint":{"properties":{"date":{"type":"string","title":"Date","description":"Bucket label — ISO date (daily) or ISO hour (hourly)"},"total":{"type":"integer","title":"Total"},"positive":{"type":"integer","title":"Positive"},"neutral":{"type":"integer","title":"Neutral"},"negative":{"type":"integer","title":"Negative"},"csat_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Csat Pct","description":"% positive of total in the bucket (null when empty)"},"eligible":{"type":"integer","title":"Eligible","description":"Count of eligible deflected conversations in the bucket (denominator for response rate)","default":0},"response_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Response Rate Pct","description":"% of eligible convos that were rated in the bucket (null when eligible=0)"}},"type":"object","required":["date","total","positive","neutral","negative"],"title":"CSATTimeSeriesPoint"},"CampaignPlaybookResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Mapping ID"},"campaign_id":{"type":"integer","title":"Campaign Id","description":"Chatwoot campaign ID"},"campaign_name":{"type":"string","title":"Campaign Name","description":"Human-readable campaign name"},"playbook_base_id":{"type":"string","title":"Playbook Base Id","description":"Base ID of the linked playbook"},"playbook_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Name","description":"Name of the linked playbook"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the mapping was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When the mapping was last updated"}},"type":"object","required":["id","campaign_id","campaign_name","playbook_base_id","created_at","updated_at"],"title":"CampaignPlaybookResponse","description":"Response for a campaign-playbook mapping."},"CardSet-Input":{"properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","title":"Id","description":"snake_case id, unique within the assistant. Instructions reference it as {{ cards: id }}.","examples":["promos_cerca"]},"layout":{"type":"string","enum":["compact","tall","list"],"title":"Layout","description":"compact: small cards in a row; tall: big image cards in a row; list: rows.","default":"compact"},"prompt":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Prompt","description":"Default text shown with the cards. The assistant may write its own each turn."},"items":{"items":{"$ref":"#/components/schemas/CardSetItem"},"type":"array","maxItems":10,"minItems":1,"title":"Items"}},"additionalProperties":false,"type":"object","required":["id","items"],"title":"CardSet","description":"A predefined carousel the assistant offers by id (``{{ cards: id }}``)."},"CardSet-Output":{"properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","title":"Id","description":"snake_case id, unique within the assistant. Instructions reference it as {{ cards: id }}.","examples":["promos_cerca"]},"layout":{"type":"string","enum":["compact","tall","list"],"title":"Layout","description":"compact: small cards in a row; tall: big image cards in a row; list: rows.","default":"compact"},"prompt":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Prompt","description":"Default text shown with the cards. The assistant may write its own each turn."},"items":{"items":{"$ref":"#/components/schemas/CardSetItem"},"type":"array","maxItems":10,"minItems":1,"title":"Items"}},"additionalProperties":false,"type":"object","required":["id","items"],"title":"CardSet","description":"A predefined carousel the assistant offers by id (``{{ cards: id }}``)."},"CardSetAction":{"properties":{"type":{"type":"string","enum":["navigate","link"],"title":"Type"},"destination":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","title":"Destination","examples":["activity_detail"]},"params":{"additionalProperties":{"type":"string"},"type":"object","title":"Params","description":"Destination params. A value is fixed text or a {placeholder} the assistant fills per turn (e.g. {'id': '{movement_id}'}). Never a URL or a path.","examples":[{"id":"{movement_id}"}]},"text":{"type":"string","maxLength":20,"minLength":1,"title":"Text","examples":["Ver promo"]}},"additionalProperties":false,"type":"object","required":["type","destination","text"],"title":"CardSetAction","description":"A card button: ``navigate`` (an app screen) or ``link`` (a page), by catalogue id. Never a reply.\n\nSame destination and params rules as a button set's navigation item\n(:class:`ButtonSetAction`), plus the button's own ``text``. A ``link`` has no params."},"CardSetItem":{"properties":{"id":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{0,39}$"},{"type":"null"}],"title":"Id","description":"Optional stable id (Chatwoot kaption_id)."},"title":{"type":"string","maxLength":40,"minLength":1,"title":"Title","examples":["Café Norte"]},"description":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Description","examples":["Tope $3.000 · Lun a vie"]},"media_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Media Url","description":"https image URL (the Studio asset store or another public https host)."},"badge":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}],"title":"Badge","examples":["20% OFF"]},"actions":{"items":{"$ref":"#/components/schemas/CardSetAction"},"type":"array","maxItems":3,"title":"Actions"}},"additionalProperties":false,"type":"object","required":["title"],"title":"CardSetItem","description":"One card: image, title, optional subtitle and badge, and 0 to 3 navigate/link buttons."},"CardsEventData":{"properties":{"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt","description":"Text shown with the cards; None reuses the last message"},"layout":{"type":"string","enum":["compact","tall","list"],"title":"Layout","default":"compact"},"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":10,"minItems":1,"title":"Items","description":"Chatwoot cards items: {title, description?, media_url?, kaption_badge?, kaption_id?, actions}"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"The same cards as text, for a caller that shows them differently (set by shape_buttons_events; None inside the agent loop)"},"set_id":{"type":"string","title":"Set Id","description":"The card set the cards come from"}},"additionalProperties":false,"type":"object","required":["items","set_id"],"title":"CardsEventData","description":"Data for a carousel event (Chatwoot ``cards`` with a ``layout``; a card set, app/card_sets.py)."},"CaseCategory":{"type":"string","enum":["quality","delivery","billing","other"],"title":"CaseCategory"},"CaseResultBrief":{"properties":{"case_id":{"type":"string","title":"Case Id"},"case_name":{"type":"string","title":"Case Name"},"status":{"$ref":"#/components/schemas/EvalResultStatus"},"passed_assertions":{"type":"integer","title":"Passed Assertions","default":0},"total_assertions":{"type":"integer","title":"Total Assertions","default":0}},"type":"object","required":["case_id","case_name","status"],"title":"CaseResultBrief","description":"One case's outcome in the latest completed run."},"CaseRunHistoryItem":{"properties":{"run_id":{"type":"string","title":"Run Id"},"result_id":{"type":"string","title":"Result Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"status":{"$ref":"#/components/schemas/EvalResultStatus"},"passed_assertions":{"type":"integer","title":"Passed Assertions","default":0},"total_assertions":{"type":"integer","title":"Total Assertions","default":0},"trigger_source":{"anyOf":[{"$ref":"#/components/schemas/EvalTriggerSource"},{"type":"null"}]},"playbook_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Playbook Version"}},"type":"object","required":["run_id","result_id","created_at","status"],"title":"CaseRunHistoryItem","description":"One past execution of a single test case (newest first), for the editor's\n'recent runs' panel."},"CaseStatus":{"type":"string","enum":["open","resolved"],"title":"CaseStatus"},"ChangePasswordRequest":{"properties":{"current_password":{"type":"string","minLength":1,"title":"Current Password","description":"Current password"},"new_password":{"type":"string","minLength":8,"title":"New Password","description":"New password (min 8 characters)"}},"type":"object","required":["current_password","new_password"],"title":"ChangePasswordRequest","description":"Change password request body."},"ChannelAssistantRef":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"found":{"type":"boolean","title":"Found","description":"False when no playbook base with this id exists in the account"},"archived":{"type":"boolean","title":"Archived","description":"The playbook is soft-deleted","default":false},"active_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active Version","description":"Version currently active, if one is set"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id","description":"Project the playbook lives in"}},"type":"object","required":["found"],"title":"ChannelAssistantRef","description":"An inbox's playbook_id resolved against the account's playbooks."},"ChannelConfigResponse":{"properties":{"channel":{"$ref":"#/components/schemas/ChannelOut"},"config":{"additionalProperties":true,"type":"object","title":"Config","description":"The adapter's ConfigDocument, verbatim: `content` (the configuration as authored, comments and ${VAR} references intact), `effective` (after interpolation and defaults), `env` (which variables it references and whether the adapter has them — never a value), `source` and `redaction`."},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"}},"type":"object","required":["channel","config","fetched_at"],"title":"ChannelConfigResponse","description":"``GET /accounts/channels/{id}/config`` — the adapter's own configuration.\n\nThe document arrives **already redacted**, against the fields the adapter\ndeclared secret on its own config schema. The adapter is the only process\nthat holds the plaintext, so it is the only one that can guarantee removal —\nand the only one that knows which fields hold a secret in the first place.\nStudio Chat never receives one to hide. Nothing here is stored: it is\nfetched when a human asks for it."},"ChannelCreateRequest":{"properties":{"base_url":{"type":"string","title":"Base Url","description":"Adapter origin, e.g. https://takenos-proxy.onrender.com"}},"type":"object","required":["base_url"],"title":"ChannelCreateRequest","description":"Register an adapter. Its manifest is fetched (with CHANNEL_ADAPTER_TOKEN) before anything is saved."},"ChannelCreateResponse":{"properties":{"channel":{"$ref":"#/components/schemas/ChannelOut"},"manifest":{"additionalProperties":true,"type":"object","title":"Manifest","description":"The Manifest the registration was verified against"}},"type":"object","required":["channel","manifest"],"title":"ChannelCreateResponse"},"ChannelDeleteResponse":{"properties":{"id":{"type":"string","title":"Id"},"deleted":{"type":"boolean","title":"Deleted"},"teardown_run":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Teardown Run","description":"Multi-tenant channels only: the adapter's teardown SetupRun (kind 'teardown'), as it stood when the adapter accepted it. Informational — the channel is gone, so it cannot be polled through this API."},"teardown_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Teardown Error","description":"Multi-tenant channels only: why the adapter could not be asked to tear the tenant down. The channel and its API key were removed regardless; what setup created on the platform may still be there."}},"type":"object","required":["id","deleted"],"title":"ChannelDeleteResponse"},"ChannelDiscoverRequest":{"properties":{"base_url":{"type":"string","title":"Base Url"}},"type":"object","required":["base_url"],"title":"ChannelDiscoverRequest"},"ChannelDiscoverResponse":{"properties":{"base_url":{"type":"string","title":"Base Url","description":"The normalized origin that will be stored"},"protocol":{"type":"string","title":"Protocol"},"endpoints":{"items":{"type":"string"},"type":"array","title":"Endpoints"},"auth":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth"},"platform_token_configured":{"type":"boolean","title":"Platform Token Configured","description":"Whether the server has CHANNEL_ADAPTER_TOKEN; registration cannot succeed without it"}},"type":"object","required":["base_url","protocol","platform_token_configured"],"title":"ChannelDiscoverResponse","description":"What GET {base_url}/adapter/v1 said — for the add dialog to confirm 'this is an adapter' before pairing."},"ChannelListItem":{"properties":{"channel":{"$ref":"#/components/schemas/ChannelOut"},"manifest":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Manifest","description":"The adapter's Manifest, fetched live; null when it failed"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Why the manifest could not be fetched, when null"}},"type":"object","required":["channel"],"title":"ChannelListItem"},"ChannelListResponse":{"properties":{"channels":{"items":{"$ref":"#/components/schemas/ChannelListItem"},"type":"array","title":"Channels"}},"type":"object","required":["channels"],"title":"ChannelListResponse"},"ChannelManifestResponse":{"properties":{"channel":{"$ref":"#/components/schemas/ChannelOut"},"manifest":{"additionalProperties":true,"type":"object","title":"Manifest","description":"The adapter's Manifest document, verbatim"},"assistants":{"additionalProperties":{"$ref":"#/components/schemas/ChannelAssistantRef"},"type":"object","title":"Assistants","description":"Keyed by playbook_id, one entry per distinct inbox assistant"},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"}},"type":"object","required":["channel","manifest","fetched_at"],"title":"ChannelManifestResponse"},"ChannelOut":{"properties":{"id":{"type":"string","title":"Id"},"account_id":{"type":"string","title":"Account Id"},"base_url":{"type":"string","title":"Base Url","description":"Adapter origin (scheme + host); /adapter/v1 is appended by the backend"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"tenant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant","description":"The channel's tenant on a multi-tenant adapter (its root is /adapter/v1/t/{tenant}); null on a single-tenant adapter. Opaque, chosen by the adapter — for Rumo it is the Rumo account id."},"rumo":{"type":"boolean","title":"Rumo","description":"True for the channel served by the trusted Rumo bridge (RUMO_ADAPTER_URL): the one that has the /accounts/channels/{id}/rumo/{path} surface — inboxes and their routes.","default":false}},"type":"object","required":["id","account_id","base_url","created_at"],"title":"ChannelOut","description":"A registered channel adapter: the registration only. Everything else is fetched from the adapter."},"ChannelPatchRequest":{"properties":{"base_url":{"type":"string","title":"Base Url","description":"The adapter's new origin"},"verify":{"type":"boolean","title":"Verify","description":"Fetch the manifest at the new URL before saving. Turn off only for a move in progress, where the adapter is not answering there yet.","default":true}},"type":"object","required":["base_url"],"title":"ChannelPatchRequest","description":"Move a registration to a new URL keeping its id — and the config history hanging off it."},"ChannelSetupOption":{"properties":{"key":{"type":"string","title":"Key","description":"What to send back as `option` in POST /accounts/channels/setup","examples":["rumo"]},"label":{"type":"string","title":"Label","examples":["Rumo"]},"base_url":{"type":"string","title":"Base Url","description":"The multi-tenant adapter that serves it"},"adapter":{"$ref":"#/components/schemas/ChannelSetupOptionAdapter"},"params":{"items":{"$ref":"#/components/schemas/ChannelSetupParam"},"type":"array","title":"Params","description":"The connect form, in order"}},"type":"object","required":["key","label","base_url","adapter"],"title":"ChannelSetupOption","description":"A platform this server can connect as a channel through a guided setup, instead of by URL."},"ChannelSetupOptionAdapter":{"properties":{"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"}},"type":"object","title":"ChannelSetupOptionAdapter"},"ChannelSetupParam":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type","description":"string | integer | boolean","default":"string"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"help":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Help"},"required":{"type":"boolean","title":"Required","default":true},"secret":{"type":"boolean","title":"Secret","description":"Render masked. Never logged, never echoed.","default":false}},"type":"object","required":["name"],"title":"ChannelSetupParam","description":"One field of an adapter's connect form, exactly as the adapter declared it (SPEC §4.6)."},"ChannelSetupRequest":{"properties":{"option":{"type":"string","title":"Option","description":"A `key` from GET /accounts/channels/setup-options","examples":["rumo"]},"params":{"additionalProperties":true,"type":"object","title":"Params","description":"Values for the option's declared params, by name. Secret ones are forwarded once and never stored."},"takeover_native":{"type":"boolean","title":"Takeover Native","description":"Connect a Rumo account that already runs natively on Studio Chat, taking it over: from then on its native webhooks are ignored in every inbox, routed here or not, and this channel answers it. The native account itself (assistants, history) is not changed. Without it such a setup is refused with `rumo_account_native`.","default":false}},"type":"object","required":["option"],"title":"ChannelSetupRequest"},"ChannelSetupResponse":{"properties":{"channel":{"$ref":"#/components/schemas/ChannelOut"},"run":{"additionalProperties":true,"type":"object","title":"Run","description":"The adapter's SetupRun, verbatim. Poll it at /setup-runs/{run_id}."}},"type":"object","required":["channel","run"],"title":"ChannelSetupResponse"},"ChannelStatusResponse":{"properties":{"channel":{"$ref":"#/components/schemas/ChannelOut"},"status":{"additionalProperties":true,"type":"object","title":"Status","description":"The adapter's Status document, verbatim"},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"}},"type":"object","required":["channel","status","fetched_at"],"title":"ChannelStatusResponse"},"ChannelStoredConfigActivateRequest":{"properties":{"version":{"type":"integer","minimum":1.0,"title":"Version","description":"An existing version to point the adapter at (rollback or roll-forward)"}},"type":"object","required":["version"],"title":"ChannelStoredConfigActivateRequest"},"ChannelStoredConfigActivateResponse":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"active_version":{"type":"integer","title":"Active Version"},"sha256":{"type":"string","title":"Sha256"}},"type":"object","required":["channel_id","active_version","sha256"],"title":"ChannelStoredConfigActivateResponse"},"ChannelStoredConfigOut":{"properties":{"version":{"type":"integer","title":"Version"},"sha256":{"type":"string","title":"Sha256","description":"Of the YAML text; the ETag the adapter polls with"},"yaml":{"type":"string","title":"Yaml","description":"The configuration verbatim — comments, ordering and ${VAR} intact"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["version","sha256","yaml","created_by","created_at"],"title":"ChannelStoredConfigOut","description":"The stored (desired) configuration — what the adapter should be running.\n\nDistinct from GET /config, which is what the adapter says it *is* running."},"ChannelStoredConfigPutRequest":{"properties":{"yaml":{"type":"string","title":"Yaml","description":"The whole file. ${VAR} references only — never a secret value"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment","description":"What changed, shown in the version history"}},"type":"object","required":["yaml"],"title":"ChannelStoredConfigPutRequest"},"ChannelStoredConfigPutResponse":{"properties":{"version":{"type":"integer","title":"Version"},"sha256":{"type":"string","title":"Sha256"}},"type":"object","required":["version","sha256"],"title":"ChannelStoredConfigPutResponse"},"ChannelStoredConfigVersionRow":{"properties":{"version":{"type":"integer","title":"Version"},"sha256":{"type":"string","title":"Sha256"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"active":{"type":"boolean","title":"Active"}},"type":"object","required":["version","sha256","created_by","created_at","active"],"title":"ChannelStoredConfigVersionRow","description":"One row of the history — everything but the YAML itself."},"ChannelStoredConfigVersionsResponse":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"active_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active Version"},"versions":{"items":{"$ref":"#/components/schemas/ChannelStoredConfigVersionRow"},"type":"array","title":"Versions"}},"type":"object","required":["channel_id","active_version","versions"],"title":"ChannelStoredConfigVersionsResponse"},"ChannelSyncConfigResponse":{"properties":{"channel":{"$ref":"#/components/schemas/ChannelOut"},"result":{"additionalProperties":true,"type":"object","title":"Result","description":"The adapter's own config snapshot after the refresh — applied version and sha, or the exact reason the new YAML was refused (last_refresh_error)."},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"}},"type":"object","required":["channel","result","fetched_at"],"title":"ChannelSyncConfigResponse","description":"The adapter's answer to \"apply your stored config now\"."},"ChatSelection":{"properties":{"set_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Set Id","description":"Button set the menu came from (Rumo studio_chat_set_id), if any."},"value":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Value","description":"The option's value."},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"The option's title (what the customer saw)."},"menu_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Menu Id","description":"Rumo kaption_menu_id of the menu."},"message_id":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Message Id","description":"Rumo id of the menu message (input_select)."},"tap_message_id":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}],"title":"Tap Message Id","description":"Rumo id of the customer's tap message. Optional; when given, a retry of the same turn keeps the trusted value (the replay guard ties the menu to this message)."},"signature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signature","description":"Rumo's `v1=…` signature, when Rumo signed the tap."},"signed":{"type":"boolean","title":"Signed","description":"The bridge confirmed the tap against Rumo. Informational only.","default":false}},"type":"object","title":"ChatSelection","description":"A reply-button tap a bridge forwards with the turn (Rumo's ``kaption_selection``).\n\nLenient on purpose: a malformed tap must never become a 422 (a dropped\ncustomer message); anything that does not verify is just text."},"ChunkingConfig":{"properties":{"chunk_size":{"type":"integer","maximum":8192.0,"minimum":64.0,"title":"Chunk Size","description":"Max tokens per chunk (SentenceSplitter)","default":1024},"chunk_overlap":{"type":"integer","maximum":2048.0,"minimum":0.0,"title":"Chunk Overlap","description":"Token overlap between adjacent chunks","default":200}},"type":"object","title":"ChunkingConfig","description":"Per-KB INGEST-time chunking config. Unlike RetrievalConfig (query-time, swept per\nrequest), chunk size/overlap require re-ingesting to change — so each temporary eval KB\nencapsulates one chunking config, and the skill sweeps chunking by ingesting the same\ncorpus into several temp KBs with different values. Defaults match the historical splitter."},"CitationRef":{"properties":{"citation_id":{"type":"string","title":"Citation Id","description":"Unique citation ID (5-char alphanumeric like 'a3f2b') used in [[citation_id]] notation"},"kb_id":{"type":"string","title":"Kb Id","description":"Knowledge base ID - FE uses this to fetch KB details"},"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id","description":"Item ID within the KB - FE uses this to fetch item title"},"content":{"type":"string","title":"Content","description":"The snippet content for this citation"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name","description":"Source file name if applicable"}},"type":"object","required":["citation_id","kb_id","content"],"title":"CitationRef","description":"Citation reference with minimal data - FE fetches additional details (title, kb_name, kb_type).\n\nThe BE returns only the IDs and content needed to display citations.\nThe FE uses kb_id and item_id to fetch display details like title and KB metadata."},"ClientAnalyticsResponse":{"properties":{"name":{"type":"string","title":"Name"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","description":"Null if the priced name has no matching standalone account row yet."},"price_cents_per_resolved":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Cents Per Resolved","description":"Hardcoded price per billed conversation, in cents (see price_basis). Null for a client listed in UNPRICED_PANEL_CLIENTS."},"price_basis":{"type":"string","title":"Price Basis","description":"What the price is billed against: 'resolved' (per deflected conversation) or 'conversation' (per total conversation).","default":"resolved"},"days":{"type":"integer","title":"Days","description":"Number of days in the time series (always 14 today)."},"time_series":{"items":{"$ref":"#/components/schemas/ClientTimeSeriesPoint"},"type":"array","title":"Time Series"}},"type":"object","required":["name","price_cents_per_resolved","days","time_series"],"title":"ClientAnalyticsResponse"},"ClientAssistantSummary-Input":{"properties":{"base_id":{"type":"string","title":"Base Id"},"project_id":{"type":"string","title":"Project Id"},"name":{"type":"string","title":"Name"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"latest_version":{"type":"integer","title":"Latest Version"},"latest_playbook_id":{"type":"string","title":"Latest Playbook Id"},"active_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active Version"},"active_playbook_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Playbook Id"},"enabled_cases":{"type":"integer","title":"Enabled Cases"},"latest_check":{"anyOf":[{"$ref":"#/components/schemas/EvalRun"},{"type":"null"}],"description":"Most recent CI run for the latest version (None = never ran)."},"active_check":{"anyOf":[{"$ref":"#/components/schemas/EvalRun"},{"type":"null"}],"description":"Most recent CI run for the active version (None = never ran)."}},"type":"object","required":["base_id","project_id","name","latest_version","latest_playbook_id","enabled_cases"],"title":"ClientAssistantSummary"},"ClientAssistantSummary-Output":{"properties":{"base_id":{"type":"string","title":"Base Id"},"project_id":{"type":"string","title":"Project Id"},"name":{"type":"string","title":"Name"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"latest_version":{"type":"integer","title":"Latest Version"},"latest_playbook_id":{"type":"string","title":"Latest Playbook Id"},"active_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active Version"},"active_playbook_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Playbook Id"},"enabled_cases":{"type":"integer","title":"Enabled Cases"},"latest_check":{"anyOf":[{"$ref":"#/components/schemas/EvalRun"},{"type":"null"}],"description":"Most recent CI run for the latest version (None = never ran)."},"active_check":{"anyOf":[{"$ref":"#/components/schemas/EvalRun"},{"type":"null"}],"description":"Most recent CI run for the active version (None = never ran)."}},"type":"object","required":["base_id","project_id","name","latest_version","latest_playbook_id","enabled_cases"],"title":"ClientAssistantSummary"},"ClientAssistantsResponse":{"properties":{"name":{"type":"string","title":"Name"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"},"assistants":{"items":{"$ref":"#/components/schemas/ClientAssistantSummary-Output"},"type":"array","title":"Assistants"}},"type":"object","required":["name","account_id","assistants"],"title":"ClientAssistantsResponse"},"ClientBalanceResponse":{"properties":{"currency":{"type":"string","title":"Currency","description":"All amounts are USD.","default":"USD"},"balance_usd":{"type":"number","title":"Balance Usd","description":"total_credited_usd − total_billed_usd."},"total_credited_usd":{"type":"number","title":"Total Credited Usd","description":"Sum of all refills."},"total_billed_usd":{"type":"number","title":"Total Billed Usd","description":"All-time drawdown: metered_billed_usd + minimum_shortfall_usd."},"metered_billed_usd":{"type":"number","title":"Metered Billed Usd","description":"All-time metered drawdown: billed conversations × the account's rate.","default":0.0},"minimum_shortfall_usd":{"type":"number","title":"Minimum Shortfall Usd","description":"Total charged on top for closed months that came in under the monthly minimum.","default":0.0},"monthly_minimum_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Monthly Minimum Usd","description":"The account's full-month contractual minimum, or null when it has none."},"minimum_starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Minimum Starts On","description":"Day the minimum started applying."},"minimum_adjustments":{"items":{"$ref":"#/components/schemas/ClientMinimumAdjustment"},"type":"array","title":"Minimum Adjustments","description":"Closed months the minimum covered, newest first."},"price_cents_per_conversation":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Cents Per Conversation","description":"The account's per-conversation rate, in cents."},"price_basis":{"type":"string","title":"Price Basis","description":"What the rate bills against: 'resolved' (deflected/automated) | 'conversation' (total)."},"billed_conversations":{"type":"integer","title":"Billed Conversations","description":"All-time conversations counted toward the drawdown."},"has_rate":{"type":"boolean","title":"Has Rate","description":"False when no per-conversation rate is configured (drawdown is 0)."},"refills":{"items":{"$ref":"#/components/schemas/ClientRefill"},"type":"array","title":"Refills","description":"Ledger entries, newest first."},"monthly_usage":{"items":{"$ref":"#/components/schemas/ClientMonthlyUsage"},"type":"array","title":"Monthly Usage","description":"Billable consumption per month, newest first."}},"type":"object","required":["balance_usd","total_credited_usd","total_billed_usd","price_basis","billed_conversations","has_rate"],"title":"ClientBalanceResponse","description":"The current account's prepaid balance + auditable consumption detail."},"ClientCsatPeriod":{"properties":{"csat_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Csat Pct","description":"Headline CSAT % across the whole period (positive / total). Null when total_rated=0."},"total_rated":{"type":"integer","title":"Total Rated"},"positive":{"type":"integer","title":"Positive"},"neutral":{"type":"integer","title":"Neutral"},"negative":{"type":"integer","title":"Negative"},"time_series":{"items":{"$ref":"#/components/schemas/CsatTimeSeriesPoint"},"type":"array","title":"Time Series"}},"type":"object","required":["total_rated","positive","neutral","negative","time_series"],"title":"ClientCsatPeriod"},"ClientCsatResponse":{"properties":{"name":{"type":"string","title":"Name"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"},"days":{"type":"integer","title":"Days"},"current_window_start":{"type":"string","format":"date-time","title":"Current Window Start"},"current_window_end":{"type":"string","format":"date-time","title":"Current Window End"},"previous_window_start":{"type":"string","format":"date-time","title":"Previous Window Start"},"previous_window_end":{"type":"string","format":"date-time","title":"Previous Window End"},"current":{"$ref":"#/components/schemas/ClientCsatPeriod"},"previous":{"$ref":"#/components/schemas/ClientCsatPeriod"}},"type":"object","required":["name","days","current_window_start","current_window_end","previous_window_start","previous_window_end","current","previous"],"title":"ClientCsatResponse"},"ClientMinimumAdjustment":{"properties":{"month":{"type":"string","title":"Month","description":"Calendar month, 'YYYY-MM'."},"minimum_usd":{"type":"number","title":"Minimum Usd","description":"The floor in effect, prorated for a partial month."},"is_prorated":{"type":"boolean","title":"Is Prorated","description":"True when the floor was prorated by days."},"usage_usd":{"type":"number","title":"Usage Usd","description":"Metered consumption that month."},"shortfall_usd":{"type":"number","title":"Shortfall Usd","description":"max(0, minimum − usage) — charged to the balance."}},"type":"object","required":["month","minimum_usd","is_prorated","usage_usd","shortfall_usd"],"title":"ClientMinimumAdjustment","description":"A closed month where the monthly minimum applied."},"ClientMonthlyUsage":{"properties":{"month":{"type":"string","title":"Month","description":"Calendar month, 'YYYY-MM'."},"total_conversations":{"type":"integer","title":"Total Conversations","description":"Real conversations that month."},"billed_conversations":{"type":"integer","title":"Billed Conversations","description":"Conversations billed that month (per the account's basis)."},"billed_usd":{"type":"number","title":"Billed Usd","description":"billed_conversations × the account's rate."},"minimum_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Minimum Usd","description":"Monthly minimum in effect that month (prorated for a partial month); null when none."},"is_prorated_minimum":{"type":"boolean","title":"Is Prorated Minimum","description":"True when the minimum only covered part of the month and was prorated by days.","default":false},"shortfall_usd":{"type":"number","title":"Shortfall Usd","description":"max(0, minimum − billed_usd) — billed on top because usage came in under the floor. Always 0 for the month in progress.","default":0.0},"charged_usd":{"type":"number","title":"Charged Usd","description":"What the month costs: billed_usd + shortfall_usd.","default":0.0}},"type":"object","required":["month","total_conversations","billed_conversations","billed_usd"],"title":"ClientMonthlyUsage","description":"One calendar month of billable consumption, with the contractual\nminimum (if any) that applied to it."},"ClientRefill":{"properties":{"created_at":{"type":"string","title":"Created At","description":"ISO timestamp the refill was recorded."},"amount_usd":{"type":"number","title":"Amount Usd","description":"Refill amount in USD (negative for corrections)."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note","description":"Optional human note on the refill."}},"type":"object","required":["created_at","amount_usd"],"title":"ClientRefill","description":"One credit (refill) on the account's ledger, client-safe."},"ClientSkillProjectCredentials":{"properties":{"project_id":{"type":"string","title":"Project Id"},"project_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Name"},"api_token":{"type":"string","title":"Api Token","description":"Raw sandbox API key (sbs_ prefix)"}},"type":"object","required":["project_id","api_token"],"title":"ClientSkillProjectCredentials","description":"Skills credentials for a single project, mirroring the customer\nSkills settings page (`SandboxKeyResponse`) plus the project name so\nthe operator can tell projects apart when an account has more than\none."},"ClientSkillsCredentialsResponse":{"properties":{"name":{"type":"string","title":"Name"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","description":"Null if the priced name has no matching standalone account row yet."},"projects":{"items":{"$ref":"#/components/schemas/ClientSkillProjectCredentials"},"type":"array","title":"Projects"}},"type":"object","required":["name","projects"],"title":"ClientSkillsCredentialsResponse"},"ClientTimeSeriesPoint":{"properties":{"timestamp":{"type":"string","title":"Timestamp"},"total_conversations":{"type":"integer","title":"Total Conversations"},"conversations_with_handoff":{"type":"integer","title":"Conversations With Handoff"},"avg_response_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Response Latency Ms"},"min_response_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Response Latency Ms"},"max_response_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Response Latency Ms"},"p99_response_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P99 Response Latency Ms"}},"type":"object","required":["timestamp","total_conversations","conversations_with_handoff"],"title":"ClientTimeSeriesPoint","description":"One day in the client analytics time series. Shape mirrors the\ncustomer-facing `TimeSeriesPoint` so the existing\n`VolumeDeflectionChart` component on the FE can be reused as-is."},"ClientWindowMetrics":{"properties":{"total":{"type":"integer","title":"Total"},"resolved":{"type":"integer","title":"Resolved","description":"Conversations with has_handoff=False at read time."},"deflection_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Deflection Pct","description":"resolved / total * 100, null when total=0 (undefined)."}},"type":"object","required":["total","resolved"],"title":"ClientWindowMetrics"},"CloseEventData":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Why the assistant closed it, in its own words (<= 500 chars)"}},"additionalProperties":false,"type":"object","title":"CloseEventData","description":"Data for a close event: the assistant closed the conversation (app/agent/close_tool.py).\n\nOnly for a caller that said ``accepts_close``, always the turn's last event, never in\na turn that hands off. The caller decides what closing means on its channel."},"CloseProvisioningResponse":{"properties":{"closed":{"type":"integer","title":"Closed","description":"How many provisioning credentials were deactivated (0 if already closed)"}},"type":"object","required":["closed"],"title":"CloseProvisioningResponse"},"ConfidenceLevel":{"type":"string","enum":["HIGH","MEDIUM","LOW"],"title":"ConfidenceLevel","description":"Confidence level for autosuggestions."},"ContentSpan":{"properties":{"span_id":{"type":"string","title":"Span Id","description":"Unique identifier for this span"},"text":{"type":"string","title":"Text","description":"The text content of this span"},"start_char":{"type":"integer","title":"Start Char","description":"Start character position in the original content"},"end_char":{"type":"integer","title":"End Char","description":"End character position in the original content"}},"type":"object","required":["span_id","text","start_char","end_char"],"title":"ContentSpan","description":"A span of text within retrieved content with a unique ID for citation tracking."},"ContextKeySummary":{"properties":{"path":{"type":"string","title":"Path","description":"Dotted context path (context-pill grammar)"},"type":{"type":"string","title":"Type","description":"Majority type across the sample: string, number, boolean, url, list, object"},"coverage":{"type":"number","title":"Coverage","description":"Share of sampled conversations whose latest snapshot carries this key (0-1)"},"distinct":{"type":"integer","title":"Distinct","description":"Distinct scalar values seen in the sample"},"values":{"anyOf":[{"items":{"$ref":"#/components/schemas/ContextKeyValue"},"type":"array"},{"type":"null"}],"title":"Values","description":"Most frequent values with counts; null when the key is free text (too many distinct values)"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples","description":"Up to three example values, free-text keys included"},"declared_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Declared By","description":"Set when a channel declares this key on an inbox routed to this project (e.g. 'Rumo · Ventas'): the key is promised even before any conversation carried it. Coverage still counts what arrived."}},"type":"object","required":["path","type","coverage","distinct"],"title":"ContextKeySummary","description":"A key observed in an assistant's conversation context: how often it arrives and what it holds."},"ContextKeyValue":{"properties":{"value":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}],"title":"Value"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["value","count"],"title":"ContextKeyValue","description":"One observed value of a context key and how many sampled conversations carried it."},"ContextKeysResponse":{"properties":{"sample_size":{"type":"integer","title":"Sample Size","description":"Conversations in the sample that had a context snapshot"},"window_days":{"type":"integer","title":"Window Days","description":"How far back the sample reaches"},"keys":{"items":{"$ref":"#/components/schemas/ContextKeySummary"},"type":"array","title":"Keys","description":"Sorted by coverage desc, then path"}},"type":"object","required":["sample_size","window_days"],"title":"ContextKeysResponse","description":"What the conversation context of an assistant actually carries, over a recent sample."},"ConversationAnalytics":{"properties":{"total_conversations":{"type":"integer","title":"Total Conversations","description":"Total number of conversations"},"total_messages":{"type":"integer","title":"Total Messages","description":"Total number of messages across all conversations"},"conversations_with_handoff":{"type":"integer","title":"Conversations With Handoff","description":"Conversations that required human handoff"},"conversations_without_handoff":{"type":"integer","title":"Conversations Without Handoff","description":"Conversations resolved by AI"},"deflection_rate":{"type":"number","title":"Deflection Rate","description":"Percentage of conversations resolved without handoff (0-100)"},"avg_messages_per_conversation":{"type":"number","title":"Avg Messages Per Conversation","description":"Average messages per conversation"},"avg_response_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Response Latency Ms","description":"Average response latency in milliseconds"},"winback_sent_count":{"type":"integer","title":"Winback Sent Count","description":"Number of conversations where winback was sent","default":0},"winback_answered_count":{"type":"integer","title":"Winback Answered Count","description":"Number of conversations where user replied after winback","default":0},"winback_conversion_rate":{"type":"number","title":"Winback Conversion Rate","description":"Percentage of winbacks that got responses (0-100)","default":0.0},"by_playbook":{"items":{"$ref":"#/components/schemas/PlaybookAnalyticsMetrics"},"type":"array","title":"By Playbook","description":"Metrics grouped by playbook"},"by_tag":{"items":{"$ref":"#/components/schemas/TagAnalyticsMetrics"},"type":"array","title":"By Tag","description":"Metrics grouped by tag"},"time_series":{"items":{"$ref":"#/components/schemas/app__models__TimeSeriesPoint"},"type":"array","title":"Time Series","description":"Time series data"},"time_granularity":{"type":"string","title":"Time Granularity","description":"Time granularity: 'hour' or 'day'","default":"day"}},"type":"object","required":["total_conversations","total_messages","conversations_with_handoff","conversations_without_handoff","deflection_rate","avg_messages_per_conversation"],"title":"ConversationAnalytics","description":"Aggregated analytics for conversations."},"ConversationAttachmentExportRequest":{"properties":{"refs":{"items":{"type":"string"},"type":"array","maxItems":200,"minItems":1,"title":"Refs","description":"Refs from the manifest (max 200)."},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Name for the archive. '.zip' is appended if missing."},"format":{"type":"string","enum":["zip","file"],"title":"Format","description":"'zip' bundles the refs; 'file' serves a single attachment as itself (exactly one ref). A ZIP of one image is a worse answer than the image.","default":"zip"},"dry_run":{"type":"boolean","title":"Dry Run","description":"Describe the archive instead of building it. The MCP surface uses this: a JSON tool result cannot carry a ZIP, so the plan is what the agent gets and the bytes are delivered out of band.","default":false}},"type":"object","required":["refs"],"title":"ConversationAttachmentExportRequest","description":"The refs to zip, in the order they should appear."},"ConversationAttachmentManifestRequest":{"properties":{"conversation_ids":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":200},{"type":"null"}],"title":"Conversation Ids","description":"Conversation ids to inventory (max 200)."},"external_user_ids":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":200},{"type":"null"}],"title":"External User Ids","description":"End-user ids (the `user` the channel bound the conversation to). Covers every conversation of theirs."},"types":{"anyOf":[{"items":{"type":"string","enum":["image","document","audio"]},"type":"array"},{"type":"null"}],"title":"Types","description":"Attachment types to include. Default: all three."},"roles":{"anyOf":[{"items":{"type":"string","enum":["user","assistant"]},"type":"array"},{"type":"null"}],"title":"Roles","description":"Who sent it. Default: both. Pass ['user'] for what people uploaded."},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date","description":"ISO start of the window, on last_message_at. Inclusive."},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date","description":"ISO end of the window, on last_message_at. Exclusive."},"limit":{"anyOf":[{"type":"integer","maximum":2000.0,"minimum":1.0},{"type":"null"}],"title":"Limit","description":"Max rows to return (default and ceiling 2000)."}},"type":"object","title":"ConversationAttachmentManifestRequest","description":"Which conversations to inventory attachments for.\n\nOne of ``conversation_ids`` / ``external_user_ids`` is required: the query\nwalks messages whose JSON column holds the file itself, so an unscoped scan\nis not a slow answer, it is a way to read a project's whole media library."},"ConversationAttachmentManifestResponse":{"properties":{"attachments":{"items":{"$ref":"#/components/schemas/ConversationAttachmentRow"},"type":"array","title":"Attachments"},"total":{"type":"integer","title":"Total","description":"Rows matching the filters, before `limit`."},"returned":{"type":"integer","title":"Returned"},"truncated":{"type":"boolean","title":"Truncated","description":"True when `limit` cut the set. The rows kept are the MOST RECENT, not the first."},"conversations_scanned":{"type":"integer","title":"Conversations Scanned"},"conversations_capped":{"type":"boolean","title":"Conversations Capped","description":"True when the conversation set itself hit its 200 ceiling — narrow the ids or the window.","default":false}},"type":"object","required":["total","returned","truncated","conversations_scanned"],"title":"ConversationAttachmentManifestResponse","description":"The inventory: what is there, how big, and who sent it."},"ConversationAttachmentRow":{"properties":{"ref":{"type":"string","title":"Ref","description":"Opaque handle to pass to the export: conversation_id:message_index:index."},"conversation_id":{"type":"string","title":"Conversation Id"},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id"},"role":{"type":"string","title":"Role"},"type":{"type":"string","title":"Type"},"media_type":{"type":"string","title":"Media Type"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes","description":"Decoded size. Null when the channel stored a URL, not the file."},"downloadable":{"type":"boolean","title":"Downloadable","description":"False when there are no stored bytes — the export will skip it."},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"message_index":{"type":"integer","title":"Message Index"},"attachment_index":{"type":"integer","title":"Attachment Index"}},"type":"object","required":["ref","conversation_id","role","type","media_type","downloadable","message_index","attachment_index"],"title":"ConversationAttachmentRow","description":"One stored attachment, described without its bytes."},"ConversationBatchRequest":{"properties":{"conversation_ids":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Conversation Ids","description":"List of conversation IDs to fetch"}},"type":"object","required":["conversation_ids"],"title":"ConversationBatchRequest","description":"Request to fetch full detail for multiple conversations."},"ConversationBatchResponse":{"properties":{"conversations":{"items":{"$ref":"#/components/schemas/ConversationDetailResponse"},"type":"array","title":"Conversations"}},"type":"object","title":"ConversationBatchResponse","description":"Response containing full detail for multiple conversations."},"ConversationCSATInfo":{"properties":{"source":{"type":"string","title":"Source","description":"Originating system, e.g. 'intercom'"},"rating":{"type":"integer","title":"Rating","description":"Raw rating value as reported by the source (Intercom: 1-5)"},"remark":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remark"},"rated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Rated At","description":"When the end-user submitted the rating"},"fetched_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Fetched At"}},"type":"object","required":["source","rating"],"title":"ConversationCSATInfo","description":"CSAT rating imported from an external source (e.g. Intercom)."},"ConversationCost":{"properties":{"playbook_cost_usd":{"type":"number","title":"Playbook Cost Usd","description":"Playbook-agent LLM cost (ChatMessage.cost_usd sum)","default":0.0},"postprocessing_cost_usd":{"type":"number","title":"Postprocessing Cost Usd","description":"Conversation-metrics / scoring LLM cost (ConversationMetrics.cost_usd sum)","default":0.0},"eval_cost_usd":{"type":"number","title":"Eval Cost Usd","description":"Eval-only overhead cost (EvalRun.eval_overhead_cost_usd sum) — simulator + LLM-judge OpenRouter spend. Populated for account-level and per-playbook rows; 0 on dimensions where eval cost is not well-defined (tags, models, individual conversations).","default":0.0},"total_cost_usd":{"type":"number","title":"Total Cost Usd","description":"playbook_cost_usd + postprocessing_cost_usd + eval_cost_usd","default":0.0},"conversation_id":{"type":"string","title":"Conversation Id"},"project_name":{"type":"string","title":"Project Name"},"playbook_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Name"},"message_count":{"type":"integer","title":"Message Count"},"messages_with_cost":{"type":"integer","title":"Messages With Cost"},"total_input_tokens":{"type":"integer","title":"Total Input Tokens"},"total_output_tokens":{"type":"integer","title":"Total Output Tokens"},"total_llm_requests":{"type":"integer","title":"Total Llm Requests"},"total_tool_calls":{"type":"integer","title":"Total Tool Calls"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"first_message_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Message At"},"last_message_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message At"},"has_handoff":{"type":"boolean","title":"Has Handoff","default":false},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]}},"type":"object","required":["conversation_id","project_name","message_count","messages_with_cost","total_input_tokens","total_output_tokens","total_llm_requests","total_tool_calls"],"title":"ConversationCost"},"ConversationCostList":{"properties":{"conversations":{"items":{"$ref":"#/components/schemas/ConversationCost"},"type":"array","title":"Conversations"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["conversations","total","limit","offset"],"title":"ConversationCostList"},"ConversationDetailMessage-Input":{"properties":{"role":{"type":"string","title":"Role","description":"Message role: 'user', 'assistant', or 'tool'"},"content":{"type":"string","title":"Content","description":"Message content"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Timestamp when message was created"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Additional metadata (inbox_id, inbox_name, etc.)"},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCall"},"type":"array","title":"Tool Calls","description":"Tool calls made in this message (for assistant messages)"},"is_winback":{"type":"boolean","title":"Is Winback","description":"Whether this message is a winback follow-up message","default":false},"attachments":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array","title":"Attachments","description":"Attachments (images) included with this message"},"turn_index":{"type":"integer","title":"Turn Index","description":"Zero-based position of this turn among user + assistant raw turns. All expanded rows of a single raw assistant turn (multi-message V1/V2 payloads) share the same value — group bubbles by it and key turn-level actions (e.g. Improve Answer) off it."},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Per-message context dict sent with this (user) message at chat time. Null for messages that carried no context. Lets the UI show how context evolves across the conversation instead of only the latest snapshot."}},"type":"object","required":["role","content","turn_index"],"title":"ConversationDetailMessage","description":"A message with full detail — same as PlaybookConversationMessage (extensible)."},"ConversationDetailMessage-Output":{"properties":{"role":{"type":"string","title":"Role","description":"Message role: 'user', 'assistant', or 'tool'"},"content":{"type":"string","title":"Content","description":"Message content"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Timestamp when message was created"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Additional metadata (inbox_id, inbox_name, etc.)"},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCall"},"type":"array","title":"Tool Calls","description":"Tool calls made in this message (for assistant messages)"},"is_winback":{"type":"boolean","title":"Is Winback","description":"Whether this message is a winback follow-up message","default":false},"attachments":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array","title":"Attachments","description":"Attachments (images) included with this message"},"turn_index":{"type":"integer","title":"Turn Index","description":"Zero-based position of this turn among user + assistant raw turns. All expanded rows of a single raw assistant turn (multi-message V1/V2 payloads) share the same value — group bubbles by it and key turn-level actions (e.g. Improve Answer) off it."},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Per-message context dict sent with this (user) message at chat time. Null for messages that carried no context. Lets the UI show how context evolves across the conversation instead of only the latest snapshot."}},"type":"object","required":["role","content","turn_index"],"title":"ConversationDetailMessage","description":"A message with full detail — same as PlaybookConversationMessage (extensible)."},"ConversationDetailResponse":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id","description":"The user this conversation belongs to. Non-null means the chatlog can offer this person's other conversations — filter the list endpoint by the same value."},"external_organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Organization Id","description":"The organization this conversation belongs to. Non-null means the chatlog can offer the organization's other conversations — filter the list endpoint by the same value."},"inbox_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbox Id"},"inbox_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbox Name"},"playbook_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Id"},"playbook_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Name"},"playbook_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Playbook Version"},"playbook_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Playbook Ids","description":"All playbook IDs that participated (null for pre-migration)"},"playbooks_info":{"items":{"$ref":"#/components/schemas/PlaybookInfo"},"type":"array","title":"Playbooks Info","description":"Resolved info for all playbooks that participated"},"message_count":{"type":"integer","title":"Message Count","default":0},"first_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Message At"},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Message At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"has_handoff":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Handoff"},"has_error":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Error"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"skills":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Skills"},"avg_response_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Response Latency Ms"},"sentiment_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Label"},"sentiment_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Reason"},"resources_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resources Label"},"resources_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resources Reason"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"winback_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Winback Sent At"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"},"csat":{"anyOf":[{"$ref":"#/components/schemas/ConversationCSATInfo"},{"type":"null"}]},"messages":{"items":{"$ref":"#/components/schemas/ConversationDetailMessage-Output"},"type":"array","title":"Messages"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/CitationRef"},"type":"array"},{"type":"null"}],"title":"Citations"}},"type":"object","required":["conversation_id"],"title":"ConversationDetailResponse","description":"Full conversation detail: metadata + messages with usage + citations."},"ConversationEventModel":{"properties":{"event_type":{"type":"string","title":"Event Type","description":"Type of event: message, label, priority, note, handoff_agent, handoff_team, image, file, close","examples":["message"]},"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Event-specific data. Structure depends on event_type:\n- message: {content: str, private: bool}\n- label: {label: str}\n- priority: {priority: str}\n- note: {content: str}\n- handoff_agent: {agent_id: int}\n- handoff_team: {team_id: int}\n- image: {url: str, caption: str|null, media_type, filename, asset_id} — a library image to deliver\n- file: {url: str, kind: document|video|audio, caption, media_type, filename, asset_id} — only when the request's accepts_attachments lists that kind\n- close: {reason: str|null} — the assistant closed the conversation; only when the request's accepts_close is true, always the last event","examples":[{"content":"Thank you for contacting us! How can I help you today?","private":false}]}},"type":"object","required":["event_type","data"],"title":"ConversationEventModel","description":"A single event in a conversation (message, label, note, etc.)."},"ConversationHandoffRelease":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"released":{"type":"boolean","title":"Released","description":"True when there was a handoff time to clear."}},"type":"object","required":["conversation_id","released"],"title":"ConversationHandoffRelease","description":"What releasing a handoff did."},"ConversationHandoffStatus":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"exists":{"type":"boolean","title":"Exists"},"has_handoff":{"type":"boolean","title":"Has Handoff"},"handoff_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Handoff At","description":"When the handoff that holds the conversation was recorded (the latest one). Null when there was no handoff, when it predates this field, or once the channel released it."},"handoff_age_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Handoff Age Seconds","description":"Seconds since `handoff_at`, measured here so a channel compares it against its own pause length without trusting two clocks to agree. Null whenever `handoff_at` is."},"resumed":{"type":"boolean","title":"Resumed","description":"True when a section was opened after the latest handoff: the channel gave the conversation back to the assistant (with a recap) and it has not handed off since. `has_handoff` stays true either way.","default":false},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"}},"type":"object","required":["conversation_id","exists","has_handoff"],"title":"ConversationHandoffStatus","description":"Whether a channel conversation was already handed to a person, and when."},"ConversationListResponse":{"properties":{"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"ConversationListResponse"},"ConversationMessage":{"properties":{"role":{"type":"string","title":"Role","description":"Role: 'user' or 'assistant'"},"content":{"type":"string","title":"Content","description":"Message content"}},"type":"object","required":["role","content"],"title":"ConversationMessage","description":"A message in the conversation history."},"ConversationMessagesResponse":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/PlaybookConversationMessage-Output"},"type":"array","title":"Messages","description":"List of messages in chronological order"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/CitationRef"},"type":"array"},{"type":"null"}],"title":"Citations","description":"Citation references from KB search results in the conversation"},"always_loaded_skills":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Always Loaded Skills","description":"Skills whose content was preloaded in the system prompt for this conversation (always_load flag) — present in context without a load_skill event"},"pre_loaded_enrichments":{"anyOf":[{"items":{"$ref":"#/components/schemas/PreloadedEnrichment"},"type":"array"},{"type":"null"}],"title":"Pre Loaded Enrichments","description":"Enrichment API tool results preloaded into this conversation's context (enrichment_tool_ids) — present without an in-turn tool_call event"}},"type":"object","required":["messages"],"title":"ConversationMessagesResponse","description":"Response containing conversation messages with citations."},"ConversationMetricsResponse":{"properties":{"sentiment_label":{"type":"string","title":"Sentiment Label","description":"Customer sentiment: negative, neutral, or positive"},"sentiment_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Reason","description":"Explanation for sentiment score (in conversation language)"},"resources_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resources Label","description":"KB/tools effectiveness: irrelevant, partial, or relevant (null if no tools used)"},"resources_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resources Reason","description":"Explanation for resources score (in conversation language)"},"summary":{"type":"string","title":"Summary","description":"Brief summary of the conversation (in the conversation's language)"},"user_intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Intent","description":"What the user wanted to accomplish (free text)"},"sentiment_shift":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Shift","description":"How sentiment changed: improved, stable, degraded"},"sentiment_shift_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Shift Reason","description":"Explanation of sentiment shift"},"deflection_quality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deflection Quality","description":"Deflection quality (non-handoff): resolved, actioned, partial, no_response"},"deflection_quality_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deflection Quality Reason","description":"Explanation of deflection quality"},"handoff_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handoff Reason","description":"Handoff reason: policy, user_request, frustration, bot_limitation"},"handoff_reason_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handoff Reason Detail","description":"Explanation of handoff reason"},"recontact_risk":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recontact Risk","description":"Recontact risk: low, medium, high"},"recontact_risk_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recontact Risk Reason","description":"Explanation of recontact risk"},"scored_at":{"type":"string","format":"date-time","title":"Scored At","description":"When the metrics were computed"},"message_count_at_scoring":{"type":"integer","title":"Message Count At Scoring","description":"Number of messages when scored"},"input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Input Tokens","description":"Prompt tokens consumed by the scoring LLM call. ``None`` for rows scored before cost tracking was added or when the provider did not report usage."},"output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Output Tokens","description":"Completion tokens emitted by the scoring LLM call. ``None`` if usage unavailable."},"cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Usd","description":"Provider-reported USD cost of the scoring LLM call (from OpenRouter ``usage.cost``). ``None`` for legacy rows or when the provider does not report cost."}},"type":"object","required":["sentiment_label","summary","scored_at","message_count_at_scoring"],"title":"ConversationMetricsResponse","description":"Quality metrics for a single conversation.\n\nAll metrics are discrete categories (not numeric scores) for better\nLLM classification consistency and easier interpretation.\n\nMetrics are tailored for Studio Chat:\n- Sentiment: Customer emotional state (always present)\n- Resources: Were KB/tools useful (only if tool calls were used)"},"ConversationSummariesResponse":{"properties":{"summaries":{"items":{"$ref":"#/components/schemas/ConversationSummaryItem"},"type":"array","title":"Summaries","description":"List of conversation summaries"},"total":{"type":"integer","title":"Total","description":"Total number of conversations matching filters"},"limit":{"type":"integer","title":"Limit","description":"Maximum number returned"},"offset":{"type":"integer","title":"Offset","description":"Number skipped"}},"type":"object","required":["summaries","total","limit","offset"],"title":"ConversationSummariesResponse","description":"Response for listing conversation summaries with pagination."},"ConversationSummaryItem":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"sentiment_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Label"},"resources_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resources Label"},"first_user_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First User Message"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"has_handoff":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Handoff"},"message_count":{"type":"integer","title":"Message Count","default":0},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Message At"},"skills":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Skills"},"user_intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Intent"},"sentiment_shift":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Shift"},"deflection_quality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deflection Quality"},"handoff_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handoff Reason"},"recontact_risk":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recontact Risk"}},"type":"object","required":["conversation_id"],"title":"ConversationSummaryItem","description":"Lightweight conversation summary for batch scanning."},"ConversationTaskResponse":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"task":{"anyOf":[{"$ref":"#/components/schemas/TaskEvaluation"},{"type":"null"}],"description":"Null when the conversation has no task assigned."},"inputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Inputs","description":"What the live run was assigned with — the task's per-conversation parameters. Null when there is no task, when it has finished, or when the assignment carried none."},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"What the assistant wrote to start the task — only on an assignment with `start_now`."},"delivered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Delivered","description":"Whether the channel confirmed delivery of `message`. Null when the assignment did not ask for `start_now`, or when it changed nothing (the task was already running). False leaves the task assigned: the customer's next message still carries it."}},"type":"object","required":["conversation_id"],"title":"ConversationTaskResponse","description":"The task a conversation is pursuing, and how it is going."},"ConversationWatchRecord":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status","description":"pending | completed | expired | error | cancelled"},"values":{"additionalProperties":true,"type":"object","title":"Values","description":"The parameters the assistant scheduled it with"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"next_check_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Check At"},"closed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Closed At"},"close_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Close Reason"},"event_delivered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Event Delivered","description":"null = the assistant chose to say nothing"},"checks":{"items":{"$ref":"#/components/schemas/WatchCheckRecord"},"type":"array","title":"Checks"}},"type":"object","required":["id","name","status","expires_at","created_at"],"title":"ConversationWatchRecord","description":"A watch scheduled on a conversation, with every check it made. The\ndefinition it runs (instructions, cadence, on_resolve) is the assistant's\n``watches`` entry of that name."},"ConversationWatchesResponse":{"properties":{"watches":{"items":{"$ref":"#/components/schemas/ConversationWatchRecord"},"type":"array","title":"Watches"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["watches","total"],"title":"ConversationWatchesResponse"},"ConversionAnalytics":{"properties":{"is_configured":{"type":"boolean","title":"Is Configured","description":"True iff the definition exists for this project."},"definition":{"anyOf":[{"$ref":"#/components/schemas/ConversionMetricDefinitionResponse"},{"type":"null"}]},"total_events":{"type":"integer","title":"Total Events","default":0},"total_value":{"type":"number","title":"Total Value","default":0.0},"avg_value":{"type":"number","title":"Avg Value","default":0.0},"converting_conversations":{"type":"integer","title":"Converting Conversations","description":"Distinct conversations with at least one event in window.","default":0},"eligible_conversations":{"type":"integer","title":"Eligible Conversations","description":"Deflected conversations with last_message_at in window — denominator for conversion_rate.","default":0},"conversion_rate_pct":{"type":"number","title":"Conversion Rate Pct","default":0.0},"avg_value_per_conversation":{"type":"number","title":"Avg Value Per Conversation","default":0.0},"time_granularity":{"type":"string","title":"Time Granularity","default":"day"},"time_series":{"items":{"$ref":"#/components/schemas/ConversionTimeSeriesPoint"},"type":"array","title":"Time Series"},"events":{"items":{"$ref":"#/components/schemas/ConversionEventItem"},"type":"array","title":"Events"},"events_offset":{"type":"integer","title":"Events Offset","default":0},"total_events_filtered":{"type":"integer","title":"Total Events Filtered","default":0}},"type":"object","required":["is_configured"],"title":"ConversionAnalytics","description":"Aggregate payload for the conversion-metric dashboard."},"ConversionEventBatchIngest":{"properties":{"events":{"items":{"$ref":"#/components/schemas/ConversionEventIngest"},"type":"array","maxItems":500,"minItems":1,"title":"Events"}},"type":"object","required":["events"],"title":"ConversionEventBatchIngest"},"ConversionEventIngest":{"properties":{"match_value":{"type":"string","maxLength":255,"minLength":1,"title":"Match Value","description":"Platform conversation id (must match playbook_conversations.conversation_id)."},"idempotency_key":{"type":"string","maxLength":255,"minLength":1,"title":"Idempotency Key","description":"Stable identifier of the underlying event (e.g. 'purchase:<uuid>'). Re-posting the same key upserts in place."},"value":{"type":"number","title":"Value","description":"Numeric value (e.g. amount in USD)."},"occurred_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Occurred At","description":"When the event happened (UTC). Defaults to ingest time when omitted."},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Arbitrary key/value metadata persisted alongside the event (free-form JSON)."}},"type":"object","required":["match_value","idempotency_key","value"],"title":"ConversionEventIngest","description":"Single conversion event payload."},"ConversionEventIngestResult":{"properties":{"idempotency_key":{"type":"string","title":"Idempotency Key"},"upserted":{"type":"boolean","title":"Upserted","description":"True if the row was inserted or refreshed."}},"type":"object","required":["idempotency_key","upserted"],"title":"ConversionEventIngestResult"},"ConversionEventItem":{"properties":{"id":{"type":"integer","title":"Id"},"conversation_id":{"type":"string","title":"Conversation Id","description":"External conversation id (always set — ingest rejects unmatched)."},"match_value":{"type":"string","title":"Match Value"},"idempotency_key":{"type":"string","title":"Idempotency Key"},"value":{"type":"number","title":"Value"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"}},"type":"object","required":["id","conversation_id","match_value","idempotency_key","value","occurred_at"],"title":"ConversionEventItem"},"ConversionIngestResponse":{"properties":{"accepted":{"type":"integer","title":"Accepted"},"upserted":{"type":"integer","title":"Upserted"},"results":{"items":{"$ref":"#/components/schemas/ConversionEventIngestResult"},"type":"array","title":"Results"}},"type":"object","required":["accepted","upserted"],"title":"ConversionIngestResponse"},"ConversionMetricDefinitionCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Human label, e.g. 'Venta'"},"slug":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Slug","description":"URL slug; if omitted, derived from `name`. Lowercase + hyphens only, unique per project."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description shown in the FE"},"value_label":{"type":"string","maxLength":32,"title":"Value Label","description":"Unit label rendered in the panel (e.g. USD, ARS)","default":"USD"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["name"],"title":"ConversionMetricDefinitionCreate","description":"Input payload to create a new conversion metric for a project."},"ConversionMetricDefinitionResponse":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"value_label":{"type":"string","title":"Value Label"},"enabled":{"type":"boolean","title":"Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"ingest_url_path":{"type":"string","title":"Ingest Url Path","description":"Relative path the caller should POST events to (the FE prepends the API host)."},"last_event_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Event At","description":"Timestamp of the most recent event ingested for this metric (MAX(events.created_at)). Null when no events have been received yet. The FE renders this as 'last event 6h ago' so operators can spot broken integrations at a glance."}},"type":"object","required":["id","project_id","slug","name","value_label","enabled","created_at","updated_at","ingest_url_path"],"title":"ConversionMetricDefinitionResponse"},"ConversionMetricDefinitionUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"value_label":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Value Label"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"ConversionMetricDefinitionUpdate"},"ConversionTimeSeriesPoint":{"properties":{"date":{"type":"string","title":"Date"},"event_count":{"type":"integer","title":"Event Count","default":0},"total_value":{"type":"number","title":"Total Value","default":0.0},"converting_conversations":{"type":"integer","title":"Converting Conversations","default":0}},"type":"object","required":["date"],"title":"ConversionTimeSeriesPoint"},"CopilotChatRequest":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"Unique conversation identifier"},"user_message":{"type":"string","title":"User Message","description":"User's message (can be empty if attachments provided)"},"kb_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Kb Ids","description":"Optional: KB IDs from @ mentions to search"},"tool_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tool Ids","description":"Optional: Tool IDs from @ mentions to use"},"conversation_context":{"anyOf":[{"items":{"$ref":"#/components/schemas/CopilotConversationContextMessage"},"type":"array"},{"type":"null"}],"title":"Conversation Context","description":"Optional: Chatwoot conversation messages to provide context for the copilot"},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array"},{"type":"null"}],"title":"Attachments","description":"Optional: Image or file attachments to include with the message"}},"type":"object","required":["conversation_id","user_message"],"title":"CopilotChatRequest","description":"Request model for Copilot chat."},"CopilotChatResponse":{"properties":{"messages":{"items":{"type":"string"},"type":"array","title":"Messages","description":"Response messages to the CX agent (each becomes a chat bubble)"},"suggested_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Message","description":"Optional ready-to-send message for the customer"},"explanation":{"type":"string","title":"Explanation","description":"Brief explanation of reasoning"},"elapsed_time_ms":{"type":"integer","title":"Elapsed Time Ms","description":"Time taken to generate response"},"tool_calls":{"anyOf":[{"items":{"$ref":"#/components/schemas/CopilotToolCall"},"type":"array"},{"type":"null"}],"title":"Tool Calls","description":"Tool calls made during response"}},"type":"object","required":["messages","explanation","elapsed_time_ms"],"title":"CopilotChatResponse","description":"Response model for Copilot chat - simplified output."},"CopilotConversation":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"Unique conversation identifier"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Conversation title (first user message)"},"message_count":{"type":"integer","title":"Message Count","description":"Number of messages","default":0},"first_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Message At","description":"First message timestamp"},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Message At","description":"Last message timestamp"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the conversation was created"}},"type":"object","required":["conversation_id"],"title":"CopilotConversation","description":"Copilot conversation metadata for sidebar display."},"CopilotConversationContextMessage":{"properties":{"role":{"type":"string","title":"Role","description":"Message role (user/assistant)"},"content":{"type":"string","title":"Content","description":"Message content"},"sender_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Type","description":"Sender type (User/Contact/Agent)"}},"type":"object","required":["role","content"],"title":"CopilotConversationContextMessage","description":"A message from the Chatwoot conversation for copilot context."},"CopilotConversationsResponse":{"properties":{"conversations":{"items":{"$ref":"#/components/schemas/CopilotConversation"},"type":"array","title":"Conversations","description":"List of conversations"},"total":{"type":"integer","title":"Total","description":"Total number of conversations"}},"type":"object","required":["conversations","total"],"title":"CopilotConversationsResponse","description":"Response model for listing Copilot conversations."},"CopilotMessage-Input":{"properties":{"id":{"type":"string","title":"Id","description":"Message ID"},"role":{"type":"string","title":"Role","description":"Message role (user/assistant)"},"content":{"type":"string","title":"Content","description":"Message content"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the message was created"},"explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation","description":"Explanation for assistant messages"},"tool_calls":{"anyOf":[{"items":{"$ref":"#/components/schemas/CopilotToolCall"},"type":"array"},{"type":"null"}],"title":"Tool Calls","description":"Tool calls for assistant messages"},"suggested_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Message","description":"Suggested message to send to customer"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/CitationRef"},"type":"array"},{"type":"null"}],"title":"Citations","description":"Citation references from KB search results"},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array"},{"type":"null"}],"title":"Attachments","description":"Attachments (images) sent with the message"}},"type":"object","required":["id","role","content"],"title":"CopilotMessage","description":"Message in a Copilot conversation."},"CopilotMessage-Output":{"properties":{"id":{"type":"string","title":"Id","description":"Message ID"},"role":{"type":"string","title":"Role","description":"Message role (user/assistant)"},"content":{"type":"string","title":"Content","description":"Message content"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the message was created"},"explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation","description":"Explanation for assistant messages"},"tool_calls":{"anyOf":[{"items":{"$ref":"#/components/schemas/CopilotToolCall"},"type":"array"},{"type":"null"}],"title":"Tool Calls","description":"Tool calls for assistant messages"},"suggested_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Message","description":"Suggested message to send to customer"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/CitationRef"},"type":"array"},{"type":"null"}],"title":"Citations","description":"Citation references from KB search results"},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array"},{"type":"null"}],"title":"Attachments","description":"Attachments (images) sent with the message"}},"type":"object","required":["id","role","content"],"title":"CopilotMessage","description":"Message in a Copilot conversation."},"CopilotToolCall":{"properties":{"id":{"type":"string","title":"Id","description":"Tool call ID"},"name":{"type":"string","title":"Name","description":"Tool name"},"arguments":{"type":"string","title":"Arguments","description":"Tool arguments (JSON string)"},"result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result","description":"Tool result"},"tool_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Type","description":"Type of tool (kb_search, custom, etc.)"},"enhanced_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Enhanced Params","description":"Enhanced parameters for display (e.g., KB names, structured results)"}},"type":"object","required":["id","name","arguments"],"title":"CopilotToolCall","description":"Tool call information for Copilot responses."},"CorrectionLogEntry":{"properties":{"kb_id":{"type":"string","title":"Kb Id"},"kb_title":{"type":"string","title":"Kb Title"},"kb_type":{"type":"string","title":"Kb Type"},"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id"},"item_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Title"},"text":{"type":"string","title":"Text"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["kb_id","kb_title","kb_type","text","created_at"],"title":"CorrectionLogEntry","description":"A single correction note, flattened with its KB / item context.\n\nUsed by the correction-log feed on the KB dashboard. `item_id` / `item_title`\nare null for KB-level notes (TEXT / FILE KBs)."},"CostSummary":{"properties":{"playbook_cost_usd":{"type":"number","title":"Playbook Cost Usd","description":"Playbook-agent LLM cost (ChatMessage.cost_usd sum)","default":0.0},"postprocessing_cost_usd":{"type":"number","title":"Postprocessing Cost Usd","description":"Conversation-metrics / scoring LLM cost (ConversationMetrics.cost_usd sum)","default":0.0},"eval_cost_usd":{"type":"number","title":"Eval Cost Usd","description":"Eval-only overhead cost (EvalRun.eval_overhead_cost_usd sum) — simulator + LLM-judge OpenRouter spend. Populated for account-level and per-playbook rows; 0 on dimensions where eval cost is not well-defined (tags, models, individual conversations).","default":0.0},"total_cost_usd":{"type":"number","title":"Total Cost Usd","description":"playbook_cost_usd + postprocessing_cost_usd + eval_cost_usd","default":0.0},"account_name":{"type":"string","title":"Account Name"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"total_input_tokens":{"type":"integer","title":"Total Input Tokens"},"total_output_tokens":{"type":"integer","title":"Total Output Tokens"},"total_cache_read_tokens":{"type":"integer","title":"Total Cache Read Tokens"},"total_cache_write_tokens":{"type":"integer","title":"Total Cache Write Tokens"},"total_tokens":{"type":"integer","title":"Total Tokens","description":"input + output tokens combined"},"total_messages":{"type":"integer","title":"Total Messages","description":"Messages with cost data"},"total_conversations":{"type":"integer","title":"Total Conversations"},"total_llm_requests":{"type":"integer","title":"Total Llm Requests"},"total_tool_calls":{"type":"integer","title":"Total Tool Calls"},"avg_cost_per_conversation":{"type":"number","title":"Avg Cost Per Conversation"},"avg_cost_per_message":{"type":"number","title":"Avg Cost Per Message"},"avg_tokens_per_conversation":{"type":"number","title":"Avg Tokens Per Conversation"}},"type":"object","required":["account_name","total_input_tokens","total_output_tokens","total_cache_read_tokens","total_cache_write_tokens","total_tokens","total_messages","total_conversations","total_llm_requests","total_tool_calls","avg_cost_per_conversation","avg_cost_per_message","avg_tokens_per_conversation"],"title":"CostSummary"},"CostTimeSeries":{"properties":{"account_name":{"type":"string","title":"Account Name"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"granularity":{"type":"string","title":"Granularity"},"buckets":{"items":{"$ref":"#/components/schemas/TimeBucket"},"type":"array","title":"Buckets"}},"type":"object","required":["account_name","granularity","buckets"],"title":"CostTimeSeries"},"CostsOverviewResponse":{"properties":{"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"granularity":{"type":"string","title":"Granularity"},"kpis":{"$ref":"#/components/schemas/OverviewKpis"},"by_source":{"items":{"$ref":"#/components/schemas/SourceBreakdownRow"},"type":"array","title":"By Source"},"series":{"items":{"$ref":"#/components/schemas/SeriesBucket"},"type":"array","title":"Series"},"by_model":{"items":{"$ref":"#/components/schemas/ModelBreakdownRow"},"type":"array","title":"By Model"},"by_account":{"items":{"$ref":"#/components/schemas/AccountBreakdownRow"},"type":"array","title":"By Account"}},"type":"object","required":["start_date","end_date","granularity","kpis","by_source","series","by_model","by_account"],"title":"CostsOverviewResponse"},"CoverageCategory-Input":{"properties":{"category":{"type":"string","title":"Category","description":"Category key: tools|skills|knowledge_bases|handoff|tags|priority|private_notes"},"label":{"type":"string","title":"Label","description":"Human-readable category label"},"measurable":{"type":"boolean","title":"Measurable","description":"Whether this category counts toward the overall coverage %. Behavioral/unbounded categories (handoff, tags, KBs, …) are informational and excluded to avoid false penalties."},"total":{"type":"integer","title":"Total","description":"Number of configured elements in this category"},"covered":{"type":"integer","title":"Covered","description":"Number of covered elements"},"items":{"items":{"$ref":"#/components/schemas/CoverageItem-Input"},"type":"array","title":"Items","description":"Per-element coverage"}},"type":"object","required":["category","label","measurable","total","covered"],"title":"CoverageCategory","description":"A group of related capabilities (tools, skills, handoff, …)."},"CoverageCategory-Output":{"properties":{"category":{"type":"string","title":"Category","description":"Category key: tools|skills|knowledge_bases|handoff|tags|priority|private_notes"},"label":{"type":"string","title":"Label","description":"Human-readable category label"},"measurable":{"type":"boolean","title":"Measurable","description":"Whether this category counts toward the overall coverage %. Behavioral/unbounded categories (handoff, tags, KBs, …) are informational and excluded to avoid false penalties."},"total":{"type":"integer","title":"Total","description":"Number of configured elements in this category"},"covered":{"type":"integer","title":"Covered","description":"Number of covered elements"},"items":{"items":{"$ref":"#/components/schemas/CoverageItem-Output"},"type":"array","title":"Items","description":"Per-element coverage"}},"type":"object","required":["category","label","measurable","total","covered"],"title":"CoverageCategory","description":"A group of related capabilities (tools, skills, handoff, …)."},"CoverageItem-Input":{"properties":{"key":{"type":"string","title":"Key","description":"Stable identifier (tool short_name, skill name, kb id, capability key)"},"label":{"type":"string","title":"Label","description":"Human-readable label for display"},"covered":{"type":"boolean","title":"Covered","description":"Whether at least one case/run exercises this element"},"covered_by":{"anyOf":[{"type":"string","enum":["static","executed","both"]},{"type":"null"}],"title":"Covered By","description":"How it's covered: 'static' = referenced by a case assertion/mock; 'executed' = observed in a run's tool_calls/events; 'both'. None when uncovered."},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail","description":"Optional extra context (toolkit slug, 'enrichment', etc.)"},"tests":{"items":{"$ref":"#/components/schemas/CoverageTest"},"type":"array","title":"Tests","description":"Test cases that exercise this element (currently populated for skills), with run status."}},"type":"object","required":["key","label","covered"],"title":"CoverageItem","description":"A single configured capability and whether the eval suite exercises it."},"CoverageItem-Output":{"properties":{"key":{"type":"string","title":"Key","description":"Stable identifier (tool short_name, skill name, kb id, capability key)"},"label":{"type":"string","title":"Label","description":"Human-readable label for display"},"covered":{"type":"boolean","title":"Covered","description":"Whether at least one case/run exercises this element"},"covered_by":{"anyOf":[{"type":"string","enum":["static","executed","both"]},{"type":"null"}],"title":"Covered By","description":"How it's covered: 'static' = referenced by a case assertion/mock; 'executed' = observed in a run's tool_calls/events; 'both'. None when uncovered."},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail","description":"Optional extra context (toolkit slug, 'enrichment', etc.)"},"tests":{"items":{"$ref":"#/components/schemas/CoverageTest"},"type":"array","title":"Tests","description":"Test cases that exercise this element (currently populated for skills), with run status."}},"type":"object","required":["key","label","covered"],"title":"CoverageItem","description":"A single configured capability and whether the eval suite exercises it."},"CoverageTest":{"properties":{"case_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Case Id"},"case_name":{"type":"string","title":"Case Name"},"status":{"$ref":"#/components/schemas/EvalResultStatus","description":"passed | failed | error in the latest completed run"}},"type":"object","required":["case_name","status"],"title":"CoverageTest","description":"A test case that exercises a coverage element, with its latest-run status."},"CreateAccountRequest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Account name, a slug: lowercase letters, digits and single hyphens (e.g. 'acme-corp'). Anything else is rejected with the slug to send instead; the default project takes the same name."},"admin_email":{"type":"string","title":"Admin Email","description":"Email address for the admin user (used as login username)"},"send_email":{"type":"boolean","title":"Send Email","description":"Send welcome email with credentials to the admin user","default":false},"credentials":{"items":{"type":"string","enum":["rest","mcp"]},"type":"array","title":"Credentials","description":"Which forms of the provisioning credential to hand back: 'rest' is the sbs_ project key, 'mcp' is a bearer token for the tenant MCP server. Ask only for what you will use — a credential that skips the approval queue should not exist where nobody holds it. Both share one window and one kill switch."},"demo":{"type":"boolean","title":"Demo","description":"This account is being built to show someone, not to serve a customer: turn on the public demo pages so every assistant in it is reachable at a shareable link the moment it is activated. Without this the links exist but answer 'not available', because the 'public_demos' feature flag is off for every account by default and turning it on later needs a superadmin. It also turns on what a demo needs to show the product: the media library (the assistant sends photos), tasks (outbound conversations) and voice (calls from the preview).","default":false}},"type":"object","required":["name","admin_email"],"title":"CreateAccountRequest"},"CreateAccountResponse":{"properties":{"account":{"$ref":"#/components/schemas/AccountResponse"},"admin_user":{"$ref":"#/components/schemas/app__routers__account_management__UserResponse"},"temporary_password":{"type":"string","title":"Temporary Password","description":"Temporary password for the admin user (shown once)"},"project":{"$ref":"#/components/schemas/ProjectResponse","description":"Default project created with the account"},"provisioning_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provisioning Key","description":"Project API key for setting up this account right now (shown once). It writes without queueing for approval and stops working 24 h after this call. Null unless 'rest' was requested in `credentials`."},"provisioning_key_expires_at":{"type":"string","title":"Provisioning Key Expires At","description":"ISO 8601 instant, UTC with an explicit 'Z', at which the provisioning window closes for every credential returned here"},"provisioning_mcp_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provisioning Mcp Token","description":"Bearer token for the tenant MCP server, so this account can be set up with the platform's own tools instead of raw HTTP. Same authority and the same 24 h window as provisioning_key. Null when the deployment has no MCP signing secret configured."},"provisioning_mcp_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provisioning Mcp Url","description":"MCP endpoint the token authenticates against (RFC 8707 resource)"},"demo_pages":{"anyOf":[{"$ref":"#/components/schemas/DemoPagesResponse"},{"type":"null"}],"description":"Present only when 'demo' was requested. `enabled: false` means the account was created but the flag did not stick — the links would 404, so say so instead of sharing them."}},"type":"object","required":["account","admin_user","temporary_password","project","provisioning_key_expires_at"],"title":"CreateAccountResponse"},"CreateCaseRequest":{"properties":{"reason":{"type":"string","minLength":1,"title":"Reason","description":"What the customer is claiming, in their words"},"category":{"$ref":"#/components/schemas/CaseCategory","default":"other"},"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"},"customer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Email"},"resolution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution","description":"What was offered, when the case opens already settled"}},"type":"object","required":["reason"],"title":"CreateCaseRequest"},"CreateConversationSectionRequest":{"properties":{"summary":{"type":"string","title":"Summary","description":"Plain-text recap of the prior section. Persisted as a section marker, fed to the LLM as context and rendered by the FE as a divider. Required (can be empty string for a context-less section)."},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Machine reason for the section (e.g. 'takeover_on_assignment').","examples":["takeover_on_assignment"]}},"type":"object","required":["summary"],"title":"CreateConversationSectionRequest","description":"Request body for opening a new section of a conversation."},"CreateCreditRequest":{"properties":{"amount_usd":{"type":"number","title":"Amount Usd","description":"USD to add. Positive = refill; negative = correction. Non-zero."},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note","description":"Optional memo (invoice ref, reason)."}},"type":"object","required":["amount_usd"],"title":"CreateCreditRequest"},"CreateOperatorRequest":{"properties":{"email":{"type":"string","title":"Email"},"password":{"anyOf":[{"type":"string","minLength":12},{"type":"null"}],"title":"Password","description":"Initial password. The operator can change it later."},"role":{"type":"string","title":"Role","default":"kam"},"account_ids":{"items":{"type":"string"},"type":"array","title":"Account Ids"},"is_service":{"type":"boolean","title":"Is Service","default":false}},"type":"object","required":["email"],"title":"CreateOperatorRequest"},"CreateOrderRequest":{"properties":{"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"customer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Email"},"customer_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Phone"},"delivery_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Address"},"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items","description":"List of {product_id, quantity}","default":[]},"awaiting_payment":{"type":"boolean","title":"Awaiting Payment","description":"Leave the order unpaid so a payment link is what closes it. Default False keeps the old behaviour, where the mock auto-completes payment.","default":false}},"type":"object","title":"CreateOrderRequest"},"CreatePaymentLinkRequest":{"properties":{"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id","description":"Charge an existing order for its total"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount","description":"Charge this amount instead (requires description)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"expires_in_hours":{"type":"integer","maximum":720.0,"minimum":1.0,"title":"Expires In Hours","default":48}},"type":"object","title":"CreatePaymentLinkRequest"},"CreatePaymentPromiseRequest":{"properties":{"promised_date":{"type":"string","format":"date-time","title":"Promised Date","description":"When the customer says they will pay"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount","description":"Defaults to the invoice's full amount"},"contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact","description":"Who made the promise"}},"type":"object","required":["promised_date"],"title":"CreatePaymentPromiseRequest"},"CreatePaymentRequest":{"properties":{"amount_usd":{"type":"number","title":"Amount Usd","description":"USD paid. Positive = payment/refill; negative = correction. Non-zero."},"is_credit":{"type":"boolean","title":"Is Credit","description":"True books a prepaid credit that also feeds the Balance; False (default) is a plain post-paid payment (revenue only).","default":false},"paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid At","description":"Effective date (drives the revenue year). Defaults to now."},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note","description":"Optional memo (invoice ref, reason)."}},"type":"object","required":["amount_usd"],"title":"CreatePaymentRequest"},"CreateShareTokenRequest":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"The conversation ID to encode"}},"type":"object","required":["conversation_id"],"title":"CreateShareTokenRequest","description":"Request to create a share token."},"CreateShareTokenResponse":{"properties":{"token":{"type":"string","title":"Token","description":"The URL-safe share token"},"short_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Url","description":"A short link to the share page; absent when the shortener is unconfigured or down"}},"type":"object","required":["token"],"title":"CreateShareTokenResponse","description":"Response with the share token."},"CsatTimeSeriesPoint":{"properties":{"date":{"type":"string","title":"Date","description":"ISO date (YYYY-MM-DD)."},"total":{"type":"integer","title":"Total"},"positive":{"type":"integer","title":"Positive"},"neutral":{"type":"integer","title":"Neutral"},"negative":{"type":"integer","title":"Negative"},"csat_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Csat Pct","description":"positive / total * 100, null when total=0."}},"type":"object","required":["date","total","positive","neutral","negative"],"title":"CsatTimeSeriesPoint","description":"One day in the CSAT chart. Fields chosen to be a strict subset of\nthe customer-facing CSATTimeSeriesPoint so the FE can lift it\ndirectly into the existing chart shape if we ever decide to share\nthe recharts component."},"CustomKBDocument":{"properties":{"doc_id":{"type":"string","minLength":1,"title":"Doc Id","description":"Stable client-provided document ID (unique within request)"},"text":{"type":"string","title":"Text","description":"Full text content of the document to chunk and embed"},"metadata":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"items":{"type":"string"},"type":"array"}]},"type":"object","title":"Metadata","description":"Metadata stamped onto every chunk. Scalar values (SKU, company, title) filter with $eq/$in; a list value (e.g. modelo=['CEA60','CEA80']) makes the field a tag/array, filtered with $contains."}},"type":"object","required":["doc_id","text"],"title":"CustomKBDocument","description":"A single document to ingest into a custom knowledge base."},"CustomKBDocumentDeleteResponse":{"properties":{"doc_id":{"type":"string","title":"Doc Id","description":"The deleted document ID"},"doc_count":{"type":"integer","title":"Doc Count","description":"Total distinct documents remaining after deletion"},"meta_values":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Meta Values","description":"Available filter values per metadata_filter_field after deletion"}},"type":"object","required":["doc_id","doc_count"],"title":"CustomKBDocumentDeleteResponse","description":"Response from deleting a document from a custom knowledge base."},"CustomKBDocumentInfo":{"properties":{"doc_id":{"type":"string","title":"Doc Id","description":"The document ID"},"chunks":{"type":"integer","title":"Chunks","description":"Number of chunks for this document"},"metadata":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"}]},"type":"object","title":"Metadata","description":"Metadata of the document (from its first chunk)"}},"type":"object","required":["doc_id","chunks"],"title":"CustomKBDocumentInfo","description":"Listing entry for a document in a custom knowledge base."},"CustomKBDocumentListResponse":{"properties":{"doc_count":{"type":"integer","title":"Doc Count","description":"Total distinct documents in the collection"},"documents":{"items":{"$ref":"#/components/schemas/CustomKBDocumentInfo"},"type":"array","title":"Documents","description":"Distinct documents with metadata"}},"type":"object","required":["doc_count"],"title":"CustomKBDocumentListResponse","description":"Response listing documents in a custom knowledge base."},"CustomKBInfo":{"properties":{"doc_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doc Count","description":"Number of ingested documents"},"last_ingested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Ingested At","description":"When documents were last ingested"},"metadata_filter_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Filter Fields","description":"Metadata filter field names used for RAG query filtering"},"metadata_filter_guidance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata Filter Guidance","description":"Free-text guidance on how to use the filters (shown to the LLM in the search tool)"},"retrieval_config":{"anyOf":[{"$ref":"#/components/schemas/RetrievalConfig"},{"type":"null"}],"description":"Retrieval tuning configuration"},"chunking_config":{"anyOf":[{"$ref":"#/components/schemas/ChunkingConfig"},{"type":"null"}],"description":"Ingest-time chunking configuration"},"is_temporary":{"type":"boolean","title":"Is Temporary","description":"Temporary KB (hidden from FE; admin-only, e.g. eval sweeps)","default":false}},"type":"object","title":"CustomKBInfo","description":"FE-visible projection of CUSTOM KB ingest/retrieval state."},"CustomKBIngestRequest":{"properties":{"upsert":{"type":"boolean","title":"Upsert","description":"If true, delete existing chunks for each doc_id before inserting","default":true},"documents":{"items":{"$ref":"#/components/schemas/CustomKBDocument"},"type":"array","title":"Documents","description":"Documents to ingest (max 50 per request)"},"chunk_size":{"anyOf":[{"type":"integer","maximum":8192.0,"minimum":64.0},{"type":"null"}],"title":"Chunk Size","description":"Override chunk size for THIS ingest (else the KB's chunking_config / default)"},"chunk_overlap":{"anyOf":[{"type":"integer","maximum":2048.0,"minimum":0.0},{"type":"null"}],"title":"Chunk Overlap","description":"Override chunk overlap for THIS ingest (else the KB's chunking_config / default)"}},"type":"object","required":["documents"],"title":"CustomKBIngestRequest","description":"Request body for ingesting documents into a custom knowledge base."},"CustomKBIngestResponse":{"properties":{"ingested":{"items":{"$ref":"#/components/schemas/CustomKBIngestedDocument"},"type":"array","title":"Ingested","description":"Per-document ingest results"},"doc_count":{"type":"integer","title":"Doc Count","description":"Total distinct documents in the collection after ingest"},"meta_values":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Meta Values","description":"Available filter values per metadata_filter_field after ingest"}},"type":"object","required":["doc_count"],"title":"CustomKBIngestResponse","description":"Response from a custom KB ingest request."},"CustomKBIngestedDocument":{"properties":{"doc_id":{"type":"string","title":"Doc Id","description":"The ingested document ID"},"chunks":{"type":"integer","title":"Chunks","description":"Number of chunks created and embedded for this document"}},"type":"object","required":["doc_id","chunks"],"title":"CustomKBIngestedDocument","description":"Per-document ingest result."},"CustomToolkitConnectRequest":{"properties":{"toolkit":{"type":"string","title":"Toolkit","description":"Toolkit slug to connect (e.g., 'INTERCOM_TICKETS')"},"credentials":{"additionalProperties":true,"type":"object","title":"Credentials","description":"Credential fields (e.g., {'api_key': '...'})"},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"Optional non-secret configuration"}},"type":"object","required":["toolkit","credentials"],"title":"CustomToolkitConnectRequest","description":"Request to connect a custom toolkit."},"CustomToolkitConnectResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Connection ID"},"status":{"type":"string","title":"Status","description":"Connection status (e.g., 'active')"}},"type":"object","required":["id","status"],"title":"CustomToolkitConnectResponse","description":"Response from connecting a custom toolkit."},"CustomToolkitDisconnectResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the disconnection was successful"},"toolkit":{"type":"string","title":"Toolkit","description":"Toolkit that was disconnected"}},"type":"object","required":["success","toolkit"],"title":"CustomToolkitDisconnectResponse","description":"Response from disconnecting a custom toolkit."},"CustomToolkitInfo":{"properties":{"slug":{"type":"string","title":"Slug","description":"Toolkit identifier (e.g., 'INTERCOM_TICKETS')"},"name":{"type":"string","title":"Name","description":"Human-readable toolkit name"},"description":{"type":"string","title":"Description","description":"Description of toolkit capabilities"},"icon":{"type":"string","title":"Icon","description":"Icon identifier","default":"plug"},"auth_type":{"type":"string","title":"Auth Type","description":"Authentication type","default":"api_key"},"tools":{"items":{"type":"string"},"type":"array","title":"Tools","description":"List of tool slugs exposed by this toolkit"},"credential_fields":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Credential Fields","description":"Fields needed to connect"},"config_fields":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Config Fields","description":"Optional config fields"},"tool_params":{"additionalProperties":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"type":"object","title":"Tool Params","description":"Per-tool configurable params set at instruction time (e.g. ticket_type_id for create ticket)"},"assistant_params":{"additionalProperties":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"type":"object","title":"Assistant Params","description":"Per-tool inputs the assistant always fills at runtime (e.g. the chosen slot of a booking). Not configurable; listed so the config UI can show they exist."},"is_connected":{"type":"boolean","title":"Is Connected","description":"Whether the project has an active connection","default":false},"connected_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected Account Id","description":"ID of active connection if connected"}},"type":"object","required":["slug","name","description"],"title":"CustomToolkitInfo","description":"Information about a custom toolkit and its connection status."},"CustomToolkitListResponse":{"properties":{"toolkits":{"items":{"$ref":"#/components/schemas/CustomToolkitInfo"},"type":"array","title":"Toolkits","description":"List of custom toolkits"}},"type":"object","required":["toolkits"],"title":"CustomToolkitListResponse","description":"Response for listing custom toolkits with connection status."},"CustomToolkitOAuthStartResponse":{"properties":{"authorize_url":{"type":"string","title":"Authorize Url","description":"Provider authorize URL to redirect/open for the user"}},"type":"object","required":["authorize_url"],"title":"CustomToolkitOAuthStartResponse","description":"Response from starting an OAuth install flow for a custom toolkit."},"CustomToolkitStatusResponse":{"properties":{"toolkit_slug":{"type":"string","title":"Toolkit Slug","description":"Toolkit identifier, e.g. INTERCOM_TICKETS"},"name":{"type":"string","title":"Name","description":"Human-readable toolkit name"},"auth_type":{"type":"string","title":"Auth Type","description":"Authentication type, e.g. api_key / oauth"},"is_connected":{"type":"boolean","title":"Is Connected","description":"True when the project has an active connection — required before its actions can be used."},"connected_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected Account Id","description":"ID of the active toolkit connection, or null when not connected."},"tools":{"items":{"type":"string"},"type":"array","title":"Tools","description":"Action slugs this toolkit exposes."}},"type":"object","required":["toolkit_slug","name","auth_type","is_connected"],"title":"CustomToolkitStatusResponse","description":"Connection status of a single custom toolkit for a project."},"CustomToolkitTestResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the API responded successfully"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if the test failed"}},"type":"object","required":["success"],"title":"CustomToolkitTestResponse","description":"Response from testing the stored credentials of a connected toolkit."},"CustomerLookupRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"CustomerLookupRequest"},"DateOverride":{"properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","title":"Date","description":"Date in YYYY-MM-DD format"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Optional label (e.g., 'Christmas', 'Team Offsite')"},"is_available":{"type":"boolean","title":"Is Available","description":"False = completely unavailable (OOO), True = available with modified hours","default":false},"override_schedule":{"anyOf":[{"$ref":"#/components/schemas/OverrideSchedule"},{"type":"null"}],"description":"Custom schedule for this date (required if is_available=True)"},"id":{"type":"string","title":"Id","description":"Unique override ID"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this override belongs to"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the override was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When the override was last updated"}},"type":"object","required":["date","id","project_id","created_at","updated_at"],"title":"DateOverride","description":"Full date override model with all fields."},"DateOverrideCreate":{"properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","title":"Date","description":"Date in YYYY-MM-DD format"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Optional label (e.g., 'Christmas', 'Team Offsite')"},"is_available":{"type":"boolean","title":"Is Available","description":"False = completely unavailable (OOO), True = available with modified hours","default":false},"override_schedule":{"anyOf":[{"$ref":"#/components/schemas/OverrideSchedule"},{"type":"null"}],"description":"Custom schedule for this date (required if is_available=True)"}},"type":"object","required":["date"],"title":"DateOverrideCreate","description":"Model for creating a date override."},"DateOverrideUpdate":{"properties":{"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"title":"Date","description":"Updated date"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Updated label"},"is_available":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Available","description":"Updated availability status"},"override_schedule":{"anyOf":[{"$ref":"#/components/schemas/OverrideSchedule"},{"type":"null"}],"description":"Updated override schedule"}},"type":"object","title":"DateOverrideUpdate","description":"Model for updating a date override."},"DaySchedule":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"Whether this day is available","default":false},"slots":{"items":{"$ref":"#/components/schemas/TimeSlot"},"type":"array","title":"Slots","description":"Time slots for this day"}},"type":"object","title":"DaySchedule","description":"Schedule for a single day of the week."},"DealTierModel":{"properties":{"up_to":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Up To","description":"Inclusive upper bound; null means unlimited."},"unit_price_usd":{"type":"number","title":"Unit Price Usd"}},"type":"object","required":["unit_price_usd"],"title":"DealTierModel"},"DefaultMessage":{"properties":{"text":{"type":"string","maxLength":2000,"title":"Text","description":"What to send. Empty means say nothing to the user.","default":""},"handoff":{"type":"boolean","title":"Handoff","description":"Whether to hand the conversation to a human. Independent of the message.","default":true}},"additionalProperties":false,"type":"object","title":"DefaultMessage","description":"What the channel does for a situation the assistant cannot answer itself.\n\nTwo independent decisions, deliberately not folded into one setting: what to\nsay, and whether to put a human on it. \"Tell them I can't read videos and\nkeep going\" and \"hand off without a word\" are both real configurations, and\na single dropdown could not express either without inventing a mode for it.\n\nStatic text on purpose: these fire when there is no agent turn to speak with\n— the message never reached the model (unreadable attachment) or the model\ncould not be reached at all (Studio Chat down)."},"DeliveryStatus":{"type":"string","enum":["pending","confirmed","preparing","out_for_delivery","delivered","cancelled"],"title":"DeliveryStatus"},"DeliveryUpdate":{"properties":{"order_id":{"type":"string","title":"Order Id"},"status":{"$ref":"#/components/schemas/DeliveryStatus"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"message":{"type":"string","title":"Message"}},"type":"object","required":["order_id","status","updated_at","message"],"title":"DeliveryUpdate"},"DemoPagesResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"Whether the public demo pages are on for this account"},"flags":{"items":{"type":"string"},"type":"array","title":"Flags","description":"The other feature flags `demo: true` turned on (media library, tasks, voice); one missing failed"},"channels":{"items":{"type":"string"},"type":"array","title":"Channels","description":"Channels each assistant gets a page for"},"url_template":{"type":"string","title":"Url Template","description":"A demo page's URL with {base_id} and {channel} left to fill in. The page answers once the assistant has an ACTIVE version; the first visit mints its own browser key."}},"type":"object","required":["enabled","channels","url_template"],"title":"DemoPagesResponse","description":"What `demo: true` turned on, and where the links will be.\n\nThe account exists before any assistant does, so there is no finished URL to\nreturn here. What can be returned is the shape of one, from the module that\nserves it, plus the channels that shape is valid for."},"DemoStartRequest":{"properties":{"channel":{"type":"string","enum":["whatsapp","web","email","voice"],"title":"Channel"},"task_id":{"type":"string","maxLength":120,"minLength":1,"title":"Task Id"},"inputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Inputs","description":"The task's inputs, as the visitor filled them. At most 4 KB of JSON and 30 keys."}},"type":"object","required":["channel","task_id"],"title":"DemoStartRequest","description":"Start a demo conversation with a task: the assistant speaks first."},"DemoStartResponse":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"Minted by the server. Continue it on the chat route (or the call)."},"task":{"anyOf":[{"$ref":"#/components/schemas/TaskEvaluation"},{"type":"null"}]},"reply":{"anyOf":[{"$ref":"#/components/schemas/PlaybookChatResponse"},{"type":"null"}],"description":"The assistant's opening turn on whatsapp/web/email. Null on voice: the call opens it."}},"type":"object","required":["conversation_id"],"title":"DemoStartResponse","description":"What a demo start did: the conversation it opened and, on a text channel, the first turn."},"DemoTask":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"inputs":{"items":{"$ref":"#/components/schemas/DemoTaskInput"},"type":"array","title":"Inputs"}},"type":"object","required":["id","name"],"title":"DemoTask","description":"A task the public demo page can start a conversation with."},"DemoTaskInput":{"properties":{"path":{"type":"string","title":"Path"},"fallback":{"type":"string","title":"Fallback","description":"The pill's own fallback, which the page shows as the example value","default":""}},"type":"object","required":["path"],"title":"DemoTaskInput","description":"One `{{ input: path | fallback }}` pill of a task, as a field the demo page offers."},"DemoVoiceSessionRequest":{"properties":{"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id","description":"Continue this conversation (a call back); omitted = a new one"}},"type":"object","title":"DemoVoiceSessionRequest"},"DocumentLookupRequest":{"properties":{"query":{"type":"string","minLength":1,"title":"Query","description":"Search query to find relevant documents"},"knowledgebase_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Knowledgebase Ids","description":"Optional list of knowledge base IDs to filter search. If not provided, searches all knowledge bases."},"top_k":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Top K","description":"Maximum number of documents to return (1-50)","default":10}},"type":"object","required":["query"],"title":"DocumentLookupRequest","description":"Request for document lookup/search."},"DocumentLookupResponse":{"properties":{"query":{"type":"string","title":"Query","description":"The original search query"},"documents":{"items":{"$ref":"#/components/schemas/DocumentResult-Output"},"type":"array","title":"Documents","description":"List of relevant documents found"},"retrieval_time_ms":{"type":"number","title":"Retrieval Time Ms","description":"Time taken for RAG retrieval in milliseconds"},"explanation_time_ms":{"type":"number","title":"Explanation Time Ms","description":"Time taken to generate explanations in milliseconds"},"total_time_ms":{"type":"number","title":"Total Time Ms","description":"Total time taken for the lookup in milliseconds"}},"type":"object","required":["query","retrieval_time_ms","explanation_time_ms","total_time_ms"],"title":"DocumentLookupResponse","description":"Response containing document lookup results."},"DocumentResult-Input":{"properties":{"knowledgebase_id":{"type":"string","title":"Knowledgebase Id","description":"ID of the knowledge base this document belongs to"},"knowledgebase_title":{"type":"string","title":"Knowledgebase Title","description":"Title of the knowledge base or per-node title"},"kb_type":{"$ref":"#/components/schemas/KnowledgeBaseType","description":"Type of knowledge base (text, faq, file, custom)"},"content":{"type":"string","title":"Content","description":"Full content of the document (combined from all nodes)"},"relevance_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Relevance Score","description":"Relevance score from vector search (0-1), or null if unavailable"},"explanation":{"type":"string","title":"Explanation","description":"LLM-generated explanation of why this document is relevant to the query"},"confidence_score":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidence Score","description":"Confidence score from LLM (HIGH, MEDIUM, LOW)"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name","description":"Filename with extension (for per-node custom KBs)"},"kb_source_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Source Name","description":"Name of the knowledge base source from PostgreSQL"},"matched_nodes":{"items":{"$ref":"#/components/schemas/KnowledgeBaseRetrievalMetadata"},"type":"array","title":"Matched Nodes","description":"Individual RAG nodes that matched this document"}},"type":"object","required":["knowledgebase_id","knowledgebase_title","kb_type","content","explanation"],"title":"DocumentResult","description":"A single document result from lookup."},"DocumentResult-Output":{"properties":{"knowledgebase_id":{"type":"string","title":"Knowledgebase Id","description":"ID of the knowledge base this document belongs to"},"knowledgebase_title":{"type":"string","title":"Knowledgebase Title","description":"Title of the knowledge base or per-node title"},"kb_type":{"$ref":"#/components/schemas/KnowledgeBaseType","description":"Type of knowledge base (text, faq, file, custom)"},"content":{"type":"string","title":"Content","description":"Full content of the document (combined from all nodes)"},"relevance_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Relevance Score","description":"Relevance score from vector search (0-1), or null if unavailable"},"explanation":{"type":"string","title":"Explanation","description":"LLM-generated explanation of why this document is relevant to the query"},"confidence_score":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidence Score","description":"Confidence score from LLM (HIGH, MEDIUM, LOW)"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name","description":"Filename with extension (for per-node custom KBs)"},"kb_source_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Source Name","description":"Name of the knowledge base source from PostgreSQL"},"matched_nodes":{"items":{"$ref":"#/components/schemas/KnowledgeBaseRetrievalMetadata"},"type":"array","title":"Matched Nodes","description":"Individual RAG nodes that matched this document"}},"type":"object","required":["knowledgebase_id","knowledgebase_title","kb_type","content","explanation"],"title":"DocumentResult","description":"A single document result from lookup."},"DryRunStartRequest":{"properties":{"case":{"$ref":"#/components/schemas/EvalCaseCreate"},"playbook_id":{"type":"string","title":"Playbook Id"},"playbook_override":{"anyOf":[{"$ref":"#/components/schemas/PlaybookOverride"},{"type":"null"}],"description":"Optional ephemeral playbook override applied to this dry-run only. Lets you iterate on instructions / skills against an unsaved case without persisting either to storage."},"judge_mode":{"anyOf":[{"type":"string","enum":["llm","jev_then_llm","shadow"]},{"type":"null"}],"title":"Judge Mode","description":"Which judge decides the case's ``text`` assertions, as on ``EvalRunCreate.judge_mode`` (the jev thresholds use their defaults). Unset means ``jev_then_llm`` where ``TYPESAFE_API_KEY`` is set, ``llm`` otherwise; asking for a jev mode without the key is a 422."}},"type":"object","required":["case","playbook_id"],"title":"DryRunStartRequest","description":"POST body: an unsaved case + the playbook version to simulate against."},"DryRunStartResponse":{"properties":{"dry_run_id":{"type":"string","title":"Dry Run Id"}},"type":"object","required":["dry_run_id"],"title":"DryRunStartResponse"},"DryRunState":{"properties":{"dry_run_id":{"type":"string","title":"Dry Run Id"},"status":{"type":"string","enum":["running","completed","cancelled","error"],"title":"Status"},"turns":{"items":{"$ref":"#/components/schemas/SimulatorTurn-Output"},"type":"array","title":"Turns"},"assertion_results":{"anyOf":[{"items":{"$ref":"#/components/schemas/AssertionResult"},"type":"array"},{"type":"null"}],"title":"Assertion Results"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"cancel_requested":{"type":"boolean","title":"Cancel Requested","default":false},"judge_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Judge Cost Usd"}},"type":"object","required":["dry_run_id","status","started_at"],"title":"DryRunState","description":"Snapshot returned to the polling FE.\n\n``turns`` grows as the simulator emits turns; ``assertion_results`` is\nonly populated once ``status == \"completed\"``. ``cancel_requested`` is\nan internal flag the runner thread checks between turns; we expose it\non the wire so the FE can immediately render \"stopping…\" without\nwaiting for the next poll cycle."},"EditNoteRequest":{"properties":{"old_note":{"type":"string","title":"Old Note"},"new_note":{"type":"string","title":"New Note"}},"type":"object","required":["old_note","new_note"],"title":"EditNoteRequest","description":"Request body for editing a note."},"EvalCase":{"properties":{"name":{"type":"string","title":"Name","description":"Unique name for this test case (lowercase with dashes)"},"scenario":{"type":"string","title":"Scenario","description":"Scenario description for the simulator to follow. Auto-rendered from ``scenario_blocks`` when those are provided; required otherwise.","default":""},"scenario_blocks":{"anyOf":[{"$ref":"#/components/schemas/ScenarioBlocks"},{"type":"null"}],"description":"Structured scenario (v2). When set, it is the source of truth: the server renders the canonical text into ``scenario``. Legacy free-text cases leave this null."},"first_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Message","description":"Optional exact first message (if not provided, LLM generates)"},"termination":{"type":"string","title":"Termination","description":"Expected outcome condition to check for termination. May come from ``scenario_blocks.terminacion`` instead; required one way or the other.","default":""},"max_turns":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Max Turns","description":"Maximum conversation turns","default":10},"assertions":{"items":{"oneOf":[{"$ref":"#/components/schemas/TextAssertion"},{"$ref":"#/components/schemas/ToolCalledAssertion"},{"$ref":"#/components/schemas/ToolNotCalledAssertion"},{"$ref":"#/components/schemas/ToolCallSequenceAssertion"},{"$ref":"#/components/schemas/HandoffAssertion"},{"$ref":"#/components/schemas/HandoffAgentAssertion"},{"$ref":"#/components/schemas/HandoffTeamAssertion"},{"$ref":"#/components/schemas/NoHandoffAssertion"},{"$ref":"#/components/schemas/TagAddedAssertion"},{"$ref":"#/components/schemas/PrivateNoteContainsAssertion"},{"$ref":"#/components/schemas/SkillLoadedAssertion"}]},"type":"array","title":"Assertions","description":"List of criteria to evaluate"},"tool_mocks":{"anyOf":[{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/ToolMockSpec"},{"items":{"$ref":"#/components/schemas/ToolMockSpec"},"type":"array"}]},"type":"object"},{"type":"null"}],"title":"Tool Mocks","description":"Optional per-case tool mocks. Keys are tool names; values are one or more ToolMockSpec."},"user_context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Context","description":"Optional per-case user context; merges over the run-level user_context (case wins). Its keys are the agent's context at the root, as a channel's chat `context` sends them (`conversation.kyc_level` here is `context.conversation.kyc_level` for skill conditions, pills and toolkit pins)."},"flow_steps":{"anyOf":[{"items":{"$ref":"#/components/schemas/EvalFlowStep"},"type":"array","maxItems":3},{"type":"null"}],"title":"Flow Steps","description":"Optional WhatsApp Flow steps, completed through Rumo's flow simulator (flag flow_eval_steps)."},"id":{"type":"string","title":"Id","description":"Unique case ID"},"playbook_base_id":{"type":"string","title":"Playbook Base Id","description":"Base ID of the playbook this case belongs to"},"is_enabled":{"type":"boolean","title":"Is Enabled","description":"Whether this case is enabled for runs","default":true},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the case was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When the case was last updated"},"created_by_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Created By User Id","description":"User id that created the case (0 = unattributed)"},"updated_by_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Updated By User Id","description":"User id that last updated the case"},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Soft-deleted: hidden from lists/runs but recoverable","default":false},"deleted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Deleted At","description":"When the case was soft-deleted"},"deleted_by_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Deleted By User Id","description":"User id that soft-deleted the case"}},"type":"object","required":["name","id","playbook_base_id","created_at","updated_at"],"title":"EvalCase","description":"Full eval case model with all fields."},"EvalCaseBatchCreate":{"properties":{"cases":{"items":{"$ref":"#/components/schemas/EvalCaseCreate"},"type":"array","maxItems":100,"title":"Cases","description":"List of eval cases to create"}},"type":"object","required":["cases"],"title":"EvalCaseBatchCreate","description":"Batch create multiple eval cases at once."},"EvalCaseCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Unique name for this test case (lowercase with dashes)"},"scenario":{"type":"string","title":"Scenario","description":"Scenario description for the simulator to follow. Auto-rendered from ``scenario_blocks`` when those are provided; required otherwise.","default":""},"scenario_blocks":{"anyOf":[{"$ref":"#/components/schemas/ScenarioBlocks"},{"type":"null"}],"description":"Structured scenario (v2). When set, it is the source of truth: the server renders the canonical text into ``scenario``. Legacy free-text cases leave this null."},"first_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Message","description":"Optional exact first message (if not provided, LLM generates)"},"termination":{"type":"string","title":"Termination","description":"Expected outcome condition to check for termination. May come from ``scenario_blocks.terminacion`` instead; required one way or the other.","default":""},"max_turns":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Max Turns","description":"Maximum conversation turns","default":10},"assertions":{"items":{"oneOf":[{"$ref":"#/components/schemas/TextAssertion"},{"$ref":"#/components/schemas/ToolCalledAssertion"},{"$ref":"#/components/schemas/ToolNotCalledAssertion"},{"$ref":"#/components/schemas/ToolCallSequenceAssertion"},{"$ref":"#/components/schemas/HandoffAssertion"},{"$ref":"#/components/schemas/HandoffAgentAssertion"},{"$ref":"#/components/schemas/HandoffTeamAssertion"},{"$ref":"#/components/schemas/NoHandoffAssertion"},{"$ref":"#/components/schemas/TagAddedAssertion"},{"$ref":"#/components/schemas/PrivateNoteContainsAssertion"},{"$ref":"#/components/schemas/SkillLoadedAssertion"}]},"type":"array","title":"Assertions","description":"List of criteria to evaluate"},"tool_mocks":{"anyOf":[{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/ToolMockSpec"},{"items":{"$ref":"#/components/schemas/ToolMockSpec"},"type":"array"}]},"type":"object"},{"type":"null"}],"title":"Tool Mocks","description":"Optional per-case tool mocks. Keys are tool names; values are one or more ToolMockSpec."},"user_context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Context","description":"Optional per-case user context; merges over the run-level user_context (case wins). Its keys are the agent's context at the root, as a channel's chat `context` sends them (`conversation.kyc_level` here is `context.conversation.kyc_level` for skill conditions, pills and toolkit pins)."},"flow_steps":{"anyOf":[{"items":{"$ref":"#/components/schemas/EvalFlowStep"},"type":"array","maxItems":3},{"type":"null"}],"title":"Flow Steps","description":"Optional WhatsApp Flow steps, completed through Rumo's flow simulator (flag flow_eval_steps)."}},"type":"object","required":["name"],"title":"EvalCaseCreate","description":"Model for creating an eval case."},"EvalCaseDiff":{"properties":{"case_name":{"type":"string","title":"Case Name"},"status_a":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status A"},"status_b":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status B"},"only_in_a":{"type":"boolean","title":"Only In A","default":false},"only_in_b":{"type":"boolean","title":"Only In B","default":false},"assertion_flips":{"items":{"$ref":"#/components/schemas/AssertionFlip"},"type":"array","title":"Assertion Flips"},"tool_sequence_diff":{"items":{"$ref":"#/components/schemas/ToolSequenceOpcode"},"type":"array","title":"Tool Sequence Diff"},"message_diffs":{"items":{"$ref":"#/components/schemas/MessageLineDiff"},"type":"array","title":"Message Diffs"}},"type":"object","required":["case_name"],"title":"EvalCaseDiff","description":"Per-case diff anchored on case name. Cases that exist in only one\nrun set the missing side to ``None`` and flag ``only_in_a`` /\n``only_in_b``."},"EvalCaseRow":{"properties":{"case_id":{"type":"string","title":"Case Id"},"case_name":{"type":"string","title":"Case Name"},"is_enabled":{"type":"boolean","title":"Is Enabled","default":true},"scenario_format":{"type":"string","enum":["v1","v2"],"title":"Scenario Format","description":"v2 = structured scenario_blocks","default":"v1"},"assertion_count":{"type":"integer","title":"Assertion Count","default":0},"recent":{"items":{"$ref":"#/components/schemas/EvalResultStatus"},"type":"array","title":"Recent","description":"Statuses of the last executions, oldest→newest (≤5)"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run At"}},"type":"object","required":["case_id","case_name"],"title":"EvalCaseRow","description":"One case in the assistant dashboard's case table: definition summary +\nits last few execution outcomes (oldest→newest), for inline status dots."},"EvalCaseUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"scenario":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scenario"},"scenario_blocks":{"anyOf":[{"$ref":"#/components/schemas/ScenarioBlocks"},{"type":"null"}]},"first_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Message"},"termination":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Termination"},"max_turns":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":1.0},{"type":"null"}],"title":"Max Turns"},"assertions":{"anyOf":[{"items":{"oneOf":[{"$ref":"#/components/schemas/TextAssertion"},{"$ref":"#/components/schemas/ToolCalledAssertion"},{"$ref":"#/components/schemas/ToolNotCalledAssertion"},{"$ref":"#/components/schemas/ToolCallSequenceAssertion"},{"$ref":"#/components/schemas/HandoffAssertion"},{"$ref":"#/components/schemas/HandoffAgentAssertion"},{"$ref":"#/components/schemas/HandoffTeamAssertion"},{"$ref":"#/components/schemas/NoHandoffAssertion"},{"$ref":"#/components/schemas/TagAddedAssertion"},{"$ref":"#/components/schemas/PrivateNoteContainsAssertion"},{"$ref":"#/components/schemas/SkillLoadedAssertion"}]},"type":"array"},{"type":"null"}],"title":"Assertions"},"tool_mocks":{"anyOf":[{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/ToolMockSpec"},{"items":{"$ref":"#/components/schemas/ToolMockSpec"},"type":"array"}]},"type":"object"},{"type":"null"}],"title":"Tool Mocks"},"user_context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Context"},"flow_steps":{"anyOf":[{"items":{"$ref":"#/components/schemas/EvalFlowStep"},"type":"array","maxItems":3},{"type":"null"}],"title":"Flow Steps"},"is_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Enabled"}},"type":"object","title":"EvalCaseUpdate","description":"Model for updating an eval case."},"EvalCostByPlaybookRow":{"properties":{"playbook_base_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"},"playbook_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Name"},"eval_cost_usd":{"type":"number","title":"Eval Cost Usd","description":"Sum of ``eval_overhead_cost_usd`` across runs of this playbook.","default":0.0},"total_runs":{"type":"integer","title":"Total Runs","default":0},"completed_runs":{"type":"integer","title":"Completed Runs","default":0},"passed_cases":{"type":"integer","title":"Passed Cases","default":0},"failed_cases":{"type":"integer","title":"Failed Cases","default":0},"avg_cost_per_run":{"type":"number","title":"Avg Cost Per Run","default":0.0},"last_run_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Run At","description":"``created_at`` of the most recent matched run."}},"type":"object","title":"EvalCostByPlaybookRow","description":"Per-playbook aggregation of eval overhead cost."},"EvalCoverageReport":{"properties":{"playbook_base_id":{"type":"string","title":"Playbook Base Id"},"playbook_id":{"type":"string","title":"Playbook Id"},"playbook_version":{"type":"integer","title":"Playbook Version"},"overall_pct":{"type":"number","title":"Overall Pct","description":"Covered / total across measurable categories (0–100)"},"measurable_total":{"type":"integer","title":"Measurable Total","description":"Total measurable elements (tools + skills)"},"measurable_covered":{"type":"integer","title":"Measurable Covered","description":"Covered measurable elements"},"categories":{"items":{"$ref":"#/components/schemas/CoverageCategory-Output"},"type":"array","title":"Categories"},"based_on_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Based On Run Id","description":"Latest completed run used for executed coverage; None if no completed run exists"},"case_count":{"type":"integer","title":"Case Count","description":"Number of enabled cases considered for static coverage"},"generated_at":{"type":"string","format":"date-time","title":"Generated At","description":"When this report was computed"}},"type":"object","required":["playbook_base_id","playbook_id","playbook_version","overall_pct","measurable_total","measurable_covered","case_count","generated_at"],"title":"EvalCoverageReport","description":"Full coverage report for one playbook version."},"EvalFlowStep":{"properties":{"type":{"type":"string","const":"flow","title":"Type","default":"flow"},"flow_set_id":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}],"title":"Flow Set Id","description":"The flow set the assistant must send; null: the next flow it sends, whichever."},"scenario":{"additionalProperties":true,"type":"object","title":"Scenario","description":"Rumo flow scenario (steps: expect_screen / select / fill / tap / expect_complete …). Empty: a smoke run that walks the first path. The flow's prefill comes from the sent flow; ``scenario.prefill`` overrides it."},"version":{"type":"string","enum":["draft","published"],"title":"Version","description":"Which Flow JSON version to run.","default":"published"},"app_version":{"type":"string","enum":["live","preview"],"title":"App Version","description":"For app-powered flows: the app's live host or its --preview host.","default":"live"},"expect_sent":{"type":"boolean","title":"Expect Sent","description":"True: the assistant must send the flow. False: it must NOT send it (scenario and judge unused).","default":true},"judge":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Judge","description":"What the assistant's reply right after the answers must do (LLM judge). Null: no judge."}},"additionalProperties":false,"type":"object","title":"EvalFlowStep","description":"A WhatsApp Flow the assistant sends during the case, completed by Rumo's flow simulator.\n\nBehind the account's ``flow_eval_steps`` flag. When the assistant sends a\nflow (a flow set) during the simulated conversation, the runner completes\nit with ``scenario`` through Rumo\n(``POST /inboxes/:inbox_id/whatsapp_flows/:flow_id/simulations``,\ncompletion ``dry_run``), hands the verified answers to the assistant\nexactly as a real flow answer arrives (``<flow_response>`` block +\n``context.flow_response``), and the judge checks the assistant's next\nreply against ``judge``. Steps match sent flows in order."},"EvalFromCallRequest":{"properties":{"kaption_call_id":{"type":"integer","title":"Kaption Call Id"}},"type":"object","required":["kaption_call_id"],"title":"EvalFromCallRequest"},"EvalMatrix":{"properties":{"playbook_base_id":{"type":"string","title":"Playbook Base Id"},"runs":{"items":{"$ref":"#/components/schemas/EvalMatrixRun"},"type":"array","title":"Runs","description":"Oldest → newest"},"cells":{"items":{"$ref":"#/components/schemas/EvalMatrixCell"},"type":"array","title":"Cells"}},"type":"object","required":["playbook_base_id"],"title":"EvalMatrix","description":"Cases × recent-runs result matrix for one assistant. Cases not present\nin a run simply have no cell for that (case_id, run_id) pair."},"EvalMatrixCell":{"properties":{"case_id":{"type":"string","title":"Case Id"},"run_id":{"type":"string","title":"Run Id"},"result_id":{"type":"string","title":"Result Id"},"status":{"$ref":"#/components/schemas/EvalResultStatus"},"passed_assertions":{"type":"integer","title":"Passed Assertions","default":0},"total_assertions":{"type":"integer","title":"Total Assertions","default":0}},"type":"object","required":["case_id","run_id","result_id","status"],"title":"EvalMatrixCell","description":"One case's outcome in one run of the matrix."},"EvalMatrixRun":{"properties":{"run_id":{"type":"string","title":"Run Id"},"playbook_id":{"type":"string","title":"Playbook Id"},"playbook_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Playbook Version"},"status":{"$ref":"#/components/schemas/EvalRunStatus"},"trigger_source":{"anyOf":[{"$ref":"#/components/schemas/EvalTriggerSource"},{"type":"null"}]},"total_cases":{"type":"integer","title":"Total Cases","default":0},"passed_cases":{"type":"integer","title":"Passed Cases","default":0},"failed_cases":{"type":"integer","title":"Failed Cases","default":0},"error_cases":{"type":"integer","title":"Error Cases","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["run_id","playbook_id","status","created_at"],"title":"EvalMatrixRun","description":"One column of the cases × runs matrix: a recent run with the playbook\nversion it exercised plus its aggregate counts."},"EvalMetrics":{"properties":{"playbook_base_id":{"type":"string","title":"Playbook Base Id"},"case_count":{"type":"integer","title":"Case Count","description":"Total eval cases"},"enabled_case_count":{"type":"integer","title":"Enabled Case Count","description":"Enabled eval cases"},"total_runs":{"type":"integer","title":"Total Runs","description":"Total eval runs ever recorded"},"last_run":{"anyOf":[{"$ref":"#/components/schemas/RunTrendPoint"},{"type":"null"}],"description":"Most recent run (any status)"},"pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pass Rate","description":"Case pass-rate of the latest completed run (0–100)"},"assertion_pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Assertion Pass Rate","description":"Assertion pass-rate of the latest completed run (0–100)"},"trend":{"items":{"$ref":"#/components/schemas/RunTrendPoint"},"type":"array","title":"Trend","description":"Recent completed runs, oldest→newest"},"assertion_type_stats":{"items":{"$ref":"#/components/schemas/AssertionTypeStat"},"type":"array","title":"Assertion Type Stats","description":"Per-assertion-type pass-rate for the latest completed run"},"last_run_cases":{"items":{"$ref":"#/components/schemas/CaseResultBrief"},"type":"array","title":"Last Run Cases","description":"Per-case outcome of the latest completed run (for pass/fail breakdown)"},"total_overhead_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Overhead Cost Usd","description":"Sum of eval-overhead cost across all runs"},"case_rows":{"items":{"$ref":"#/components/schemas/EvalCaseRow"},"type":"array","title":"Case Rows","description":"Per-case dashboard rows: definition summary + last execution outcomes"}},"type":"object","required":["playbook_base_id","case_count","enabled_case_count","total_runs"],"title":"EvalMetrics","description":"Aggregate eval metrics for one assistant (by playbook base_id)."},"EvalOverview":{"properties":{"assistants":{"items":{"$ref":"#/components/schemas/AssistantEvalSummary-Output"},"type":"array","title":"Assistants"},"total_cases":{"type":"integer","title":"Total Cases","description":"Total enabled-or-not eval cases across all assistants","default":0},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["generated_at"],"title":"EvalOverview","description":"Project-wide eval summary across all assistants."},"EvalResult":{"properties":{"id":{"type":"string","title":"Id","description":"Unique result ID"},"run_id":{"type":"string","title":"Run Id","description":"ID of the run this result belongs to"},"case_id":{"type":"string","title":"Case Id","description":"ID of the case that was executed"},"conversation_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Conversation Id","description":"ID of the conversation created during eval"},"status":{"$ref":"#/components/schemas/EvalResultStatus","description":"Status of this result"},"total_assertions":{"type":"integer","title":"Total Assertions","description":"Total number of assertions","default":0},"passed_assertions":{"type":"integer","title":"Passed Assertions","description":"Number of passed assertions","default":0},"failed_assertions":{"type":"integer","title":"Failed Assertions","description":"Number of failed assertions","default":0},"assertion_results":{"items":{"$ref":"#/components/schemas/AssertionResult"},"type":"array","title":"Assertion Results","description":"Detailed assertion results"},"conversation":{"anyOf":[{"items":{"$ref":"#/components/schemas/SimulatorTurn-Output"},"type":"array"},{"type":"null"}],"title":"Conversation","description":"Simulated conversation. Each assistant turn carries the structured events (handoffs, notes, priorities, labels) and tool_calls captured during agent execution."},"case_snapshot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Case Snapshot","description":"Definition of the case as it was when this result ran (name, scenario_blocks, assertions, termination, ...). Lets a historical run be shown with the exact scenario it executed even after the live case is edited or deleted. None for pre-feature results."},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Error message if case errored"},"eval_overhead_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eval Overhead Cost Usd","description":"Simulator + LLM judge cost (USD) for this case. ``None`` when the provider didn't report ``usage.cost`` or the case errored before any LLM call landed."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the result was created"}},"type":"object","required":["id","run_id","case_id","status","created_at"],"title":"EvalResult","description":"Full eval result model for a single test case execution."},"EvalResultStatus":{"type":"string","enum":["passed","failed","error"],"title":"EvalResultStatus","description":"Status of an eval result."},"EvalResultWithCase-Input":{"properties":{"id":{"type":"string","title":"Id","description":"Unique result ID"},"run_id":{"type":"string","title":"Run Id","description":"ID of the run this result belongs to"},"case_id":{"type":"string","title":"Case Id","description":"ID of the case that was executed"},"conversation_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Conversation Id","description":"ID of the conversation created during eval"},"status":{"$ref":"#/components/schemas/EvalResultStatus","description":"Status of this result"},"total_assertions":{"type":"integer","title":"Total Assertions","description":"Total number of assertions","default":0},"passed_assertions":{"type":"integer","title":"Passed Assertions","description":"Number of passed assertions","default":0},"failed_assertions":{"type":"integer","title":"Failed Assertions","description":"Number of failed assertions","default":0},"assertion_results":{"items":{"$ref":"#/components/schemas/AssertionResult"},"type":"array","title":"Assertion Results","description":"Detailed assertion results"},"conversation":{"anyOf":[{"items":{"$ref":"#/components/schemas/SimulatorTurn-Input"},"type":"array"},{"type":"null"}],"title":"Conversation","description":"Simulated conversation. Each assistant turn carries the structured events (handoffs, notes, priorities, labels) and tool_calls captured during agent execution."},"case_snapshot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Case Snapshot","description":"Definition of the case as it was when this result ran (name, scenario_blocks, assertions, termination, ...). Lets a historical run be shown with the exact scenario it executed even after the live case is edited or deleted. None for pre-feature results."},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Error message if case errored"},"eval_overhead_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eval Overhead Cost Usd","description":"Simulator + LLM judge cost (USD) for this case. ``None`` when the provider didn't report ``usage.cost`` or the case errored before any LLM call landed."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the result was created"},"case_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Case Name","description":"Name of the test case"},"case_scenario":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Case Scenario","description":"Scenario description"}},"type":"object","required":["id","run_id","case_id","status","created_at"],"title":"EvalResultWithCase","description":"Eval result with case details for display."},"EvalResultWithCase-Output":{"properties":{"id":{"type":"string","title":"Id","description":"Unique result ID"},"run_id":{"type":"string","title":"Run Id","description":"ID of the run this result belongs to"},"case_id":{"type":"string","title":"Case Id","description":"ID of the case that was executed"},"conversation_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Conversation Id","description":"ID of the conversation created during eval"},"status":{"$ref":"#/components/schemas/EvalResultStatus","description":"Status of this result"},"total_assertions":{"type":"integer","title":"Total Assertions","description":"Total number of assertions","default":0},"passed_assertions":{"type":"integer","title":"Passed Assertions","description":"Number of passed assertions","default":0},"failed_assertions":{"type":"integer","title":"Failed Assertions","description":"Number of failed assertions","default":0},"assertion_results":{"items":{"$ref":"#/components/schemas/AssertionResult"},"type":"array","title":"Assertion Results","description":"Detailed assertion results"},"conversation":{"anyOf":[{"items":{"$ref":"#/components/schemas/SimulatorTurn-Output"},"type":"array"},{"type":"null"}],"title":"Conversation","description":"Simulated conversation. Each assistant turn carries the structured events (handoffs, notes, priorities, labels) and tool_calls captured during agent execution."},"case_snapshot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Case Snapshot","description":"Definition of the case as it was when this result ran (name, scenario_blocks, assertions, termination, ...). Lets a historical run be shown with the exact scenario it executed even after the live case is edited or deleted. None for pre-feature results."},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Error message if case errored"},"eval_overhead_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eval Overhead Cost Usd","description":"Simulator + LLM judge cost (USD) for this case. ``None`` when the provider didn't report ``usage.cost`` or the case errored before any LLM call landed."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the result was created"},"case_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Case Name","description":"Name of the test case"},"case_scenario":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Case Scenario","description":"Scenario description"}},"type":"object","required":["id","run_id","case_id","status","created_at"],"title":"EvalResultWithCase","description":"Eval result with case details for display."},"EvalRun":{"properties":{"id":{"type":"string","title":"Id","description":"UUID assigned by the server."},"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name","description":"Operator-supplied label for the run, echoed back from ``EvalRunCreate.name``. ``None`` if the operator didn't name it; the UI falls back to the legacy ``v{n} · {playbook_name}`` auto-label."},"playbook_base_id":{"type":"string","title":"Playbook Base Id","description":"Base id of the playbook (groups all versions). Matches the URL param on creation."},"playbook_id":{"type":"string","title":"Playbook Id","description":"Frozen id of the specific playbook version under test."},"status":{"$ref":"#/components/schemas/EvalRunStatus","description":"Lifecycle state. ``pending`` until the background worker picks it up, ``running`` while cases execute, ``completed`` if all finished, ``failed`` if the runner itself errored (vs individual case failures), ``cancelled`` if a ``POST /eval-runs/{id}/cancel`` landed before completion."},"trigger_source":{"$ref":"#/components/schemas/EvalTriggerSource","description":"Source that triggered this run."},"total_cases":{"type":"integer","title":"Total Cases","description":"Number of enabled cases the run was scheduled to walk (frozen at creation time).","default":0},"passed_cases":{"type":"integer","title":"Passed Cases","description":"Cases that have passed so far. Increments live during execution.","default":0},"failed_cases":{"type":"integer","title":"Failed Cases","description":"Cases with at least one failed assertion so far. Does NOT include internal errors — those count under ``error_cases``.","default":0},"error_cases":{"type":"integer","title":"Error Cases","description":"Cases aborted by eval infrastructure (provider 429s/timeouts that survive retries, unparseable judge output). Surfaced separately from ``failed_cases`` so an infra blip never reads as a regression of the assistant under test. Per-case detail on ``EvalResult.error_message``.","default":0},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Top-level run error — populated when the runner itself crashed (not when individual cases failed assertions). Per-case errors live on ``EvalResult.error_message``."},"user_context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Context","description":"The ``user_context`` dict that was supplied at run creation (echoed back for audit)."},"model":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Model","description":"Per-run model override that was applied. ``None`` means the playbook's compiled model was used. Same syntax as ``EvalRunCreate.model``."},"simulator_model":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Simulator Model","description":"Simulator model used for this run; ``None`` means the env-default applied (``EVAL_SIMULATOR_MODEL``)."},"judge_model":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Judge Model","description":"Judge / evaluator model used for ``text`` assertion grading on this run; ``None`` means the env-default applied (``EVAL_EVALUATOR_MODEL``)."},"eval_overhead_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eval Overhead Cost Usd","description":"OpenRouter cost (USD) of the eval-only LLM calls — user simulator + LLM judge — summed across all cases in this run. ``None`` while the run is still pending and when the provider didn't report ``usage.cost``. Distinct from the playbook conversation cost, which is tracked separately on ``playbook_conversations``."},"render_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Render Job Id","description":"Render one-off job id (``job-…``) executing this run, when eval runs are offloaded to Render jobs (production). ``None`` ⇒ the run executed (or will execute) in-process on the API server."},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At","description":"When the run started"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"When the run completed"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the run was created"}},"type":"object","required":["id","playbook_base_id","playbook_id","status","trigger_source","created_at"],"title":"EvalRun","description":"One eval run row. Returned by ``POST /playbooks/{base_id}/eval-runs``\non creation (status=``pending``) and by ``GET /eval-runs/{run_id}`` /\n``GET /playbooks/{base_id}/eval-runs`` for progress polling.\n\nStatus lifecycle: ``pending`` → ``running`` → (``completed`` |\n``failed`` | ``cancelled``). Counters (``passed_cases`` / ``failed_cases``)\nincrement as each case finishes — for parallel runs (concurrency > 1) the\nincrements are not in case-order."},"EvalRunCost":{"properties":{"run_id":{"type":"string","title":"Run Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Operator-supplied run label, if any."},"playbook_id":{"type":"string","title":"Playbook Id","description":"Version-specific playbook id under test."},"playbook_base_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id","description":"Base id grouping all versions of the playbook."},"playbook_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Name"},"status":{"type":"string","title":"Status","description":"pending / running / completed / failed / cancelled"},"trigger_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Source"},"simulator_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Simulator Model"},"judge_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Judge Model","description":"Stored on the DB column ``evaluator_model``."},"eval_overhead_cost_usd":{"type":"number","title":"Eval Overhead Cost Usd","description":"Sum of simulator + LLM-judge OpenRouter cost across all cases in this run.","default":0.0},"total_cases":{"type":"integer","title":"Total Cases","default":0},"passed_cases":{"type":"integer","title":"Passed Cases","default":0},"failed_cases":{"type":"integer","title":"Failed Cases","default":0},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["run_id","playbook_id","status","created_at"],"title":"EvalRunCost","description":"One eval run row with its OpenRouter overhead cost."},"EvalRunCostList":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/EvalRunCost"},"type":"array","title":"Runs"},"total":{"type":"integer","title":"Total","description":"Total runs matching the filters (before pagination)."},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"total_eval_cost_usd":{"type":"number","title":"Total Eval Cost Usd","description":"Sum of ``eval_overhead_cost_usd`` across every matched run (not just the returned page).","default":0.0}},"type":"object","required":["runs","total","limit","offset"],"title":"EvalRunCostList"},"EvalRunCreate":{"properties":{"playbook_id":{"type":"string","title":"Playbook Id","description":"ID of the specific playbook version to test. This is the row id from ``GET /playbooks/{base_id}/history`` (NOT the base id), so an eval run always targets a frozen version. The base id stays in the URL path.","examples":["pb-v1-uuid-0000-000000000000"]},"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name","description":"Optional human-readable label for the run. Free-form; surfaced in the runs list and the diff page header so operators can recognise a run without parsing its UUID. Useful when a single playbook gets eval'd multiple times in a session (e.g. \"baseline\" / \"after prompt tweak\" / \"with claude judge\"). Leave unset for the legacy ``v{n} · …`` auto-label.","examples":["baseline","after prompt tweak","judge=claude-3.5"]},"trigger_source":{"$ref":"#/components/schemas/EvalTriggerSource","description":"Where the run was triggered from. Persisted on the run row for audit + filtering; not behavioural. ``api`` is the right choice for skill / automated callers; ``ui`` is reserved for the dashboard; ``cli`` for developer scripts; ``cron`` for scheduled jobs.","default":"api"},"user_context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Context","description":"Optional JSON object merged into every case's ``ctx.deps.context`` at runtime. Use the ``eval_overrides`` sub-namespace for ground-truth values judges and prompts can read directly (priority, tags, handoff target, etc.). Per-case overrides on ``EvalCase.user_context`` win over this run-level value on key collision (shallow merge, including inside ``eval_overrides``).","examples":[{"eval_overrides":{"country":"argentina","priority":"high"}}]},"model":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Model","description":"Optional model override applied to every case in this run. Sits at the top of the resolver chain (override > playbook.model > account.default > env). Same OpenRouter-compatible syntax the admin panel exposes:\n\n  - ``provider/model_id`` — single provider call (e.g. ``openai-direct/gpt-4o-mini``, ``groq/llama-3.3-70b-versatile``).\n  - ``primary{timeout}fallback`` — primary attempted first; on timeout in seconds, falls back to the second model.\n  - ``modelA:50,modelB:50`` — A/B experiment; conversation_id is hashed to deterministically assign each case to one of the variants. Percentages must sum to exactly 100.\n\nValidation: at the API edge we run the same parsers the resolver uses + an extra check that experiment percentages sum to 100 and a single-model input contains a ``provider/`` separator. Bad input ⇒ 422. Empty / whitespace ⇒ stored as NULL (use playbook default).","examples":["openai-direct/gpt-4o-mini","groq/llama-3.3-70b-versatile{8}openai-direct/gpt-4o-mini","openai/gpt-4o-mini:50,anthropic/claude-3.5-sonnet:50"]},"concurrency":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Concurrency","description":"Number of cases to run in parallel for this run. Range 1..5; default ``1`` preserves the historical sequential walk (zero overhead, same cancel-mid-run semantics).\n\nHigher values fan cases out across a ``ThreadPoolExecutor``. Each case opens its own SQLAlchemy session (held for the whole case) and asyncio loop, so internal state is isolated. The ceiling is intentionally low: several eval runs execute at once (one Render one-off job per playbook-version save) and all share one Postgres ``max_connections`` budget, so per-run fan-out is bounded rather than multiplied by the uncapped number of concurrent runs. Mind provider rate limits too — beyond ~5 concurrent cases, simulator/agent 429s start surfacing in ``EvalResult.error_message`` as flakiness.","default":1,"examples":[1,3,5]},"simulator_model":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Simulator Model","description":"Optional model override for the conversation simulator — the LLM that role-plays the user during each case. One model: ``openai-direct/<model>[reasoning=…,service-tier=…]`` calls OpenAI directly (temperature 0.7 only with ``reasoning=none``); anything else is sent to OpenRouter as the model id. Leave unset to use the ``EVAL_SIMULATOR_MODEL`` env default (code default ``openai-direct/gpt-6-sol[reasoning=low,service-tier=flex]``). Note: the simulator system prompt assumes a chat-completion model that follows user-role instructions; specialized completions or embeddings models will misbehave.","examples":["openai-direct/gpt-6-sol[reasoning=low,service-tier=flex]","anthropic/claude-sonnet-4.6"]},"judge_model":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Judge Model","description":"Optional model override for the judge / evaluator — the LLM that grades ``text``-type assertions. Structured assertions (tool_called, tool_not_called, handoff, tag_added, etc.) run deterministic checks and do NOT consult this model, so changing it only affects free-form criteria. Same syntax as ``simulator_model``. Leave unset to use the ``EVAL_EVALUATOR_MODEL`` env default (code default ``openai-direct/gpt-6-sol[reasoning=low,service-tier=flex]``).","examples":["openai-direct/gpt-6-sol[reasoning=low,service-tier=flex]","anthropic/claude-sonnet-4.6"]},"judge_mode":{"anyOf":[{"type":"string","enum":["llm","jev_then_llm","shadow"]},{"type":"null"}],"title":"Judge Mode","description":"Which judge decides ``text`` assertions. Structured assertions are always deterministic and ignore this. Unset means ``jev_then_llm`` on a deployment with ``TYPESAFE_API_KEY`` and ``llm`` otherwise.\n\n  - ``llm``: the LLM judge grades every text assertion.\n  - ``jev_then_llm`` (the default where jev is configured): once the termination gate passes, ONE call per case to TypeSafe's jev model asks about every text assertion. jev settles an assertion only as a confident PASS (probability ≥ ``jev_pass_threshold`` and confidence ≥ ``jev_confidence_floor``; with the defaults, probability ≥ 0.8), and those passes carry no LLM explanation. Everything else (jev fails, uncertain answers, audit samples) goes to the LLM judge unchanged. If jev is down or misconfigured, the whole case goes to the LLM judge. Removes most LLM judge calls on passing cases.\n  - ``shadow``: the LLM judge decides everything, exactly as in ``llm``; jev also runs and its numbers are recorded on each ``AssertionResult``, for calibration.\n\nAsking for a mode other than ``llm`` on a deployment without ``TYPESAFE_API_KEY`` is rejected with 422.","examples":["llm","jev_then_llm","shadow"]},"jev_confidence_floor":{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0,"title":"Jev Confidence Floor","description":"``jev_then_llm`` / ``shadow`` only: the minimum confidence for jev to settle a pass. jev's yes/no answers report no confidence, so it is derived from jev's probability p as ``min(1, 2·|p − jev_pass_threshold|)``.","default":0.6},"jev_pass_threshold":{"type":"number","exclusiveMaximum":1.0,"exclusiveMinimum":0.0,"title":"Jev Pass Threshold","description":"``jev_then_llm`` / ``shadow`` only: the probability at or above which jev's answer counts as a pass. It is also the center of the derived confidence, so jev settles a pass only when p ≥ jev_pass_threshold + jev_confidence_floor / 2.","default":0.5},"jev_audit_rate":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Jev Audit Rate","description":"``jev_then_llm`` only: the fraction of jev-settled passes that are ALSO sent to the LLM judge, whose verdict then wins. Sampling hashes the run, case and assertion, so it is deterministic within a run. ``0`` (the default) audits nothing.","default":0.0},"playbook_override":{"anyOf":[{"$ref":"#/components/schemas/PlaybookOverride"},{"type":"null"}],"description":"Optional ephemeral playbook overrides applied to every case in this run. Each non-null field replaces the corresponding field on the saved playbook version in memory — nothing is persisted. Use this to validate an unsaved set of instructions / skills (casuísticas) against the full case suite before promoting a new version."},"case_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Case Ids","description":"Optional explicit list of case IDs to run. When set, ONLY these cases execute — the ``is_enabled`` flag is ignored, so operators can target a subset (or even disabled cases) without toggling the rest off. When unset (the default), every enabled case for the playbook runs, preserving the historical behaviour. Empty list ⇒ 400 (use unset to mean \"all enabled\").","examples":[["case-uuid-1","case-uuid-2"]]}},"type":"object","required":["playbook_id"],"title":"EvalRunCreate","description":"Request body for ``POST /playbooks/{base_id}/eval-runs`` — triggers\na new eval run against the named playbook version.\n\nThe endpoint returns ``202 Accepted`` immediately with a pending\n``EvalRun`` row; the actual case execution happens in a background\ntask. Poll ``GET /eval-runs/{run_id}`` (or the listing endpoint) to\nwatch progress.\n\nValidation errors return ``422`` with a useful detail message — see\nthe per-field constraints below."},"EvalRunDiff":{"properties":{"run_a":{"$ref":"#/components/schemas/EvalRun"},"run_b":{"$ref":"#/components/schemas/EvalRun"},"cases":{"items":{"$ref":"#/components/schemas/EvalCaseDiff"},"type":"array","title":"Cases"}},"type":"object","required":["run_a","run_b"],"title":"EvalRunDiff","description":"Pair of runs + per-case diffs. ``cases`` is sorted alphabetically by\nname so the FE can render directly without re-sorting."},"EvalRunStatus":{"type":"string","enum":["pending","running","completed","failed","cancelled"],"title":"EvalRunStatus","description":"Status of an eval run."},"EvalRunWithDetails":{"properties":{"id":{"type":"string","title":"Id","description":"UUID assigned by the server."},"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name","description":"Operator-supplied label for the run, echoed back from ``EvalRunCreate.name``. ``None`` if the operator didn't name it; the UI falls back to the legacy ``v{n} · {playbook_name}`` auto-label."},"playbook_base_id":{"type":"string","title":"Playbook Base Id","description":"Base id of the playbook (groups all versions). Matches the URL param on creation."},"playbook_id":{"type":"string","title":"Playbook Id","description":"Frozen id of the specific playbook version under test."},"status":{"$ref":"#/components/schemas/EvalRunStatus","description":"Lifecycle state. ``pending`` until the background worker picks it up, ``running`` while cases execute, ``completed`` if all finished, ``failed`` if the runner itself errored (vs individual case failures), ``cancelled`` if a ``POST /eval-runs/{id}/cancel`` landed before completion."},"trigger_source":{"$ref":"#/components/schemas/EvalTriggerSource","description":"Source that triggered this run."},"total_cases":{"type":"integer","title":"Total Cases","description":"Number of enabled cases the run was scheduled to walk (frozen at creation time).","default":0},"passed_cases":{"type":"integer","title":"Passed Cases","description":"Cases that have passed so far. Increments live during execution.","default":0},"failed_cases":{"type":"integer","title":"Failed Cases","description":"Cases with at least one failed assertion so far. Does NOT include internal errors — those count under ``error_cases``.","default":0},"error_cases":{"type":"integer","title":"Error Cases","description":"Cases aborted by eval infrastructure (provider 429s/timeouts that survive retries, unparseable judge output). Surfaced separately from ``failed_cases`` so an infra blip never reads as a regression of the assistant under test. Per-case detail on ``EvalResult.error_message``.","default":0},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Top-level run error — populated when the runner itself crashed (not when individual cases failed assertions). Per-case errors live on ``EvalResult.error_message``."},"user_context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Context","description":"The ``user_context`` dict that was supplied at run creation (echoed back for audit)."},"model":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Model","description":"Per-run model override that was applied. ``None`` means the playbook's compiled model was used. Same syntax as ``EvalRunCreate.model``."},"simulator_model":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Simulator Model","description":"Simulator model used for this run; ``None`` means the env-default applied (``EVAL_SIMULATOR_MODEL``)."},"judge_model":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Judge Model","description":"Judge / evaluator model used for ``text`` assertion grading on this run; ``None`` means the env-default applied (``EVAL_EVALUATOR_MODEL``)."},"eval_overhead_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eval Overhead Cost Usd","description":"OpenRouter cost (USD) of the eval-only LLM calls — user simulator + LLM judge — summed across all cases in this run. ``None`` while the run is still pending and when the provider didn't report ``usage.cost``. Distinct from the playbook conversation cost, which is tracked separately on ``playbook_conversations``."},"render_job_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Render Job Id","description":"Render one-off job id (``job-…``) executing this run, when eval runs are offloaded to Render jobs (production). ``None`` ⇒ the run executed (or will execute) in-process on the API server."},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At","description":"When the run started"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"When the run completed"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the run was created"},"playbook_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Name","description":"Name of the playbook"},"playbook_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Playbook Version","description":"Version number of the playbook"}},"type":"object","required":["id","playbook_base_id","playbook_id","status","trigger_source","created_at"],"title":"EvalRunWithDetails","description":"Eval run with additional details for display."},"EvalRunsPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/EvalRunWithDetails"},"type":"array","title":"Items","description":"List of eval runs"},"total":{"type":"integer","title":"Total","description":"Total number of runs"},"page":{"type":"integer","title":"Page","description":"Current page (1-indexed)"},"page_size":{"type":"integer","title":"Page Size","description":"Items per page"},"total_pages":{"type":"integer","title":"Total Pages","description":"Total number of pages"}},"type":"object","required":["items","total","page","page_size","total_pages"],"title":"EvalRunsPage","description":"Paginated response for eval runs."},"EvalTriggerSource":{"type":"string","enum":["api","ui","cli","cron","version_modal","ci"],"title":"EvalTriggerSource","description":"Source that triggered the eval run."},"EventTypeCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Description"},"duration_minutes":{"type":"integer","maximum":480.0,"minimum":5.0,"title":"Duration Minutes"},"slot_interval_minutes":{"anyOf":[{"type":"integer","maximum":240.0,"minimum":5.0},{"type":"null"}],"title":"Slot Interval Minutes","description":"Minutes between possible starts. Null = the duration."},"timezone":{"type":"string","title":"Timezone","description":"IANA time zone of the weekly schedule"},"weekly_schedule":{"$ref":"#/components/schemas/WeeklySchedule-Input"},"member_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Member Ids","description":"The people of this meeting type. Null = every person of the team, including new ones."},"mode":{"anyOf":[{"type":"string","enum":["any","all"]},{"type":"null"}],"title":"Mode","description":"any = times when at least one is free (assigned at random); all = every one free"},"location_type":{"anyOf":[{"type":"string","enum":["google_meet","in_person","attendee_address","none"]},{"type":"null"}],"title":"Location Type"},"location_value":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Location Value","description":"The address, for location_type in_person"},"buffer_minutes":{"anyOf":[{"type":"integer","maximum":240.0,"minimum":0.0},{"type":"null"}],"title":"Buffer Minutes"},"min_notice_minutes":{"anyOf":[{"type":"integer","maximum":20160.0,"minimum":0.0},{"type":"null"}],"title":"Min Notice Minutes"},"max_days_ahead":{"anyOf":[{"type":"integer","maximum":90.0,"minimum":1.0},{"type":"null"}],"title":"Max Days Ahead"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},"additionalProperties":false,"type":"object","required":["name","duration_minutes","timezone","weekly_schedule"],"title":"EventTypeCreate"},"EventTypeUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Description"},"duration_minutes":{"anyOf":[{"type":"integer","maximum":480.0,"minimum":5.0},{"type":"null"}],"title":"Duration Minutes"},"slot_interval_minutes":{"anyOf":[{"type":"integer","maximum":240.0,"minimum":5.0},{"type":"null"}],"title":"Slot Interval Minutes","description":"Minutes between possible starts. Null = the duration."},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone","description":"IANA time zone of the weekly schedule"},"weekly_schedule":{"anyOf":[{"$ref":"#/components/schemas/WeeklySchedule-Input"},{"type":"null"}]},"member_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Member Ids","description":"The people of this meeting type. Null = every person of the team, including new ones."},"mode":{"anyOf":[{"type":"string","enum":["any","all"]},{"type":"null"}],"title":"Mode","description":"any = times when at least one is free (assigned at random); all = every one free"},"location_type":{"anyOf":[{"type":"string","enum":["google_meet","in_person","attendee_address","none"]},{"type":"null"}],"title":"Location Type"},"location_value":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Location Value","description":"The address, for location_type in_person"},"buffer_minutes":{"anyOf":[{"type":"integer","maximum":240.0,"minimum":0.0},{"type":"null"}],"title":"Buffer Minutes"},"min_notice_minutes":{"anyOf":[{"type":"integer","maximum":20160.0,"minimum":0.0},{"type":"null"}],"title":"Min Notice Minutes"},"max_days_ahead":{"anyOf":[{"type":"integer","maximum":90.0,"minimum":1.0},{"type":"null"}],"title":"Max Days Ahead"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},"additionalProperties":false,"type":"object","title":"EventTypeUpdate","description":"Partial update: only the fields sent change. ``member_ids: null`` means every person."},"ExampleBlock":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id"},"examples":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Examples"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"is_archived":{"type":"boolean","title":"Is Archived","default":false},"archived_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Archived At"}},"type":"object","required":["id","project_id","examples","created_at","updated_at"],"title":"ExampleBlock","description":"Full example block model returned from API."},"ExampleBlockCreate":{"properties":{"examples":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Examples","description":"Array of example conversations"}},"type":"object","title":"ExampleBlockCreate","description":"Model for creating an example block."},"ExampleBlockUpdate":{"properties":{"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Updated example conversations"}},"type":"object","title":"ExampleBlockUpdate","description":"Model for updating an example block."},"ExampleConversation":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"Conversation UUID"},"summary":{"type":"string","title":"Summary","description":"Brief summary of the conversation"},"sentiment":{"type":"string","title":"Sentiment","description":"Conversation sentiment: positive, neutral, or negative","default":"neutral"},"resources":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resources","description":"Resources relevance: relevant, partial, irrelevant, or null"},"has_handoff":{"type":"boolean","title":"Has Handoff","description":"Whether conversation had a handoff to human","default":false},"last_activity":{"type":"string","title":"Last Activity","description":"Last activity date","default":""}},"type":"object","required":["conversation_id","summary"],"title":"ExampleConversation","description":"An example conversation for a topic with summary and indicator metadata."},"ExampleRef":{"properties":{"example_id":{"type":"string","title":"Example Id","description":"Unique example ID (5-char alphanumeric) used in <<example_id>> notation"},"turns":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Turns","description":"The example conversation turns [{role, content}]"}},"type":"object","required":["example_id","turns"],"title":"ExampleRef","description":"Reference to an example conversation used by the assistant in its response.\n\nThe LLM marks which example it followed using <<example_id>> in its response.\nThese markers are stripped and converted to ExampleRef objects for the frontend."},"ExportPdfRequest":{"properties":{"html":{"type":"string","title":"Html","description":"Full HTML content to convert to PDF"},"filename":{"type":"string","title":"Filename","description":"Desired filename for the PDF","default":"session.pdf"}},"type":"object","required":["html"],"title":"ExportPdfRequest"},"ExternalHandoffRequest":{"properties":{"error_type":{"type":"string","title":"Error Type","description":"Error type for the chat log entry (e.g., 'unsupported_media')","default":"external_handoff","examples":["unsupported_media"]}},"type":"object","title":"ExternalHandoffRequest","description":"Request body for marking a conversation as handed off externally."},"FAQItem":{"properties":{"id":{"type":"string","title":"Id","description":"Unique ID for this FAQ item"},"questions":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Questions","description":"List of questions (at least one required)"},"answer":{"type":"string","title":"Answer","description":"The answer for these questions"},"notes":{"anyOf":[{"items":{"$ref":"#/components/schemas/NoteItem"},"type":"array"},{"type":"null"}],"title":"Notes","description":"Correction notes injected into RAG search results"}},"type":"object","required":["questions","answer"],"title":"FAQItem","description":"A single FAQ item with questions and answer."},"FAQKnowledgeBaseCreate":{"properties":{"title":{"type":"string","title":"Title","description":"Title of the knowledge base"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"Optional markdown-formatted instructions for LLM when using this KB"},"metadata_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Fields","description":"Optional list of additional metadata field names to extract from retrieved chunks"},"faq_items":{"items":{"$ref":"#/components/schemas/FAQItem"},"type":"array","minItems":1,"title":"Faq Items","description":"List of FAQ items (at least one required)"},"kb_type":{"$ref":"#/components/schemas/KnowledgeBaseType","description":"Knowledge base type (always FAQ)","default":"faq"}},"type":"object","required":["title","faq_items"],"title":"FAQKnowledgeBaseCreate","description":"Model for creating a FAQ knowledge base."},"FailedPolicy":{"properties":{"policy_id":{"type":"string","title":"Policy Id"},"display_name":{"type":"string","title":"Display Name"},"policy_hash":{"type":"string","title":"Policy Hash"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"rationale":{"type":"string","title":"Rationale"}},"type":"object","required":["policy_id","display_name","policy_hash","category","rationale"],"title":"FailedPolicy","description":"One failed-policy entry inside a hit row. Multiple appear\nwhen a single message tripped more than one policy (today: 1 policy\nin REGISTRY, so always exactly one)."},"FeatureFlagState":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"description":{"type":"string","title":"Description"},"kind":{"type":"string","title":"Kind"},"value":{"anyOf":[{},{"type":"null"}],"title":"Value"},"default":{"title":"Default"},"effective":{"title":"Effective"},"client_visible":{"type":"boolean","title":"Client Visible"},"minimum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Minimum"},"maximum":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Maximum"},"presets":{"items":{"prefixItems":[{"type":"string"},{"type":"number"}],"type":"array","maxItems":2,"minItems":2},"type":"array","title":"Presets","default":[]}},"type":"object","required":["key","label","description","kind","default","effective","client_visible"],"title":"FeatureFlagState","description":"One flag for one account, with the whole fallback chain visible.\n\n``value`` is what the account stores (null = no override), ``default`` what\nit falls back to, ``effective`` what applies right now — the panel renders\nthe chain without knowing the rules."},"FeatureFlagUpdate":{"properties":{"value":{"anyOf":[{},{"type":"null"}],"title":"Value"}},"type":"object","title":"FeatureFlagUpdate","description":"Set an override, or clear it with an explicit null so it falls back."},"FeatureFlagsResponse":{"properties":{"account_id":{"type":"string","title":"Account Id"},"flags":{"items":{"$ref":"#/components/schemas/FeatureFlagState"},"type":"array","title":"Flags"}},"type":"object","required":["account_id","flags"],"title":"FeatureFlagsResponse"},"FgtMintRequest":{"properties":{"agent_name":{"type":"string","maxLength":100,"minLength":1,"title":"Agent Name"},"scopes":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Scopes"},"accounts":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Accounts"},"token_prefix":{"type":"string","maxLength":16,"minLength":4,"title":"Token Prefix"},"token_hash":{"type":"string","maxLength":64,"minLength":64,"title":"Token Hash"}},"type":"object","required":["agent_name","scopes","token_prefix","token_hash"],"title":"FgtMintRequest","description":"Mint request. Carries the token's PREFIX and HASH, never the token.\n\nThe panel generates the credential in the browser (crypto.getRandomValues +\nSHA-256) and sends only what the server needs to store. Same contract the FGT\nmanagement API already uses, for the same reason: a plaintext the server\nnever receives cannot leak from a server log, a trace, or an APM payload.\nThe operator's browser is the only place it ever exists."},"FgtMintResponse":{"properties":{"action":{"type":"string","title":"Action"},"revoked_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revoked Prefix"},"items":{"items":{"$ref":"#/components/schemas/FgtTokenRow"},"type":"array","title":"Items"}},"type":"object","required":["action","revoked_prefix","items"],"title":"FgtMintResponse"},"FgtReconcileRequest":{"properties":{"permissions":{"additionalProperties":true,"type":"object","title":"Permissions"},"token_prefix":{"type":"string","maxLength":16,"minLength":4,"title":"Token Prefix"},"token_hash":{"type":"string","maxLength":64,"minLength":64,"title":"Token Hash"}},"type":"object","required":["permissions","token_prefix","token_hash"],"title":"FgtReconcileRequest"},"FgtReconcileResponse":{"properties":{"action":{"type":"string","title":"Action"},"prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prefix"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"}},"type":"object","required":["action","prefix","scopes"],"title":"FgtReconcileResponse"},"FgtScope":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"}},"type":"object","required":["name","description"],"title":"FgtScope"},"FgtScopeListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FgtScope"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"FgtScopeListResponse"},"FgtTokenListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FgtTokenRow"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"FgtTokenListResponse"},"FgtTokenRow":{"properties":{"id":{"type":"string","title":"Id"},"agent_name":{"type":"string","title":"Agent Name"},"token_prefix":{"type":"string","title":"Token Prefix"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"accounts":{"items":{"type":"string"},"type":"array","title":"Accounts"},"active":{"type":"boolean","title":"Active"},"created_by_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Email"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","agent_name","token_prefix","scopes","accounts","active","created_by_email","created_at","expires_at","last_used_at","revoked_at"],"title":"FgtTokenRow","description":"One minted agt_ token. Never carries the token itself — only the hash is\nstored, and the display prefix is all that can ever be shown again."},"FgtTokenState":{"properties":{"agent_name":{"type":"string","title":"Agent Name"},"active":{"type":"boolean","title":"Active"},"prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prefix"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"}},"type":"object","required":["agent_name","active","prefix","scopes"],"title":"FgtTokenState"},"FileEventData":{"properties":{"url":{"type":"string","title":"Url","description":"Public URL of the file"},"kind":{"type":"string","enum":["document","video","audio"],"title":"Kind","description":"What the file is"},"caption":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caption","description":"Caption / text to show with the file"},"media_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Type","description":"MIME type"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Filename to present"},"asset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset Id","description":"Library file id"}},"additionalProperties":false,"type":"object","required":["url","kind"],"title":"FileEventData","description":"A non-image file (document, video, audio) to deliver as a native attachment.\n\nOnly emitted when the request declared it accepts that kind\n(``accepts_attachments``); a bridge that never said so gets a message with\nthe link instead, because its event enum would reject this type."},"FinanceBlock":{"properties":{"label":{"type":"string","title":"Label"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","description":"Standalone account ID matching the priced name. Null for the Global aggregate, or when no account with this name exists yet."},"price_cents_per_resolved":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Cents Per Resolved","description":"Null on Global (mixed prices); int on per-account blocks."},"price_basis":{"type":"string","title":"Price Basis","description":"What the price is billed against: 'resolved' (per deflected conversation) or 'conversation' (per total conversation).","default":"resolved"},"current":{"$ref":"#/components/schemas/FinanceMetrics"},"previous":{"$ref":"#/components/schemas/FinanceMetrics"},"diff":{"$ref":"#/components/schemas/FinanceDiff"}},"type":"object","required":["label","current","previous","diff"],"title":"FinanceBlock"},"FinanceDiff":{"properties":{"cost_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Pct"},"revenue_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Revenue Pct"},"margin_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Margin Pct"},"resolved_conversations_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Resolved Conversations Pct"}},"type":"object","required":["cost_pct","revenue_pct","margin_pct","resolved_conversations_pct"],"title":"FinanceDiff","description":"Percent change from previous to current. `null` when previous is\nzero (undefined %) — the FE renders that as 'new'."},"FinanceMetrics":{"properties":{"cost_usd":{"type":"number","title":"Cost Usd","description":"playbook_cost_usd + postprocessing_cost_usd (total LLM spend)"},"playbook_cost_usd":{"type":"number","title":"Playbook Cost Usd","description":"Playbook-agent LLM spend (ChatMessage.cost_usd sum)","default":0.0},"postprocessing_cost_usd":{"type":"number","title":"Postprocessing Cost Usd","description":"Conversation-metrics scoring LLM spend (ConversationMetrics.cost_usd sum)","default":0.0},"revenue_usd":{"type":"number","title":"Revenue Usd"},"margin_usd":{"type":"number","title":"Margin Usd"},"margin_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Margin Pct","description":"margin / revenue * 100, or null when revenue is zero."},"resolved_conversations":{"type":"integer","title":"Resolved Conversations"},"total_conversations":{"type":"integer","title":"Total Conversations"}},"type":"object","required":["cost_usd","revenue_usd","margin_usd","resolved_conversations","total_conversations"],"title":"FinanceMetrics"},"FinanceResponse":{"properties":{"month":{"type":"string","title":"Month","description":"YYYY-MM. Echoed back so the FE can confirm."},"is_current_month":{"type":"boolean","title":"Is Current Month"},"period_label":{"type":"string","title":"Period Label","description":"Human label for the window — e.g. 'May 1 – May 5, 2026 (MTD)' for the current month, 'April 2026' for a past month."},"current_window_start":{"type":"string","format":"date-time","title":"Current Window Start"},"current_window_end":{"type":"string","format":"date-time","title":"Current Window End"},"previous_window_start":{"type":"string","format":"date-time","title":"Previous Window Start"},"previous_window_end":{"type":"string","format":"date-time","title":"Previous Window End"},"global_block":{"$ref":"#/components/schemas/FinanceBlock"},"accounts":{"items":{"$ref":"#/components/schemas/FinanceBlock"},"type":"array","title":"Accounts"}},"type":"object","required":["month","is_current_month","period_label","current_window_start","current_window_end","previous_window_start","previous_window_end","global_block","accounts"],"title":"FinanceResponse"},"FlowEventData":{"properties":{"set_id":{"type":"string","title":"Set Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"rumo_flow_id":{"type":"integer","title":"Rumo Flow Id"},"inbox_id":{"type":"integer","title":"Inbox Id"},"cta":{"type":"string","title":"Cta"},"body":{"type":"string","title":"Body"},"header":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Header"},"footer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Footer"},"screen":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Screen"},"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Prefill, resolved"},"ref":{"type":"string","title":"Ref","description":"fs:<set id>"},"fallback_template":{"anyOf":[{"$ref":"#/components/schemas/TemplateEventData"},{"type":"null"}],"description":"Sent instead when Rumo answers 422 window_closed"},"fallback_text":{"type":"string","title":"Fallback Text","description":"Text to send on any other refusal or where flows can't go","default":""},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"Same as fallback_text, for a caller that renders text only"}},"additionalProperties":false,"type":"object","required":["set_id","rumo_flow_id","inbox_id","cta","body","ref"],"title":"FlowEventData","description":"A WhatsApp Flow from a flow set (app/rumo_sets.py), ready for Rumo's flow message endpoint."},"FlowSet":{"properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","title":"Id","examples":["agendar_visita"]},"label":{"type":"string","maxLength":60,"minLength":1,"title":"Label","examples":["Agendar visita"]},"rumo_flow_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Rumo Flow Id","description":"The Rumo library flow id (not Meta's id)."},"inbox_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Inbox Id","description":"The Rumo inbox (WhatsApp Cloud) the flow belongs to."},"cta":{"type":"string","maxLength":30,"minLength":1,"title":"Cta","description":"Button text, no emoji."},"body":{"type":"string","maxLength":1024,"minLength":1,"title":"Body"},"header":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Header"},"footer":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Footer"},"screen":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Screen","description":"First screen; null: the flow's own first screen."},"prefill":{"additionalProperties":{"type":"string"},"type":"object","title":"Prefill","description":"Initial values: fixed text with {{contact.*}} pills, or exactly $model.<param>.","examples":[{"motivo":"$model.motivo","nombre":"{{contact.name}}"}]},"when_to_use":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"When To Use","description":"Prose for the assistant."},"fallback_template_set_id":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}],"title":"Fallback Template Set Id","description":"Template set sent instead when the 24h window is closed."},"fallback_text":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Fallback Text","description":"Text sent where the flow can't go (other channels, a refusal). Null: the body."}},"additionalProperties":false,"type":"object","required":["id","label","rumo_flow_id","inbox_id","cta","body"],"title":"FlowSet","description":"A WhatsApp Flow (a Rumo library flow) the assistant sends by id (``{{ flow: id }}``).\n\nThe server sends it as an interactive flow message while the 24h window is\nopen; outside it the ``fallback_template_set_id`` goes instead (a template\nwith a FLOW button), or the text fallback plus a private note."},"FollowupAnalyticsResponse":{"properties":{"total_sent":{"type":"integer","title":"Total Sent"},"answered":{"type":"integer","title":"Answered"},"conversations":{"type":"integer","title":"Conversations"},"by_step":{"items":{"$ref":"#/components/schemas/FollowupStepStat"},"type":"array","title":"By Step"},"time_series":{"items":{"$ref":"#/components/schemas/FollowupTimeSeriesPoint"},"type":"array","title":"Time Series"},"recent":{"items":{"$ref":"#/components/schemas/FollowupRecentItem"},"type":"array","title":"Recent"}},"type":"object","required":["total_sent","answered","conversations"],"title":"FollowupAnalyticsResponse"},"FollowupHours":{"properties":{"timezone":{"type":"string","title":"Timezone","description":"IANA timezone the slots are read in (e.g. 'America/Mexico_City')"},"weekly_schedule":{"$ref":"#/components/schemas/WeeklySchedule-Output","description":"Days and slots when follow-ups may go out"},"enabled":{"type":"boolean","title":"Enabled","description":"false = no window: follow-ups go out at any hour","default":true},"id":{"type":"string","title":"Id","description":"Unique id"},"project_id":{"type":"string","title":"Project Id","description":"Project (account workspace) these hours belong to"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the window was first set"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When it was last changed"}},"type":"object","required":["timezone","weekly_schedule","id","project_id","created_at","updated_at"],"title":"FollowupHours","description":"An account's follow-up hours, as stored."},"FollowupHoursUpdate":{"properties":{"timezone":{"type":"string","title":"Timezone","description":"IANA timezone the slots are read in (e.g. 'America/Mexico_City')"},"weekly_schedule":{"$ref":"#/components/schemas/WeeklySchedule-Input","description":"Days and slots when follow-ups may go out"},"enabled":{"type":"boolean","title":"Enabled","description":"false = no window: follow-ups go out at any hour","default":true}},"type":"object","required":["timezone","weekly_schedule"],"title":"FollowupHoursUpdate","description":"Set an account's follow-up hours (PUT replaces the whole window)."},"FollowupRecentItem":{"properties":{"id":{"type":"string","title":"Id"},"conversation_id":{"type":"string","title":"Conversation Id"},"rule_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Id"},"step_index":{"type":"integer","title":"Step Index"},"delay_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delay Minutes"},"transport":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transport"},"answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Answered At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","conversation_id","step_index","created_at"],"title":"FollowupRecentItem"},"FollowupStepStat":{"properties":{"step_index":{"type":"integer","title":"Step Index"},"delay_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delay Minutes"},"sent":{"type":"integer","title":"Sent"},"answered":{"type":"integer","title":"Answered"}},"type":"object","required":["step_index","sent","answered"],"title":"FollowupStepStat","description":"One rung of the funnel: the Nth attempt, under one configured delay.\n\nA step that was edited inside the window comes back as several rungs,\none per delay it ran with, so the old and the new rhythm can be compared."},"FollowupTimeSeriesPoint":{"properties":{"date":{"type":"string","title":"Date"},"count":{"type":"integer","title":"Count"},"success_count":{"type":"integer","title":"Success Count"}},"type":"object","required":["date","count","success_count"],"title":"FollowupTimeSeriesPoint"},"GDriveConfigResponse":{"properties":{"configured":{"type":"boolean","title":"Configured"},"service_account_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Account Email"}},"type":"object","required":["configured"],"title":"GDriveConfigResponse","description":"Response model for Google Drive configuration."},"GDriveItem":{"properties":{"id":{"type":"string","title":"Id","description":"Unique ID for RAG tracking"},"gdrive_file_id":{"type":"string","title":"Gdrive File Id","description":"Original Google Drive file ID"},"title":{"type":"string","title":"Title","description":"File name/title"},"content":{"type":"string","title":"Content","description":"Text/markdown content (editable)"},"mime_type":{"type":"string","title":"Mime Type","description":"MIME type of the original file"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id","description":"Parent GDriveItem.id for hierarchy (None = root)"},"depth":{"type":"integer","title":"Depth","description":"Nesting level (0 = root)","default":0},"last_imported_at":{"type":"string","format":"date-time","title":"Last Imported At","description":"When this file was imported"},"last_edited_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Edited At","description":"When user manually edited content"},"gdrive_last_modified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Gdrive Last Modified At","description":"Last modified time from Google Drive"},"is_manually_edited":{"type":"boolean","title":"Is Manually Edited","description":"Track if content was manually edited","default":false},"notes":{"anyOf":[{"items":{"$ref":"#/components/schemas/NoteItem"},"type":"array"},{"type":"null"}],"title":"Notes","description":"Correction notes injected into RAG search results"}},"type":"object","required":["gdrive_file_id","title","content","mime_type"],"title":"GDriveItem","description":"A single Google Drive file item stored flat with parent reference for tree structure."},"GDriveItemUpdate":{"properties":{"content":{"type":"string","title":"Content","description":"New content"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Optional title update"}},"type":"object","required":["content"],"title":"GDriveItemUpdate","description":"Request model for updating a Google Drive item's content."},"GDriveKBCreate":{"properties":{"title":{"type":"string","title":"Title","description":"Knowledge base title"},"gdrive_folder_id":{"type":"string","title":"Gdrive Folder Id","description":"Google Drive folder or file URL/ID"}},"type":"object","required":["title","gdrive_folder_id"],"title":"GDriveKBCreate","description":"Request model for creating a Google Drive knowledge base."},"GDrivePreviewJobRequest":{"properties":{"folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Folder Id","description":"Folder ID or URL to import from"},"file_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"File Ids","description":"Specific file IDs to import"}},"type":"object","title":"GDrivePreviewJobRequest","description":"Request model for starting a Google Drive preview job.\n\nNote: Uses server-side service account credentials, not user-provided OAuth tokens."},"GDrivePreviewJobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id","description":"Unique job ID to poll for progress"}},"type":"object","required":["job_id"],"title":"GDrivePreviewJobResponse","description":"Response model for starting a Google Drive preview job."},"GDriveReimportResponse":{"properties":{"knowledgebase":{"$ref":"#/components/schemas/KnowledgeBase"},"edited_files_overwritten":{"items":{"type":"string"},"type":"array","title":"Edited Files Overwritten","description":"Titles of manually edited files that were overwritten"}},"type":"object","required":["knowledgebase"],"title":"GDriveReimportResponse","description":"Response model for Google Drive reimport."},"GDriveValidateRequest":{"properties":{"folder_id":{"type":"string","title":"Folder Id","description":"Google Drive folder or file URL/ID"}},"type":"object","required":["folder_id"],"title":"GDriveValidateRequest","description":"Request model for validating Google Drive folder access."},"GDriveValidateResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Type"},"item_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Item Count"},"tree_preview":{"anyOf":[{"items":{"$ref":"#/components/schemas/TreePreviewNode-Output"},"type":"array"},{"type":"null"}],"title":"Tree Preview"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["valid"],"title":"GDriveValidateResponse","description":"Response model for Google Drive validation."},"GroupChatMessageInfo":{"properties":{"id":{"type":"integer","title":"Id","description":"Unique message ID"},"sender_id":{"type":"string","title":"Sender Id","description":"ID of the sender persona"},"sender_name":{"type":"string","title":"Sender Name","description":"Display name of the sender"},"sender_type":{"type":"string","title":"Sender Type","description":"Type of sender: 'customer', 'agent', or 'assistant'"},"content":{"type":"string","title":"Content","description":"Message content"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp","description":"When the message was sent"},"message_index":{"type":"integer","title":"Message Index","description":"Order of message in conversation"},"events":{"anyOf":[{"items":{"$ref":"#/components/schemas/ConversationEventModel"},"type":"array"},{"type":"null"}],"title":"Events","description":"Events from assistant response (only for assistant messages)"},"tool_calls":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Tool Calls","description":"Tool calls made (only for assistant messages)"},"explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation","description":"Assistant explanation (only for assistant messages)"}},"type":"object","required":["id","sender_id","sender_name","sender_type","content","timestamp","message_index"],"title":"GroupChatMessageInfo","description":"Information about a single group chat message."},"GroupChatMessageRequest":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"Unique conversation identifier for tracking group chat state","examples":["group_conv_123456"]},"message":{"type":"string","title":"Message","description":"The message content","examples":["Hello, I need help with my order"]},"sender_id":{"type":"string","title":"Sender Id","description":"Unique ID of the sender persona","examples":["persona_customer_1"]},"sender_name":{"type":"string","title":"Sender Name","description":"Display name of the sender","examples":["Customer"]},"sender_type":{"type":"string","enum":["customer","agent"],"title":"Sender Type","description":"Type of sender: 'customer' or 'agent' (not 'assistant' - that's the AI)"}},"type":"object","required":["conversation_id","message","sender_id","sender_name","sender_type"],"title":"GroupChatMessageRequest","description":"Request to send a message in a group chat preview."},"GroupChatMessageResponse":{"properties":{"should_respond":{"type":"boolean","title":"Should Respond","description":"Whether the assistant decided to respond to this message"},"decision_reason":{"type":"string","title":"Decision Reason","description":"Explanation of why the assistant did or did not respond"},"message_id":{"type":"integer","title":"Message Id","description":"ID of the saved incoming message"},"assistant_response":{"anyOf":[{"$ref":"#/components/schemas/PlaybookChatResponse"},{"type":"null"}],"description":"The assistant's response (if should_respond is True)"},"assistant_message_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Assistant Message Id","description":"ID of the assistant's message (if should_respond is True)"}},"type":"object","required":["should_respond","decision_reason","message_id"],"title":"GroupChatMessageResponse","description":"Response from sending a group chat message."},"GroupChatMessagesResponse":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/GroupChatMessageInfo"},"type":"array","title":"Messages","description":"List of messages in chronological order"},"total":{"type":"integer","title":"Total","description":"Total number of messages in the conversation"}},"type":"object","required":["messages","total"],"title":"GroupChatMessagesResponse","description":"Response for listing group chat messages."},"GuardrailBucket":{"properties":{"bucket_start":{"type":"string","format":"date-time","title":"Bucket Start"},"total":{"type":"integer","title":"Total"},"violations":{"type":"integer","title":"Violations"},"violations_reviewed":{"type":"integer","title":"Violations Reviewed"}},"type":"object","required":["bucket_start","total","violations","violations_reviewed"],"title":"GuardrailBucket","description":"One time-slice for the timeline chart at the top of the view.\n\n`violations` is operator-effective: passed=false AND not yet\nreviewed (i.e. still in the queue). `violations_reviewed` is the\ncomplement — passed=false AND already reviewed/dismissed by an\noperator — exposed separately so the chart's \"Include reviewed\"\ntoggle can stack it on top of the open hits without touching the\nqueue semantics the rest of the panel depends on."},"GuardrailFailedPolicy":{"properties":{"policy_id":{"type":"string","title":"Policy Id"},"display_name":{"type":"string","title":"Display Name"},"policy_hash":{"type":"string","title":"Policy Hash"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"rationale":{"type":"string","title":"Rationale"}},"type":"object","required":["policy_id","display_name","policy_hash","category","rationale"],"title":"GuardrailFailedPolicy","description":"One failed-policy entry inside a violation row. Multiple appear\nwhen a single message tripped more than one policy (today: 1 policy\nin REGISTRY, so always exactly one)."},"GuardrailHit":{"properties":{"id":{"type":"string","title":"Id"},"evaluated_at":{"type":"string","format":"date-time","title":"Evaluated At"},"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"account_type":{"type":"string","title":"Account Type"},"kaption_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Kaption Account Id"},"project_id":{"type":"string","title":"Project Id"},"project_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Name"},"playbook_base_id":{"type":"string","title":"Playbook Base Id"},"playbook_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Name"},"conversation_id":{"type":"string","title":"Conversation Id"},"audited_text":{"type":"string","title":"Audited Text"},"evaluator":{"type":"string","title":"Evaluator"},"evaluator_model":{"type":"string","title":"Evaluator Model"},"latency_ms":{"type":"integer","title":"Latency Ms"},"passed":{"type":"boolean","title":"Passed"},"failed_policies":{"items":{"$ref":"#/components/schemas/FailedPolicy"},"type":"array","title":"Failed Policies"},"reviewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reviewed At"},"reviewed_by_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewed By Email"},"reviewer_disposition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer Disposition"},"reviewer_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer Notes"}},"type":"object","required":["id","evaluated_at","account_id","account_name","account_type","kaption_account_id","project_id","project_name","playbook_base_id","playbook_name","conversation_id","audited_text","evaluator","evaluator_model","latency_ms","passed","failed_policies","reviewed_at","reviewed_by_email","reviewer_disposition","reviewer_notes"],"title":"GuardrailHit","description":"One row of `guardrail_checks` flattened with account / project /\nplaybook names inlined so consumers don't need a second round-trip\nper row."},"GuardrailHitsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/GuardrailHit"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total","description":"Total rows matching the filter, before limit/offset."},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"start_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Date"}},"type":"object","required":["items","total","limit","offset","start_date","end_date"],"title":"GuardrailHitsResponse"},"GuardrailOverviewResponse":{"properties":{"month":{"type":"string","title":"Month","description":"YYYY-MM. Echoed back so the FE can confirm."},"is_current_month":{"type":"boolean","title":"Is Current Month"},"period_label":{"type":"string","title":"Period Label","description":"Human label like 'May 1 – May 5, 2026 (MTD)' or 'April 2026'."},"current_window_start":{"type":"string","format":"date-time","title":"Current Window Start"},"current_window_end":{"type":"string","format":"date-time","title":"Current Window End"},"previous_window_start":{"type":"string","format":"date-time","title":"Previous Window Start"},"previous_window_end":{"type":"string","format":"date-time","title":"Previous Window End"},"bucket_seconds":{"type":"integer","title":"Bucket Seconds"},"current":{"$ref":"#/components/schemas/GuardrailWindowMetrics"},"previous":{"$ref":"#/components/schemas/GuardrailWindowMetrics"},"diff":{"$ref":"#/components/schemas/GuardrailWindowDiff"},"timeline":{"items":{"$ref":"#/components/schemas/GuardrailBucket"},"type":"array","title":"Timeline"},"policies":{"items":{"$ref":"#/components/schemas/GuardrailPolicyStats"},"type":"array","title":"Policies"}},"type":"object","required":["month","is_current_month","period_label","current_window_start","current_window_end","previous_window_start","previous_window_end","bucket_seconds","current","previous","diff","timeline","policies"],"title":"GuardrailOverviewResponse","description":"Top-of-page payload: KPIs + diff + timeline + per-policy table.\n\nThe violations list is fetched separately via\n`/superadmin/guardrails/violations` so the table can paginate without\nrewinding the chart."},"GuardrailPoliciesResponse":{"properties":{"policies":{"items":{"$ref":"#/components/schemas/GuardrailPolicyInfo"},"type":"array","title":"Policies"}},"type":"object","required":["policies"],"title":"GuardrailPoliciesResponse"},"GuardrailPolicyInfo":{"properties":{"id":{"type":"string","title":"Id"},"display_name":{"type":"string","title":"Display Name"},"description":{"type":"string","title":"Description"},"categories":{"items":{"type":"string"},"type":"array","title":"Categories"}},"type":"object","required":["id","display_name","description"],"title":"GuardrailPolicyInfo"},"GuardrailPolicyStats":{"properties":{"policy_id":{"type":"string","title":"Policy Id"},"display_name":{"type":"string","title":"Display Name"},"latest_hash":{"type":"string","title":"Latest Hash"},"latest_version_pk":{"type":"string","title":"Latest Version Pk"},"versions_seen_in_window":{"type":"integer","title":"Versions Seen In Window"},"evaluations":{"type":"integer","title":"Evaluations"},"violations":{"type":"integer","title":"Violations"}},"type":"object","required":["policy_id","display_name","latest_hash","latest_version_pk","versions_seen_in_window","evaluations","violations"],"title":"GuardrailPolicyStats","description":"One row per registered policy, keyed by `policy_id`. The version\nfields describe the *latest registered* row (i.e. what new evaluations\nwill stamp); the eval/violation counts cover every version that fired\nin the window — `versions_seen` flags whether a deploy bumped mid-window."},"GuardrailTestRequest":{"properties":{"content":{"type":"string","maxLength":4000,"minLength":1,"title":"Content","description":"Assistant message to classify."},"policy_id":{"type":"string","title":"Policy Id","description":"Policy to run. Defaults to account_disclosure.","default":"account_disclosure"}},"type":"object","required":["content"],"title":"GuardrailTestRequest"},"GuardrailTestResponse":{"properties":{"policy_id":{"type":"string","title":"Policy Id"},"hit":{"type":"boolean","title":"Hit"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"rationale":{"type":"string","title":"Rationale"},"latency_ms":{"type":"integer","title":"Latency Ms"}},"type":"object","required":["policy_id","hit","category","rationale","latency_ms"],"title":"GuardrailTestResponse"},"GuardrailViolationItem":{"properties":{"id":{"type":"string","title":"Id"},"evaluated_at":{"type":"string","format":"date-time","title":"Evaluated At"},"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"project_id":{"type":"string","title":"Project Id"},"project_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Name"},"conversation_id":{"type":"string","title":"Conversation Id"},"audited_text":{"type":"string","title":"Audited Text"},"evaluator":{"type":"string","title":"Evaluator"},"evaluator_model":{"type":"string","title":"Evaluator Model"},"latency_ms":{"type":"integer","title":"Latency Ms"},"failed_policies":{"items":{"$ref":"#/components/schemas/GuardrailFailedPolicy"},"type":"array","title":"Failed Policies"},"reviewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reviewed At"},"reviewed_by_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewed By Email"},"reviewer_disposition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer Disposition"},"reviewer_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer Notes"}},"type":"object","required":["id","evaluated_at","account_id","account_name","project_id","project_name","conversation_id","audited_text","evaluator","evaluator_model","latency_ms","failed_policies","reviewed_at","reviewed_by_email","reviewer_disposition","reviewer_notes"],"title":"GuardrailViolationItem","description":"One row in the paginated violations table. Account/project names\nare inlined so the FE doesn't need a second round-trip per row.\n\nReview fields are always included so the FE can render dismissed\nrows (when `include_reviewed=true`) with the operator + timestamp\n+ optional notes inline."},"GuardrailViolationsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/GuardrailViolationItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"month":{"type":"string","title":"Month"},"is_current_month":{"type":"boolean","title":"Is Current Month"},"period_label":{"type":"string","title":"Period Label"},"current_window_start":{"type":"string","format":"date-time","title":"Current Window Start"},"current_window_end":{"type":"string","format":"date-time","title":"Current Window End"},"include_reviewed":{"type":"boolean","title":"Include Reviewed"}},"type":"object","required":["items","total","limit","offset","month","is_current_month","period_label","current_window_start","current_window_end","include_reviewed"],"title":"GuardrailViolationsResponse"},"GuardrailWindowDiff":{"properties":{"total_evaluations_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Evaluations Pct"},"total_violations_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Violations Pct"},"pass_rate_pp":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pass Rate Pp"}},"type":"object","required":["total_evaluations_pct","total_violations_pct","pass_rate_pp"],"title":"GuardrailWindowDiff","description":"Period-over-period diffs. Volume goes as relative %, pass-rate as\nabsolute percentage points (75% → 80% = +5pp), because that's how\noperators reason about each."},"GuardrailWindowMetrics":{"properties":{"total_evaluations":{"type":"integer","title":"Total Evaluations"},"total_violations":{"type":"integer","title":"Total Violations"},"pass_rate_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pass Rate Pct","description":"100 * (1 - violations/total). Null when total=0 (undefined)."},"avg_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Latency Ms"},"p50_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"P50 Latency Ms"},"p95_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"P95 Latency Ms"}},"type":"object","required":["total_evaluations","total_violations","avg_latency_ms","p50_latency_ms","p95_latency_ms"],"title":"GuardrailWindowMetrics","description":"Aggregable counters for a window — current or previous."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HandoffAgentAssertion":{"properties":{"type":{"type":"string","const":"handoff_to_agent","title":"Type","default":"handoff_to_agent"},"agent_id":{"anyOf":[{"type":"integer"},{"type":"string","const":"any"}],"title":"Agent Id","description":"Specific agent id, or 'any'"}},"type":"object","required":["agent_id"],"title":"HandoffAgentAssertion","description":"Assert that a ``handoff_agent`` event was emitted with the given agent_id.\n\n``agent_id`` accepts ``\"any\"`` to assert *any* agent handoff (matches the\nupstream HandoffAgentEventData semantics)."},"HandoffAgentEventData-Input":{"properties":{"agent_id":{"anyOf":[{"type":"integer"},{"type":"string","const":"any"},{"type":"null"}],"title":"Agent Id","description":"Agent ID, 'any', or None for standalone accounts"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Reason for the handoff"},"tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool","description":"The assistant's handoff tool that made this handoff"}},"additionalProperties":false,"type":"object","title":"HandoffAgentEventData","description":"Data for agent handoff event.\n\nFor KAPTION accounts: agent_id should be an int or \"any\"\nFor STANDALONE accounts: agent_id can be None (empty handoff)"},"HandoffAgentEventData-Output":{"additionalProperties":true,"type":"object"},"HandoffAssertion":{"properties":{"type":{"type":"string","const":"handoff","title":"Type","default":"handoff"}},"type":"object","title":"HandoffAssertion","description":"Assert that *some* handoff event (agent or team) was emitted.\n\nMode-agnostic: standalone accounts only know \"the agent handed off\"\n(no agent/team distinction), so this is the only handoff assertion the\nstandalone UI surfaces. Kaption surfaces this plus the more specific\n:class:`HandoffAgentAssertion` and :class:`HandoffTeamAssertion`."},"HandoffTeamAssertion":{"properties":{"type":{"type":"string","const":"handoff_to_team","title":"Type","default":"handoff_to_team"},"team_id":{"type":"integer","title":"Team Id","description":"Team id to assert handoff for"}},"type":"object","required":["team_id"],"title":"HandoffTeamAssertion","description":"Assert that a ``handoff_team`` event was emitted for the given team_id."},"HandoffTeamEventData":{"properties":{"team_id":{"type":"integer","title":"Team Id","description":"Team ID"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Reason for the handoff"}},"additionalProperties":false,"type":"object","required":["team_id"],"title":"HandoffTeamEventData","description":"Data for team handoff event."},"HomeAssistantCostsResponse":{"properties":{"month_start":{"type":"string","title":"Month Start","description":"YYYY-MM-DD (UTC) — first day of the current month."},"total_usd":{"type":"number","title":"Total Usd"},"previous_total_usd":{"type":"number","title":"Previous Total Usd","description":"Same elapsed span at the start of the previous month — the MTD diff baseline.","default":0.0},"by_client":{"items":{"$ref":"#/components/schemas/HomeClientCost"},"type":"array","title":"By Client","description":"Sorted by cost desc."}},"type":"object","required":["month_start","total_usd","by_client"],"title":"HomeAssistantCostsResponse"},"HomeCacheDay":{"properties":{"date":{"type":"string","title":"Date"},"cached_tokens":{"type":"integer","title":"Cached Tokens"},"uncached_tokens":{"type":"integer","title":"Uncached Tokens"}},"type":"object","required":["date","cached_tokens","uncached_tokens"],"title":"HomeCacheDay"},"HomeCacheResponse":{"properties":{"hit_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hit Rate","description":"cache_read / input across the whole window, capped at 1. Null when no input tokens."},"previous_hit_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Previous Hit Rate","description":"Same ratio over the 7 days before the window — the diff baseline."},"cached_tokens":{"type":"integer","title":"Cached Tokens"},"uncached_tokens":{"type":"integer","title":"Uncached Tokens"},"days":{"items":{"$ref":"#/components/schemas/HomeCacheDay"},"type":"array","title":"Days"}},"type":"object","required":["cached_tokens","uncached_tokens","days"],"title":"HomeCacheResponse"},"HomeClientCost":{"properties":{"client":{"type":"string","title":"Client","description":"Priced-client slug when the account matches RESOLVED_CONVERSATION_PRICING_CENTS, otherwise the account name."},"is_priced":{"type":"boolean","title":"Is Priced"},"cost_usd":{"type":"number","title":"Cost Usd"}},"type":"object","required":["client","is_priced","cost_usd"],"title":"HomeClientCost"},"HomeOneOffClientCost":{"properties":{"client":{"type":"string","title":"Client"},"is_priced":{"type":"boolean","title":"Is Priced"},"cost_usd":{"type":"number","title":"Cost Usd"},"runs":{"type":"integer","title":"Runs","description":"llm_usage_events rows — LLM calls, not report/alert executions."}},"type":"object","required":["client","is_priced","cost_usd","runs"],"title":"HomeOneOffClientCost"},"HomeOneOffCostsResponse":{"properties":{"month_start":{"type":"string","title":"Month Start"},"total_usd":{"type":"number","title":"Total Usd"},"previous_total_usd":{"type":"number","title":"Previous Total Usd","default":0.0},"reports_usd":{"type":"number","title":"Reports Usd","description":"The `report_run` half of total_usd.","default":0.0},"alerts_usd":{"type":"number","title":"Alerts Usd","description":"The `alert_run` half of total_usd.","default":0.0},"by_client":{"items":{"$ref":"#/components/schemas/HomeOneOffClientCost"},"type":"array","title":"By Client","description":"Sorted by cost desc."}},"type":"object","required":["month_start","total_usd","by_client"],"title":"HomeOneOffCostsResponse","description":"Month-to-date spend of the one-off Sami runs: scheduled reports and\nalert evaluations.\n\nThese never touch `sami_sessions` — a one-off run emits `report_run` /\n`alert_run` rows on `llm_usage_events` instead — so they are invisible\non the Sami sessions card, and they are the half of Sami spend that\ngrows with the schedule rather than with the operators using it."},"HomePnlMtdResponse":{"properties":{"month_start":{"type":"string","title":"Month Start"},"income_usd":{"type":"number","title":"Income Usd"},"cost_usd":{"type":"number","title":"Cost Usd"},"net_usd":{"type":"number","title":"Net Usd"},"previous_income_usd":{"type":"number","title":"Previous Income Usd"},"previous_cost_usd":{"type":"number","title":"Previous Cost Usd"},"previous_net_usd":{"type":"number","title":"Previous Net Usd"}},"type":"object","required":["month_start","income_usd","cost_usd","net_usd","previous_income_usd","previous_cost_usd","previous_net_usd"],"title":"HomePnlMtdResponse","description":"Global month-to-date P&L: invoiced income across every priced client\nminus ALL LLM cost (every source, Sami and background included)."},"HomeSamiClientCost":{"properties":{"client":{"type":"string","title":"Client"},"is_priced":{"type":"boolean","title":"Is Priced"},"cost_usd":{"type":"number","title":"Cost Usd"},"sessions":{"type":"integer","title":"Sessions"}},"type":"object","required":["client","is_priced","cost_usd","sessions"],"title":"HomeSamiClientCost"},"HomeSamiCostsResponse":{"properties":{"month_start":{"type":"string","title":"Month Start"},"total_usd":{"type":"number","title":"Total Usd"},"previous_total_usd":{"type":"number","title":"Previous Total Usd","default":0.0},"by_client":{"items":{"$ref":"#/components/schemas/HomeSamiClientCost"},"type":"array","title":"By Client"}},"type":"object","required":["month_start","total_usd","by_client"],"title":"HomeSamiCostsResponse"},"HomeSpend7dResponse":{"properties":{"total_usd":{"type":"number","title":"Total Usd"},"days":{"items":{"$ref":"#/components/schemas/HomeSpendDay"},"type":"array","title":"Days"}},"type":"object","required":["total_usd","days"],"title":"HomeSpend7dResponse"},"HomeSpendDay":{"properties":{"date":{"type":"string","title":"Date"},"total_usd":{"type":"number","title":"Total Usd"},"by_client":{"additionalProperties":{"type":"number"},"type":"object","title":"By Client","description":"Priced-client slugs plus 'other'. Sparse — missing keys mean 0."}},"type":"object","required":["date","total_usd","by_client"],"title":"HomeSpendDay"},"HomeTrafficDay":{"properties":{"date":{"type":"string","title":"Date"},"total":{"type":"integer","title":"Total"},"resolved":{"type":"integer","title":"Resolved","description":"Conversations with has_handoff=False that day — feeds the deflection line.","default":0},"by_client":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Client","description":"Priced-client slugs plus 'other'. Sparse — missing keys mean 0."}},"type":"object","required":["date","total","by_client"],"title":"HomeTrafficDay"},"HomeTrafficResponse":{"properties":{"total":{"type":"integer","title":"Total"},"previous_total":{"type":"integer","title":"Previous Total","description":"Conversations in the 7 days before the window.","default":0},"days":{"items":{"$ref":"#/components/schemas/HomeTrafficDay"},"type":"array","title":"Days"}},"type":"object","required":["total","days"],"title":"HomeTrafficResponse"},"ImageEventData":{"properties":{"url":{"type":"string","title":"Url","description":"Public URL of the image (fitted under 5 MB / 2000 px)"},"caption":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caption","description":"Caption to show with the image"},"media_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Type","description":"MIME type"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Filename to present"},"asset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Asset Id","description":"Library file id"}},"additionalProperties":false,"type":"object","required":["url"],"title":"ImageEventData","description":"An image from the media library to deliver to the person.\n\n``url`` and ``caption`` are the two keys every bridge's IMAGE handler reads\ntoday; the rest is extra context a bridge may use (a filename for the\nupload-token platforms, the file id for the Chat Log)."},"ImpersonateResponse":{"properties":{"session_token":{"type":"string","title":"Session Token"},"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"target_user_id":{"type":"integer","title":"Target User Id"},"target_username":{"type":"string","title":"Target Username"},"target_is_admin":{"type":"boolean","title":"Target Is Admin"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["session_token","account_id","account_name","target_user_id","target_username","target_is_admin","expires_at"],"title":"ImpersonateResponse","description":"Returned after a successful POST to /accounts/{id}/impersonate.\n\nThe FE drops `session_token` into localStorage under the standalone\nsession key and opens the main dashboard — the same flow as a\nnormal `/auth/login` response. `expires_at` is surfaced so the UI\ncan warn the operator before the short-lived token expires."},"ImportFromJobRequest":{"properties":{"name":{"type":"string","title":"Name","description":"Name for the new knowledge base"},"project_id":{"type":"string","title":"Project Id","description":"Project ID to create the KB in"},"kb_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Id","description":"Optional KB ID for reimport mode. If provided, updates existing KB instead of creating new."}},"type":"object","required":["name","project_id"],"title":"ImportFromJobRequest","description":"Request model for creating KB from staged import job."},"ImportFromJobResponse":{"properties":{"knowledgebase_id":{"type":"string","title":"Knowledgebase Id","description":"ID of the created knowledge base"},"items_imported":{"type":"integer","title":"Items Imported","description":"Number of items imported"},"no_changes_detected":{"type":"boolean","title":"No Changes Detected","description":"True on reimport when the staged items match the KB's current content. The UI can skip the Sync Required state and show a 'nothing to sync' confirmation instead.","default":false}},"type":"object","required":["knowledgebase_id","items_imported"],"title":"ImportFromJobResponse","description":"Response model for importing from a job."},"ImportJobItemResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique item ID"},"source_item_id":{"type":"string","title":"Source Item Id","description":"Original source ID (notion_page_id, gdrive_file_id, etc.)"},"title":{"type":"string","title":"Title","description":"Item title"},"parent_source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Source Id","description":"Parent's source ID for tree structure"},"depth":{"type":"integer","title":"Depth","description":"Nesting level (0 = root)","default":0},"item_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Type","description":"Type: page, database, folder, file, article, collection"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Additional metadata (mime_type, state, url, etc.)"},"is_selected":{"type":"boolean","title":"Is Selected","description":"Whether this item is selected for import","default":true}},"type":"object","required":["id","source_item_id","title"],"title":"ImportJobItemResponse","description":"Response model for a staged import item."},"ImportJobResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique job ID"},"source_type":{"$ref":"#/components/schemas/ImportJobSourceType","description":"Source type: notion, gdrive, intercom, or pylon"},"status":{"$ref":"#/components/schemas/ImportJobStatus","description":"Current job status"},"progress_current":{"type":"integer","title":"Progress Current","description":"Number of items processed"},"progress_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress Total","description":"Total items to process (None if unknown)"},"progress_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Progress Message","description":"Current progress message for UI display"},"preview_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Preview Data","description":"Tree structure for selection UI (available when completed)"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Error message if job failed"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the job was created"}},"type":"object","required":["id","source_type","status","progress_current","created_at"],"title":"ImportJobResponse","description":"Response model for import job status polling."},"ImportJobSourceType":{"type":"string","enum":["notion","gdrive","intercom","pylon"],"title":"ImportJobSourceType","description":"Source type for import jobs."},"ImportJobStatus":{"type":"string","enum":["pending","running","completed","failed"],"title":"ImportJobStatus","description":"Status of an import job."},"InboxCallSettingsUpdate":{"properties":{"calls_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Calls Enabled"},"answer_after_hours":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Answer After Hours"},"ring_assignee_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ring Assignee Only"},"pass_now":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pass Now"},"take_message_when_unassigned":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Take Message When Unassigned"}},"type":"object","title":"InboxCallSettingsUpdate"},"InboxPlaybookInfo":{"properties":{"playbook_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Id","description":"ID of the deployed playbook (null if no playbook)"},"playbook_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Name","description":"Name of the deployed playbook"},"playbook_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Playbook Version","description":"Version of the deployed playbook"},"is_same_playbook":{"type":"boolean","title":"Is Same Playbook","description":"Whether this is the same playbook being compared","default":false},"is_older_version":{"type":"boolean","title":"Is Older Version","description":"Whether deployed playbook is an older version","default":false},"is_current_version":{"type":"boolean","title":"Is Current Version","description":"Whether deployed playbook is the current version","default":false}},"type":"object","title":"InboxPlaybookInfo","description":"Information about a playbook deployed to an inbox."},"InboxSuggestionPlaybookResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Mapping ID"},"inbox_id":{"type":"string","title":"Inbox Id","description":"Chatwoot inbox ID"},"playbook_base_id":{"type":"string","title":"Playbook Base Id","description":"Base ID of the linked suggestion playbook"},"playbook_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Name","description":"Name of the linked suggestion playbook"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the link is active","default":true},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the mapping was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When the mapping was last updated"}},"type":"object","required":["id","inbox_id","playbook_base_id","created_at","updated_at"],"title":"InboxSuggestionPlaybookResponse","description":"Response for an inbox-to-suggestion-playbook mapping."},"InboxWithPlaybook":{"properties":{"id":{"type":"string","title":"Id","description":"Inbox ID"},"name":{"type":"string","title":"Name","description":"Inbox name"},"channel_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Type","description":"Channel type"},"deployed_playbook":{"anyOf":[{"$ref":"#/components/schemas/InboxPlaybookInfo"},{"type":"null"}],"description":"Deployed playbook information"}},"type":"object","required":["id","name"],"title":"InboxWithPlaybook","description":"Inbox information with deployed playbook details."},"InsightsAccountLine":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"billable_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billable Unit","description":"What the client is billed against: 'deflected' (no-handoff conversations) or 'all'. Null when the account has no pricing configured."},"unit_price_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unit Price Usd","description":"Price per billable conversation. Null when unpriced."},"billable_qty":{"type":"integer","title":"Billable Qty","description":"Conversations billed this bucket. 0 for an unpriced account.","default":0},"income_usd":{"type":"number","title":"Income Usd","description":"billable_qty x unit_price_usd. 0.0 for an unpriced account.","default":0.0},"cost_usd":{"type":"number","title":"Cost Usd","description":"This account's LLM spend in the bucket, every source.","default":0.0},"payments_received_usd":{"type":"number","title":"Payments Received Usd","description":"Cash that ARRIVED from this client inside the bucket (account_payments.paid_at), prepaid refills and post-paid alike. NOT the collection state of this period's invoice — June's invoice is paid in July — so billed minus this is not a debt.","default":0.0}},"type":"object","required":["account_id","account_name"],"title":"InsightsAccountLine","description":"One client's share of a bucket — the invoice line for that period.\n\nEverything except ``payments_received_usd`` is the per-account cell the\nbucket totals are already summed from; this just stops throwing it away."},"InsightsSeriesBucket":{"properties":{"bucket":{"type":"string","title":"Bucket"},"income_usd":{"type":"number","title":"Income Usd"},"cost_usd":{"type":"number","title":"Cost Usd"},"billable_qty":{"type":"integer","title":"Billable Qty"},"accounts":{"anyOf":[{"items":{"$ref":"#/components/schemas/InsightsAccountLine"},"type":"array"},{"type":"null"}],"title":"Accounts","description":"Per-client breakdown of this bucket, highest income first. Populated only when include_accounts=true; null otherwise — the existing chart keeps getting the same four numbers per bucket and never pays for a breakdown it does not draw."}},"type":"object","required":["bucket","income_usd","cost_usd","billable_qty"],"title":"InsightsSeriesBucket"},"InsightsSeriesResponse":{"properties":{"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"granularity":{"type":"string","title":"Granularity"},"buckets":{"items":{"$ref":"#/components/schemas/InsightsSeriesBucket"},"type":"array","title":"Buckets"}},"type":"object","required":["start_date","end_date","granularity","buckets"],"title":"InsightsSeriesResponse"},"IntercomCredentialsUpdate":{"properties":{"intercom_api_key":{"type":"string","title":"Intercom Api Key","description":"New Intercom API key"}},"type":"object","required":["intercom_api_key"],"title":"IntercomCredentialsUpdate","description":"Request model for updating Intercom credentials."},"IntercomEnrichmentStatus":{"properties":{"configured":{"type":"boolean","title":"Configured","description":"True when an API key has been saved for this project"},"enabled":{"type":"boolean","title":"Enabled","default":false},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced At"},"last_synced_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Synced Status"},"last_error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error Message"},"verification":{"anyOf":[{"$ref":"#/components/schemas/IntercomKeyCheckResponse"},{"type":"null"}],"description":"Set only on the save response that carried a new API key"}},"type":"object","required":["configured"],"title":"IntercomEnrichmentStatus"},"IntercomEnrichmentTestRequest":{"properties":{"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["api_key"],"title":"IntercomEnrichmentTestRequest"},"IntercomEnrichmentTestResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"workspace_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["valid"],"title":"IntercomEnrichmentTestResponse"},"IntercomEnrichmentUpsert":{"properties":{"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key","description":"Plain-text Intercom API key; encrypted before persisting. Omit (or send null) to update only `enabled` on an existing config."},"enabled":{"type":"boolean","title":"Enabled","description":"Whether the cron should process this project","default":true}},"type":"object","title":"IntercomEnrichmentUpsert"},"IntercomItem":{"properties":{"id":{"type":"string","title":"Id","description":"Unique ID for RAG tracking"},"intercom_article_id":{"type":"string","title":"Intercom Article Id","description":"Original Intercom article ID"},"title":{"type":"string","title":"Title","description":"Article title"},"content":{"type":"string","title":"Content","description":"Markdown content (converted from HTML)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Article description/summary"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id","description":"Parent IntercomItem.id for hierarchy (None = root)"},"parent_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Type","description":"Parent type: 'collection' or None"},"collection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Id","description":"Intercom collection ID this article belongs to"},"collection_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Name","description":"Name of the collection this article belongs to"},"collection_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Path","description":"Full hierarchy path (e.g., 'Parent > Child')"},"depth":{"type":"integer","title":"Depth","description":"Nesting level (0 = root)","default":0},"state":{"type":"string","title":"State","description":"Article state: 'published' or 'draft'","default":"published"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Public URL of the article"},"last_imported_at":{"type":"string","format":"date-time","title":"Last Imported At","description":"When this article was imported"},"last_edited_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Edited At","description":"When user manually edited content"},"intercom_last_modified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Intercom Last Modified At","description":"Last modified time from Intercom API"},"is_manually_edited":{"type":"boolean","title":"Is Manually Edited","description":"Track if content was manually edited","default":false},"notes":{"anyOf":[{"items":{"$ref":"#/components/schemas/NoteItem"},"type":"array"},{"type":"null"}],"title":"Notes","description":"Correction notes injected into RAG search results"}},"type":"object","required":["intercom_article_id","title","content"],"title":"IntercomItem","description":"A single Intercom Help Center article stored flat with parent reference for tree structure."},"IntercomItemUpdate":{"properties":{"content":{"type":"string","title":"Content","description":"New markdown content"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Optional title update"}},"type":"object","required":["content"],"title":"IntercomItemUpdate","description":"Request model for updating an Intercom article's content."},"IntercomKeyCheckResponse":{"properties":{"ok":{"type":"boolean","title":"Ok"},"status":{"type":"string","title":"Status","description":"ok | no_conversations | wrong_workspace | auth_error | rate_limited | error"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"sampled":{"type":"integer","title":"Sampled","description":"Most recent conversations of this project asked about","default":0},"found":{"type":"integer","title":"Found","description":"Of those, how many exist in the key's Intercom workspace","default":0},"with_rating":{"type":"integer","title":"With Rating","description":"Of those found, how many already carry a CSAT","default":0}},"type":"object","required":["ok","status"],"title":"IntercomKeyCheckResponse","description":"Whether a key sees THIS project's conversations, not just any conversations."},"IntercomKnowledgeBaseCreate":{"properties":{"title":{"type":"string","title":"Title","description":"Title of the knowledge base"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"Optional markdown-formatted instructions for LLM when using this KB"},"metadata_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Fields","description":"Optional list of additional metadata field names to extract from retrieved chunks"},"intercom_api_key":{"type":"string","title":"Intercom Api Key","description":"Intercom API access token (will be encrypted)"},"selected_article_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Selected Article Ids","description":"Optional list of article IDs to import (None = all)"},"include_drafts":{"type":"boolean","title":"Include Drafts","description":"Whether to include draft articles","default":false},"kb_type":{"$ref":"#/components/schemas/KnowledgeBaseType","description":"Knowledge base type (always INTERCOM)","default":"intercom"}},"type":"object","required":["title","intercom_api_key"],"title":"IntercomKnowledgeBaseCreate","description":"Model for creating an INTERCOM knowledge base.\n\nImports articles from Intercom Help Center using API key authentication.\nSupports selective import by article IDs and draft article inclusion."},"IntercomPreviewJobRequest":{"properties":{"access_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Token","description":"Intercom access token (optional in reimport)"},"include_drafts":{"type":"boolean","title":"Include Drafts","description":"Whether to include draft articles","default":false},"kb_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Id","description":"Existing KB ID (UUID) for reimport mode (to use stored credentials)"}},"type":"object","title":"IntercomPreviewJobRequest","description":"Request model for starting an Intercom preview job.\n\nIn reimport mode (kb_id provided), access_token is optional.\nIf not provided, it will be fetched from the existing KB."},"IntercomPreviewJobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id","description":"Unique job ID to poll for progress"}},"type":"object","required":["job_id"],"title":"IntercomPreviewJobResponse","description":"Response model for starting an Intercom preview job."},"IntercomPreviewRequest":{"properties":{"api_key":{"type":"string","title":"Api Key","description":"Intercom API access token"},"include_drafts":{"type":"boolean","title":"Include Drafts","description":"Whether to include draft articles","default":false}},"type":"object","required":["api_key"],"title":"IntercomPreviewRequest","description":"Request model for getting Intercom articles preview."},"IntercomPreviewResponse":{"properties":{"collections":{"items":{"$ref":"#/components/schemas/app__routers__intercom__CollectionPreview-Output"},"type":"array","title":"Collections"},"uncategorized":{"items":{"$ref":"#/components/schemas/app__routers__intercom__ArticlePreview"},"type":"array","title":"Uncategorized"},"total_count":{"type":"integer","title":"Total Count"}},"type":"object","required":["collections","uncategorized","total_count"],"title":"IntercomPreviewResponse","description":"Response model for Intercom articles preview."},"IntercomProbeRequest":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"Intercom conversation id to fetch"}},"type":"object","required":["conversation_id"],"title":"IntercomProbeRequest"},"IntercomProbeResponse":{"properties":{"ok":{"type":"boolean","title":"Ok","description":"True iff Intercom returned the conversation"},"status":{"type":"string","title":"Status","description":"ok | not_found | auth_error | rate_limited | error"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"has_rating":{"type":"boolean","title":"Has Rating","default":false},"rating":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rating"},"remark":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remark"},"rated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Rated At"},"matched_in_studio_chat":{"type":"boolean","title":"Matched In Studio Chat","default":false}},"type":"object","required":["ok","status"],"title":"IntercomProbeResponse"},"IntercomReimportResponse":{"properties":{"knowledgebase":{"$ref":"#/components/schemas/KnowledgeBase"},"edited_articles_overwritten":{"items":{"type":"string"},"type":"array","title":"Edited Articles Overwritten","description":"Titles of manually edited articles that were overwritten"},"no_changes_detected":{"type":"boolean","title":"No Changes Detected","description":"True when the Intercom fetch produced the same set of articles and content as the KB already had. The UI can show a 'nothing to sync' message instead of flipping the KB into the EDITED state.","default":false}},"type":"object","required":["knowledgebase"],"title":"IntercomReimportResponse","description":"Response model for Intercom reimport."},"IntercomSyncResponse":{"properties":{"project_id":{"type":"string","title":"Project Id"},"found":{"type":"integer","title":"Found"},"handoff_excluded":{"type":"integer","title":"Handoff Excluded"},"checked":{"type":"integer","title":"Checked"},"with_rating":{"type":"integer","title":"With Rating"},"upserted":{"type":"integer","title":"Upserted"},"not_in_intercom":{"type":"integer","title":"Not In Intercom"},"auth_errors":{"type":"integer","title":"Auth Errors"},"rate_limited":{"type":"integer","title":"Rate Limited"},"errors":{"type":"integer","title":"Errors"},"stopped_reason":{"type":"string","title":"Stopped Reason"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"}},"type":"object","required":["project_id","found","handoff_excluded","checked","with_rating","upserted","not_in_intercom","auth_errors","rate_limited","errors","stopped_reason"],"title":"IntercomSyncResponse"},"IntercomValidateRequest":{"properties":{"api_key":{"type":"string","title":"Api Key","description":"Intercom API access token"}},"type":"object","required":["api_key"],"title":"IntercomValidateRequest","description":"Request model for validating Intercom API key."},"IntercomValidateResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"app_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Name"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["valid"],"title":"IntercomValidateResponse","description":"Response model for Intercom API key validation."},"Invoice":{"properties":{"id":{"type":"string","title":"Id"},"invoice_number":{"type":"string","title":"Invoice Number"},"invoice_type":{"type":"string","title":"Invoice Type","default":"A"},"customer_name":{"type":"string","title":"Customer Name"},"cuit":{"type":"string","title":"Cuit"},"contact_email":{"type":"string","title":"Contact Email"},"issued_at":{"type":"string","format":"date-time","title":"Issued At"},"due_at":{"type":"string","format":"date-time","title":"Due At"},"amount":{"type":"number","title":"Amount"},"currency":{"type":"string","title":"Currency","default":"ARS"},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"days_overdue":{"type":"integer","title":"Days Overdue","default":0}},"type":"object","required":["id","invoice_number","customer_name","cuit","contact_email","issued_at","due_at","amount","status"],"title":"Invoice"},"InvoiceStatus":{"type":"string","enum":["pending","paid","overdue"],"title":"InvoiceStatus"},"IssueNotificationConfigResponse":{"properties":{"project_id":{"type":"string","title":"Project Id"},"is_enabled":{"type":"boolean","title":"Is Enabled"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"items":{"type":"string"},"type":"array","title":"Email Recipients"},"notify_on_new_issue":{"type":"boolean","title":"Notify On New Issue"},"notify_on_new_followup":{"type":"boolean","title":"Notify On New Followup"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["project_id","is_enabled","slack_channel","email_recipients","notify_on_new_issue","notify_on_new_followup"],"title":"IssueNotificationConfigResponse"},"IssueNotificationConfigUpdate":{"properties":{"is_enabled":{"type":"boolean","title":"Is Enabled","default":true},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Recipients"},"notify_on_new_issue":{"type":"boolean","title":"Notify On New Issue","default":true},"notify_on_new_followup":{"type":"boolean","title":"Notify On New Followup","default":true}},"type":"object","title":"IssueNotificationConfigUpdate"},"ItemNotesUpdate":{"properties":{"action":{"type":"string","title":"Action","default":"set"},"notes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Notes"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","title":"ItemNotesUpdate","description":"Request body for updating item notes."},"JmespathPreviewRequest":{"properties":{"response":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"},{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"type":"null"}],"title":"Response"},"expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expression"}},"type":"object","required":["response"],"title":"JmespathPreviewRequest","description":"Request body for the JMESPath preview endpoint.\n\n`response` is the raw API response (string or any JSON value). Strings are\ntreated as already-serialized JSON; other types get serialized server-side\nso the FE can pass either form indistinctly."},"Job":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id","description":"Project ID being trained"},"status":{"$ref":"#/components/schemas/JobStatus","description":"Current status of the job","default":"pending"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Error message if job failed"},"progress_percentage":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Progress Percentage","description":"Training progress percentage (0-100)","default":0},"current_phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Phase","description":"Current phase of training (e.g., 'Indexing documents...')"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"When the job completed or failed"}},"type":"object","required":["project_id"],"title":"Job","description":"Training job for RAG index building."},"JobStatus":{"type":"string","enum":["pending","running","completed","failed"],"title":"JobStatus","description":"Status of a training job."},"KBAskCitation":{"properties":{"citation_id":{"type":"string","title":"Citation Id","description":"Short 5-char id referenced in the answer as [[citation_id]]"},"kb_id":{"type":"string","title":"Kb Id","description":"Knowledge base ID","default":""},"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id","description":"Item ID (None for custom-KB chunks)"},"content":{"type":"string","title":"Content","description":"The source chunk text","default":""},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name","description":"File name if applicable"},"title":{"type":"string","title":"Title","description":"Document/KB title for the sources index","default":""},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score","description":"Relevance score (rerank or cosine)"}},"type":"object","required":["citation_id"],"title":"KBAskCitation","description":"A retrieved source chunk for the KB 'ask' endpoint. Superset of CitationRef\n(same citation_id/kb_id/item_id/content/file_name the FE citation renderer consumes)\nplus the document title and relevance score for the sources index block."},"KBAskRequest":{"properties":{"query":{"type":"string","minLength":1,"title":"Query","description":"Natural-language question"},"kb_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Kb Ids","description":"Optional list of knowledge base IDs to scope the search."},"retrieval_override":{"anyOf":[{"$ref":"#/components/schemas/RetrievalConfigOverride"},{"type":"null"}],"description":"Per-request retrieval tuning override (eval/sweep). None = use KB-resolved config."}},"type":"object","required":["query"],"title":"KBAskRequest","description":"Request body for the KB 'ask' tool: LLM picks metadata filters, retrieves, and\nsynthesizes a grounded answer with citations — mirroring the assistant's search KB tool."},"KBAskResponse":{"properties":{"question":{"type":"string","title":"Question","description":"The user's original question"},"answer":{"type":"string","title":"Answer","description":"Grounded answer with inline [[citation_id]] markers"},"citations":{"items":{"$ref":"#/components/schemas/KBAskCitation"},"type":"array","title":"Citations","description":"Retrieved source chunks, keyed by [[citation_id]]"},"search_query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Query","description":"The query the agent passed to search_knowledge_base"},"metadata_filters":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Metadata Filters","description":"The metadata filters the LLM explicitly passed to the tool (None if it passed none)"},"applied_filters":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Applied Filters","description":"Filters actually applied to retrieval: LLM-passed metadata_filters merged with the deterministic lexical prepass (SKUs/values matched in the search query). None if unfiltered."},"available_filters":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Available Filters","description":"The metadata filter fields/values the agent could choose from"},"total_ms":{"type":"number","title":"Total Ms","description":"Total agent run time in milliseconds"},"tool_ms":{"type":"number","title":"Tool Ms","description":"Time spent inside search_knowledge_base tool calls in milliseconds"}},"type":"object","required":["question","answer","total_ms","tool_ms"],"title":"KBAskResponse","description":"Response from the KB 'ask' endpoint — a minimal one-tool agent that mirrors the\nassistant's production KB search. The answer uses the same [[citation_id]] markers\nas playbooks; ``citations`` carries the CitationRef shape (plus title/score)."},"KBItemMetadata":{"properties":{"item_id":{"type":"string","title":"Item Id","description":"The item's unique ID"},"item_type":{"type":"string","title":"Item Type","description":"Type of item: snippet, faq, notion, intercom, pylon"},"title":{"type":"string","title":"Title","description":"The item's title"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"External URL for notion/intercom/pylon items"}},"type":"object","required":["item_id","item_type","title"],"title":"KBItemMetadata","description":"Unified response for KB item metadata lookup."},"KBItemsPatch":{"properties":{"add":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Add","description":"New items, without id (the server assigns one). FAQ: {questions, answer}; snippet: {title, content}."},"update":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Update","description":"Partial edits: each needs the `id` of an existing item plus only the fields to change. Fields left out (including correction notes) are kept."},"delete":{"items":{"type":"string"},"type":"array","title":"Delete","description":"Ids of existing items to remove."}},"additionalProperties":false,"type":"object","title":"KBItemsPatch","description":"Body of ``PATCH /knowledgebases/{id}/items``."},"KBItemsPatchResponse":{"properties":{"kb_id":{"type":"string","title":"Kb Id"},"status":{"type":"string","title":"Status"},"item_count":{"type":"integer","title":"Item Count","description":"Items in the KB after the patch"},"added":{"items":{"type":"string"},"type":"array","title":"Added","description":"Ids assigned to the added items, in order"},"updated":{"items":{"type":"string"},"type":"array","title":"Updated"},"deleted":{"items":{"type":"string"},"type":"array","title":"Deleted"}},"type":"object","required":["kb_id","status","item_count"],"title":"KBItemsPatchResponse","description":"What an item-level patch did — deliberately not the whole KB.\n\nThe main reader is an MCP client editing one FAQ of a 100+ item KB; echoing\nevery item back would cost it the context the endpoint exists to save."},"KBSearchNode":{"properties":{"text":{"type":"string","title":"Text","description":"Chunk text"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score","description":"Relevance score (rerank score if reranked, else cosine)"},"kb_id":{"type":"string","title":"Kb Id","description":"Knowledge base ID this chunk belongs to"},"kb_title":{"type":"string","title":"Kb Title","description":"Knowledge base title"},"kb_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Type","description":"Knowledge base type"},"doc_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Id","description":"Custom KB document ID (None for native KB chunks)"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Chunk metadata (excludes internal keys: instructions, metadata_fields, project_id)"}},"type":"object","required":["text","kb_id","kb_title"],"title":"KBSearchNode","description":"A single retrieved chunk in a KB search response."},"KBSearchRequest":{"properties":{"query":{"type":"string","minLength":1,"title":"Query","description":"Search query"},"kb_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Kb Ids","description":"Optional list of knowledge base IDs to filter. If omitted, searches all KBs in the project."},"top_n":{"anyOf":[{"type":"integer","maximum":20.0,"minimum":1.0},{"type":"null"}],"title":"Top N","description":"Number of chunks to return (default 10)"},"apply_filters":{"type":"boolean","title":"Apply Filters","description":"Apply metadata where-filters (lexical prepass) to retrieval","default":true},"retrieval_override":{"anyOf":[{"$ref":"#/components/schemas/RetrievalConfigOverride"},{"type":"null"}],"description":"Per-request retrieval tuning override (eval/sweep). None = use KB-resolved config."},"metadata_filters":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Metadata Filters","description":"Explicit metadata filters {field: [values]} for sweeps. Merged with the lexical prepass like the search tool does (subject to apply_filters)."}},"type":"object","required":["query"],"title":"KBSearchRequest","description":"Request body for raw KB retrieval (two-stage: dense wide -> rerank -> top_n)."},"KBSearchResponse":{"properties":{"query":{"type":"string","title":"Query","description":"The original search query"},"nodes":{"items":{"$ref":"#/components/schemas/KBSearchNode"},"type":"array","title":"Nodes","description":"Retrieved chunks ordered by relevance"},"applied_filters":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Applied Filters","description":"Metadata where-filters applied to retrieval (None if none applied)"},"rerank_used":{"type":"boolean","title":"Rerank Used","description":"Whether the Cohere rerank stage ran for this query","default":false},"retrieval_time_ms":{"type":"number","title":"Retrieval Time Ms","description":"Time taken for retrieval in milliseconds"}},"type":"object","required":["query","retrieval_time_ms"],"title":"KBSearchResponse","description":"Response from raw KB retrieval."},"KBUploadCreate":{"properties":{"kb_type":{"type":"string","enum":["snippets","faq","text"],"title":"Kb Type","description":"What the uploaded file will become. Determines the file shape.","default":"snippets"}},"type":"object","title":"KBUploadCreate","description":"Request a slot. The KB type is declared HERE, not at consume time, so the caller\nlearns the expected file shape before writing the file."},"KBUploadCreated":{"properties":{"upload_id":{"type":"string","title":"Upload Id","description":"Pointer to pass to create_knowledge_base_from_upload."},"upload_url":{"type":"string","title":"Upload Url","description":"POST the file here. Accepts exactly one upload, then closes."},"upload_headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Upload Headers","description":"Headers to send with the upload POST."},"expires_at":{"type":"string","format":"date-time","title":"Expires At","description":"After this, the URL is dead."},"max_bytes":{"type":"integer","title":"Max Bytes","description":"Hard size limit for the uploaded file."},"kb_type":{"type":"string","title":"Kb Type","description":"What this slot will become."},"file_shape":{"type":"string","title":"File Shape","description":"Exactly how the uploaded file must be shaped."},"instructions":{"type":"string","title":"Instructions","description":"What to do with this, in plain language."}},"type":"object","required":["upload_id","upload_url","upload_headers","expires_at","max_bytes","kb_type","file_shape","instructions"],"title":"KBUploadCreated","description":"A minted upload slot. Mirrors Notion's file-upload response shape."},"KBUploadReceipt":{"properties":{"upload_id":{"type":"string","title":"Upload Id"},"byte_size":{"type":"integer","title":"Byte Size"},"status":{"type":"string","title":"Status"},"confirmation_code":{"type":"string","title":"Confirmation Code","description":"Shown once. Required to create the knowledge base."},"instructions":{"type":"string","title":"Instructions"}},"type":"object","required":["upload_id","byte_size","status","confirmation_code","instructions"],"title":"KBUploadReceipt","description":"Confirmation that a file landed in a slot.\n\n``confirmation_code`` is returned here and nowhere else. It is required to consume the\nupload, so only whoever actually completed it can turn the file into a knowledge base."},"KaptionAccountCostRow":{"properties":{"playbook_cost_usd":{"type":"number","title":"Playbook Cost Usd","description":"Playbook-agent LLM cost (ChatMessage.cost_usd sum)","default":0.0},"postprocessing_cost_usd":{"type":"number","title":"Postprocessing Cost Usd","description":"Conversation-metrics / scoring LLM cost (ConversationMetrics.cost_usd sum)","default":0.0},"eval_cost_usd":{"type":"number","title":"Eval Cost Usd","description":"Eval-only overhead cost (EvalRun.eval_overhead_cost_usd sum) — simulator + LLM-judge OpenRouter spend. Populated for account-level and per-playbook rows; 0 on dimensions where eval cost is not well-defined (tags, models, individual conversations).","default":0.0},"total_cost_usd":{"type":"number","title":"Total Cost Usd","description":"playbook_cost_usd + postprocessing_cost_usd + eval_cost_usd","default":0.0},"account_name":{"type":"string","title":"Account Name"},"account_id":{"type":"string","title":"Account Id"},"total_input_tokens":{"type":"integer","title":"Total Input Tokens"},"total_output_tokens":{"type":"integer","title":"Total Output Tokens"},"total_messages":{"type":"integer","title":"Total Messages"},"total_conversations":{"type":"integer","title":"Total Conversations"},"total_llm_requests":{"type":"integer","title":"Total Llm Requests"},"kaption_account_id":{"type":"integer","title":"Kaption Account Id"}},"type":"object","required":["account_name","account_id","total_input_tokens","total_output_tokens","total_messages","total_conversations","total_llm_requests","kaption_account_id"],"title":"KaptionAccountCostRow"},"KaptionCopilotSessionResponse":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"Copilot conversation ID (format: kaption:{user_id}:{conv_id})"},"exists":{"type":"boolean","title":"Exists","description":"Whether an existing session was found"},"message_count":{"type":"integer","title":"Message Count","description":"Number of messages in the session"}},"type":"object","required":["conversation_id","exists","message_count"],"title":"KaptionCopilotSessionResponse","description":"Response for Kaption copilot session lookup.\n\nUsed when looking up or creating a copilot session linked to a Kaption conversation.\nThe conversation_id returned has format: \"kaption:{user_id}:{kaption_conversation_id}\"\nThis ensures each agent has their own copilot session per conversation."},"KaptionFeatureFlagUpdate":{"properties":{"value":{"anyOf":[{},{"type":"null"}],"title":"Value"}},"type":"object","title":"KaptionFeatureFlagUpdate","description":"Set an override, or clear it with an explicit null so it falls back to the default.\n\n``Any`` on purpose: the registry validates the type (a bool flag refuses ``1``),\nso the body is not coerced into something it did not say."},"KbCitationAnalyticsResponse":{"properties":{"total":{"type":"integer","title":"Total"},"by_source":{"items":{"$ref":"#/components/schemas/KbCitationBySource"},"type":"array","title":"By Source"},"time_series":{"items":{"$ref":"#/components/schemas/app__routers__resource_analytics__TimeSeriesPoint"},"type":"array","title":"Time Series"},"recent":{"items":{"$ref":"#/components/schemas/KbCitationRecentItem"},"type":"array","title":"Recent"}},"type":"object","required":["total"],"title":"KbCitationAnalyticsResponse"},"KbCitationBySource":{"properties":{"source":{"type":"string","title":"Source"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["source","count"],"title":"KbCitationBySource"},"KbCitationRecentItem":{"properties":{"id":{"type":"string","title":"Id"},"kb_id":{"type":"string","title":"Kb Id"},"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id"},"source":{"type":"string","title":"Source"},"citation_ids":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Citation Ids"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"}},"type":"object","required":["id","kb_id","source","created_at"],"title":"KbCitationRecentItem"},"KbItemTrafficEntry":{"properties":{"item_id":{"type":"string","title":"Item Id"},"kb_id":{"type":"string","title":"Kb Id"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["item_id","kb_id","count"],"title":"KbItemTrafficEntry"},"KbItemTrafficResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/KbItemTrafficEntry"},"type":"array","title":"Items"},"total_items_cited":{"type":"integer","title":"Total Items Cited"}},"type":"object","required":["total_items_cited"],"title":"KbItemTrafficResponse"},"KbSearchGapItem":{"properties":{"query":{"type":"string","title":"Query"},"count":{"type":"integer","title":"Count"},"avg_top_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Top Score"},"min_top_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Top Score"},"zero_result_count":{"type":"integer","title":"Zero Result Count"},"last_seen_at":{"type":"string","format":"date-time","title":"Last Seen At"}},"type":"object","required":["query","count","zero_result_count","last_seen_at"],"title":"KbSearchGapItem"},"KbSearchGapsResponse":{"properties":{"total_searches":{"type":"integer","title":"Total Searches"},"distinct_queries":{"type":"integer","title":"Distinct Queries"},"items":{"items":{"$ref":"#/components/schemas/KbSearchGapItem"},"type":"array","title":"Items"}},"type":"object","required":["total_searches","distinct_queries"],"title":"KbSearchGapsResponse"},"KnowledgeBase":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this knowledge base belongs to"},"title":{"type":"string","title":"Title","description":"Title of the knowledge base"},"kb_type":{"$ref":"#/components/schemas/KnowledgeBaseType","description":"Type of knowledge base"},"status":{"$ref":"#/components/schemas/KnowledgeBaseStatus","description":"Current status in training lifecycle","default":"added"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content","description":"Raw text content (for TEXT and FILE knowledge bases)"},"faq_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/FAQItem"},"type":"array"},{"type":"null"}],"title":"Faq Items","description":"FAQ items (for FAQ knowledge bases)"},"snippet_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/SnippetItem"},"type":"array"},{"type":"null"}],"title":"Snippet Items","description":"Snippet items (for SNIPPETS knowledge bases)"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Original filename (for FILE knowledge bases)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description (for CUSTOM knowledge bases)"},"custom_info":{"anyOf":[{"$ref":"#/components/schemas/CustomKBInfo"},{"type":"null"}],"description":"FE-visible CUSTOM KB info (doc count, ingest time, filter fields, retrieval config)"},"file_mimetype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Mimetype","description":"MIME type of the file (for FILE knowledge bases)"},"file_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size","description":"File size in bytes (for FILE knowledge bases)"},"notion_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/NotionItem"},"type":"array"},{"type":"null"}],"title":"Notion Items","description":"Notion page items (for NOTION knowledge bases)"},"notion_root_page_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notion Root Page Id","description":"Root Notion page ID for re-import"},"notion_last_imported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Notion Last Imported At","description":"When Notion import last ran"},"notion_source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notion Source Type","description":"Source type: 'page' or 'database' (for NOTION knowledge bases)"},"gdrive_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/GDriveItem"},"type":"array"},{"type":"null"}],"title":"Gdrive Items","description":"Google Drive file items (for GDRIVE knowledge bases)"},"gdrive_root_folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gdrive Root Folder Id","description":"Root Google Drive folder ID for re-import"},"gdrive_last_imported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Gdrive Last Imported At","description":"When Google Drive import last ran"},"gdrive_source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gdrive Source Type","description":"Source type: 'folder' or 'file' (for GDRIVE knowledge bases)"},"intercom_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/IntercomItem"},"type":"array"},{"type":"null"}],"title":"Intercom Items","description":"Intercom Help Center articles (for INTERCOM knowledge bases)"},"intercom_last_imported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Intercom Last Imported At","description":"When Intercom import last ran"},"pylon_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/PylonItem"},"type":"array"},{"type":"null"}],"title":"Pylon Items","description":"Pylon Knowledge Base articles (for PYLON knowledge bases)"},"pylon_last_imported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pylon Last Imported At","description":"When Pylon import last ran"},"notes":{"anyOf":[{"items":{"$ref":"#/components/schemas/NoteItem"},"type":"array"},{"type":"null"}],"title":"Notes","description":"KB-level correction notes for item-less KB types"},"previous_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Version Id","description":"ID of the previous version (for rollback)"},"is_archived":{"type":"boolean","title":"Is Archived","description":"Archived: hidden from lists and pickers, frozen for editing, still indexed and retrievable by assistants that already reference it. The only lifecycle flag the API writes.","default":false},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Legacy pre-archive soft delete (status DELETED, purged at next sync). No longer written by the API — DELETE archives now; kept for rows deleted before that change.","default":false},"is_temporary":{"type":"boolean","title":"Is Temporary","description":"Temporary KB (e.g. eval/sweep scratch): hidden from the FE list, but visible/manageable via admin API","default":false},"status_before_deletion":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeBaseStatus"},{"type":"null"}],"description":"Status before soft deletion (for restore)"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["project_id","title","kb_type"],"title":"KnowledgeBase","description":"Knowledge base model with ID and metadata."},"KnowledgeBaseFromUpload":{"properties":{"upload_id":{"type":"string","title":"Upload Id","description":"The upload_id returned when the slot was minted."},"confirmation_code":{"type":"string","title":"Confirmation Code","description":"The code the upload response returned. Proves you uploaded it."},"title":{"type":"string","title":"Title","description":"Knowledge base title. The catalog lookup shows this to the model."},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"What is in it, and when to search it."}},"type":"object","required":["upload_id","confirmation_code","title"],"title":"KnowledgeBaseFromUpload","description":"Turn an uploaded file into a SNIPPETS knowledge base."},"KnowledgeBaseRetrievalMetadata":{"properties":{"knowledgebase_id":{"type":"string","title":"Knowledgebase Id","description":"ID of the knowledge base document"},"knowledgebase_title":{"type":"string","title":"Knowledgebase Title","description":"Title of the knowledge base document"},"relevance_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Relevance Score","description":"Relevance score (if available)"},"content_snippet":{"type":"string","title":"Content Snippet","description":"Snippet of content that was retrieved"},"content_spans":{"items":{"$ref":"#/components/schemas/ContentSpan"},"type":"array","title":"Content Spans","description":"Text spans within the content with unique IDs for citation"},"spans_used":{"items":{"type":"string"},"type":"array","title":"Spans Used","description":"List of span IDs that were actually used by the LLM to generate the response"},"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name","description":"Filename with extension (for per-node custom KBs)"},"kb_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Type","description":"Knowledge base type from node metadata"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"Instructions for this KB (if any)"},"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Item Id","description":"ID of the specific item (snippet_id, faq_id, notion_item_id, intercom_item_id)"},"doc_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Doc Id","description":"Custom KB document ID (None for native KB chunks)"},"node_metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Node Metadata","description":"Raw chunk metadata from the vector store (used by raw KB search)"}},"type":"object","required":["knowledgebase_id","knowledgebase_title","content_snippet"],"title":"KnowledgeBaseRetrievalMetadata","description":"Metadata about a knowledge base document retrieved during RAG."},"KnowledgeBaseStatus":{"type":"string","enum":["active","added","edited","deleted","final_delete"],"title":"KnowledgeBaseStatus","description":"Status of a knowledge base in the training lifecycle."},"KnowledgeBaseType":{"type":"string","enum":["text","faq","file","custom","snippets","notion","gdrive","intercom","pylon"],"title":"KnowledgeBaseType","description":"Types of knowledge bases."},"KnowledgeBaseUpdate":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content","description":"Content for TEXT knowledge bases"},"faq_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/FAQItem"},"type":"array"},{"type":"null"}],"title":"Faq Items","description":"FAQ items for FAQ knowledge bases"},"snippet_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/SnippetItem"},"type":"array"},{"type":"null"}],"title":"Snippet Items","description":"Snippet items for SNIPPETS knowledge bases"},"notion_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/NotionItem"},"type":"array"},{"type":"null"}],"title":"Notion Items","description":"Notion items for NOTION knowledge bases"},"gdrive_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/GDriveItem"},"type":"array"},{"type":"null"}],"title":"Gdrive Items","description":"Google Drive items for GDRIVE knowledge bases"},"intercom_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/IntercomItem"},"type":"array"},{"type":"null"}],"title":"Intercom Items","description":"Intercom items for INTERCOM knowledge bases"},"pylon_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/PylonItem"},"type":"array"},{"type":"null"}],"title":"Pylon Items","description":"Pylon items for PYLON knowledge bases"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"Optional markdown-formatted instructions for LLM when using this KB"},"metadata_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Fields","description":"Optional list of additional metadata field names to extract from retrieved chunks"},"metadata_filter_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Filter Fields","description":"Optional list of metadata filter field names for RAG query filtering"},"chroma_collection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chroma Collection Id","description":"Optional reference to custom ChromaDB collection (for custom KBs with metadata filtering)"}},"type":"object","title":"KnowledgeBaseUpdate","description":"Model for updating a knowledge base (TEXT, FAQ, SNIPPETS, NOTION, GDRIVE, or INTERCOM only, FILE not allowed)."},"KnowledgeBaseWithUsage-Input":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this knowledge base belongs to"},"title":{"type":"string","title":"Title","description":"Title of the knowledge base"},"kb_type":{"$ref":"#/components/schemas/KnowledgeBaseType","description":"Type of knowledge base"},"status":{"$ref":"#/components/schemas/KnowledgeBaseStatus","description":"Current status in training lifecycle","default":"added"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content","description":"Raw text content (for TEXT and FILE knowledge bases)"},"faq_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/FAQItem"},"type":"array"},{"type":"null"}],"title":"Faq Items","description":"FAQ items (for FAQ knowledge bases)"},"snippet_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/SnippetItem"},"type":"array"},{"type":"null"}],"title":"Snippet Items","description":"Snippet items (for SNIPPETS knowledge bases)"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Original filename (for FILE knowledge bases)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description (for CUSTOM knowledge bases)"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"Optional markdown-formatted instructions for LLM (internal only)"},"metadata_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Fields","description":"List of additional metadata fields to extract (internal only)"},"metadata_filter_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Filter Fields","description":"List of metadata filter field names for RAG query filtering (internal only)"},"metadata_filter_values":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/MetadataFilterFieldInfo"},"type":"object"},{"type":"null"}],"title":"Metadata Filter Values","description":"Cached per-field filter state ({field: {values, is_array}}); internal only. Stored in Postgres (not Chroma collection metadata, which caps each value at 256 bytes)."},"metadata_filter_guidance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata Filter Guidance","description":"Free-text guidance on how the LLM should use the filters (injected into the search tool description); internal only."},"chroma_collection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chroma Collection Id","description":"Optional reference to custom ChromaDB collection (internal only)"},"retrieval_config":{"anyOf":[{"$ref":"#/components/schemas/RetrievalConfig"},{"type":"null"}],"description":"Per-KB retrieval tuning for CUSTOM knowledge bases (internal only)"},"chunking_config":{"anyOf":[{"$ref":"#/components/schemas/ChunkingConfig"},{"type":"null"}],"description":"Per-KB ingest-time chunking for CUSTOM knowledge bases (internal only)"},"doc_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Doc Count","description":"Number of ingested documents (CUSTOM knowledge bases, internal only)"},"last_ingested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Ingested At","description":"When documents were last ingested (CUSTOM knowledge bases, internal only)"},"custom_info":{"anyOf":[{"$ref":"#/components/schemas/CustomKBInfo"},{"type":"null"}],"description":"FE-visible CUSTOM KB info (doc count, ingest time, filter fields, retrieval config)"},"file_blob":{"anyOf":[{"type":"string","format":"binary"},{"type":"null"}],"title":"File Blob","description":"Binary file content (for FILE knowledge bases)"},"file_mimetype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Mimetype","description":"MIME type of the file (for FILE knowledge bases)"},"file_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size","description":"File size in bytes (for FILE knowledge bases)"},"notion_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/NotionItem"},"type":"array"},{"type":"null"}],"title":"Notion Items","description":"Notion page items (for NOTION knowledge bases)"},"notion_root_page_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notion Root Page Id","description":"Root Notion page ID for re-import"},"notion_last_imported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Notion Last Imported At","description":"When Notion import last ran"},"notion_source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notion Source Type","description":"Source type: 'page' or 'database' (for NOTION knowledge bases)"},"gdrive_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/GDriveItem"},"type":"array"},{"type":"null"}],"title":"Gdrive Items","description":"Google Drive file items (for GDRIVE knowledge bases)"},"gdrive_root_folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gdrive Root Folder Id","description":"Root Google Drive folder ID for re-import"},"gdrive_last_imported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Gdrive Last Imported At","description":"When Google Drive import last ran"},"gdrive_source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gdrive Source Type","description":"Source type: 'folder' or 'file' (for GDRIVE knowledge bases)"},"intercom_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/IntercomItem"},"type":"array"},{"type":"null"}],"title":"Intercom Items","description":"Intercom Help Center articles (for INTERCOM knowledge bases)"},"intercom_last_imported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Intercom Last Imported At","description":"When Intercom import last ran"},"pylon_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/PylonItem"},"type":"array"},{"type":"null"}],"title":"Pylon Items","description":"Pylon Knowledge Base articles (for PYLON knowledge bases)"},"pylon_last_imported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pylon Last Imported At","description":"When Pylon import last ran"},"notes":{"anyOf":[{"items":{"$ref":"#/components/schemas/NoteItem"},"type":"array"},{"type":"null"}],"title":"Notes","description":"KB-level correction notes for item-less KB types"},"previous_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Version Id","description":"ID of the previous version (for rollback)"},"is_archived":{"type":"boolean","title":"Is Archived","description":"Archived: hidden from lists and pickers, frozen for editing, still indexed and retrievable by assistants that already reference it. The only lifecycle flag the API writes.","default":false},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Legacy pre-archive soft delete (status DELETED, purged at next sync). No longer written by the API — DELETE archives now; kept for rows deleted before that change.","default":false},"is_temporary":{"type":"boolean","title":"Is Temporary","description":"Temporary KB (e.g. eval/sweep scratch): hidden from the FE list, but visible/manageable via admin API","default":false},"status_before_deletion":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeBaseStatus"},{"type":"null"}],"description":"Status before soft deletion (for restore)"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"used_by_playbooks":{"items":{"$ref":"#/components/schemas/PlaybookReference"},"type":"array","title":"Used By Playbooks","description":"One entry per assistant whose active/connected OR latest version references this KB. Empty when nothing uses it."}},"type":"object","required":["project_id","title","kb_type"],"title":"KnowledgeBaseWithUsage","description":"Knowledge base model extended with playbook usage information.\n\nReturned by ``GET /projects/{id}/knowledgebases?include_playbook_usage=true``.\n``ApiToolWithUsage`` is the twin for API tools: same field, same shape, same\ndefinition of \"in use\", so one dialog component renders both."},"KnowledgeBaseWithUsage-Output":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this knowledge base belongs to"},"title":{"type":"string","title":"Title","description":"Title of the knowledge base"},"kb_type":{"$ref":"#/components/schemas/KnowledgeBaseType","description":"Type of knowledge base"},"status":{"$ref":"#/components/schemas/KnowledgeBaseStatus","description":"Current status in training lifecycle","default":"added"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content","description":"Raw text content (for TEXT and FILE knowledge bases)"},"faq_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/FAQItem"},"type":"array"},{"type":"null"}],"title":"Faq Items","description":"FAQ items (for FAQ knowledge bases)"},"snippet_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/SnippetItem"},"type":"array"},{"type":"null"}],"title":"Snippet Items","description":"Snippet items (for SNIPPETS knowledge bases)"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename","description":"Original filename (for FILE knowledge bases)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Description (for CUSTOM knowledge bases)"},"custom_info":{"anyOf":[{"$ref":"#/components/schemas/CustomKBInfo"},{"type":"null"}],"description":"FE-visible CUSTOM KB info (doc count, ingest time, filter fields, retrieval config)"},"file_mimetype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Mimetype","description":"MIME type of the file (for FILE knowledge bases)"},"file_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size","description":"File size in bytes (for FILE knowledge bases)"},"notion_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/NotionItem"},"type":"array"},{"type":"null"}],"title":"Notion Items","description":"Notion page items (for NOTION knowledge bases)"},"notion_root_page_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notion Root Page Id","description":"Root Notion page ID for re-import"},"notion_last_imported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Notion Last Imported At","description":"When Notion import last ran"},"notion_source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notion Source Type","description":"Source type: 'page' or 'database' (for NOTION knowledge bases)"},"gdrive_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/GDriveItem"},"type":"array"},{"type":"null"}],"title":"Gdrive Items","description":"Google Drive file items (for GDRIVE knowledge bases)"},"gdrive_root_folder_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gdrive Root Folder Id","description":"Root Google Drive folder ID for re-import"},"gdrive_last_imported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Gdrive Last Imported At","description":"When Google Drive import last ran"},"gdrive_source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gdrive Source Type","description":"Source type: 'folder' or 'file' (for GDRIVE knowledge bases)"},"intercom_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/IntercomItem"},"type":"array"},{"type":"null"}],"title":"Intercom Items","description":"Intercom Help Center articles (for INTERCOM knowledge bases)"},"intercom_last_imported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Intercom Last Imported At","description":"When Intercom import last ran"},"pylon_items":{"anyOf":[{"items":{"$ref":"#/components/schemas/PylonItem"},"type":"array"},{"type":"null"}],"title":"Pylon Items","description":"Pylon Knowledge Base articles (for PYLON knowledge bases)"},"pylon_last_imported_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pylon Last Imported At","description":"When Pylon import last ran"},"notes":{"anyOf":[{"items":{"$ref":"#/components/schemas/NoteItem"},"type":"array"},{"type":"null"}],"title":"Notes","description":"KB-level correction notes for item-less KB types"},"previous_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Previous Version Id","description":"ID of the previous version (for rollback)"},"is_archived":{"type":"boolean","title":"Is Archived","description":"Archived: hidden from lists and pickers, frozen for editing, still indexed and retrievable by assistants that already reference it. The only lifecycle flag the API writes.","default":false},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Legacy pre-archive soft delete (status DELETED, purged at next sync). No longer written by the API — DELETE archives now; kept for rows deleted before that change.","default":false},"is_temporary":{"type":"boolean","title":"Is Temporary","description":"Temporary KB (e.g. eval/sweep scratch): hidden from the FE list, but visible/manageable via admin API","default":false},"status_before_deletion":{"anyOf":[{"$ref":"#/components/schemas/KnowledgeBaseStatus"},{"type":"null"}],"description":"Status before soft deletion (for restore)"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"used_by_playbooks":{"items":{"$ref":"#/components/schemas/PlaybookReference"},"type":"array","title":"Used By Playbooks","description":"One entry per assistant whose active/connected OR latest version references this KB. Empty when nothing uses it."}},"type":"object","required":["project_id","title","kb_type"],"title":"KnowledgeBaseWithUsage","description":"Knowledge base model extended with playbook usage information.\n\nReturned by ``GET /projects/{id}/knowledgebases?include_playbook_usage=true``.\n``ApiToolWithUsage`` is the twin for API tools: same field, same shape, same\ndefinition of \"in use\", so one dialog component renders both."},"KpiNumbers":{"properties":{"total_cost_usd":{"type":"number","title":"Total Cost Usd"},"llm_requests":{"type":"integer","title":"Llm Requests"},"total_tokens":{"type":"integer","title":"Total Tokens"},"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"cache_read_tokens":{"type":"integer","title":"Cache Read Tokens"},"cache_write_tokens":{"type":"integer","title":"Cache Write Tokens"},"cache_hit_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cache Hit Rate"},"assistant_cache_hit_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Assistant Cache Hit Rate"}},"type":"object","required":["total_cost_usd","llm_requests","total_tokens","input_tokens","output_tokens","cache_read_tokens","cache_write_tokens","cache_hit_rate","assistant_cache_hit_rate"],"title":"KpiNumbers"},"LabelEventData":{"properties":{"label":{"type":"string","title":"Label","description":"Label name to add"}},"additionalProperties":false,"type":"object","required":["label"],"title":"LabelEventData","description":"Data for label event."},"LatestVersionHeader":{"properties":{"id":{"type":"string","title":"Id"},"version_number":{"type":"integer","title":"Version Number"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","version_number"],"title":"LatestVersionHeader","description":"Which version of an assistant is the latest — for an editor checking it is not stale."},"LinkCampaignPlaybookRequest":{"properties":{"playbook_base_id":{"type":"string","title":"Playbook Base Id","description":"Base ID of the playbook to handle campaign replies"},"campaign_name":{"type":"string","title":"Campaign Name","description":"Human-readable campaign name for display in notes and prompts"}},"type":"object","required":["playbook_base_id","campaign_name"],"title":"LinkCampaignPlaybookRequest","description":"Request to link a Chatwoot campaign to a playbook."},"LinkInboxSuggestionPlaybookRequest":{"properties":{"playbook_base_id":{"type":"string","title":"Playbook Base Id","description":"Base ID of the suggestion playbook to handle suggestions for this inbox"}},"type":"object","required":["playbook_base_id"],"title":"LinkInboxSuggestionPlaybookRequest","description":"Request to link a Chatwoot inbox to a suggestion playbook."},"LoginRequest":{"properties":{"account_name":{"type":"string","maxLength":255,"minLength":1,"title":"Account Name","description":"Organization name"},"username":{"type":"string","maxLength":100,"minLength":3,"title":"Username","description":"Username"},"password":{"type":"string","minLength":8,"title":"Password","description":"Password"}},"type":"object","required":["account_name","username","password"],"title":"LoginRequest","description":"Login request body."},"LoginResponse":{"properties":{"token":{"type":"string","title":"Token","description":"Session token (JWT)"},"account_id":{"type":"string","title":"Account Id","description":"Account ID (string - UUID for standalone, numeric for KAPTION)"},"username":{"type":"string","title":"Username","description":"Username"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name","description":"Account name for display"},"message":{"type":"string","title":"Message","description":"Success message","default":"Login successful"}},"type":"object","required":["token","account_id","username"],"title":"LoginResponse","description":"Login response body."},"LoginTotpRequest":{"properties":{"pending_token":{"type":"string","maxLength":2048,"minLength":1,"title":"Pending Token"},"totp_code":{"type":"string","maxLength":10,"minLength":6,"title":"Totp Code","description":"6-digit TOTP code from the user's authenticator app"}},"type":"object","required":["pending_token","totp_code"],"title":"LoginTotpRequest","description":"Second login step: 6-digit code + the pending token from step 1."},"LoginTotpRequiredResponse":{"properties":{"totp_required":{"type":"boolean","const":true,"title":"Totp Required","default":true},"pending_token":{"type":"string","title":"Pending Token","description":"Short-lived token to present at /auth/login/totp"}},"type":"object","required":["pending_token"],"title":"LoginTotpRequiredResponse","description":"Login response when the user has 2FA enrolled — no session yet.\n\nThe FE exchanges the pending token + a 6-digit code at POST\n/auth/login/totp to get the real LoginResponse."},"LogoResponse":{"properties":{"has_logo":{"type":"boolean","title":"Has Logo","description":"Whether the account has a logo"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url","description":"URL to fetch the logo (if has_logo is True)"},"logo_data":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Data","description":"Base64-encoded logo data (if include_data is True)"},"logo_mimetype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Mimetype","description":"MIME type of the logo"},"logo_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Logo Size","description":"Size of the logo in bytes"}},"type":"object","required":["has_logo"],"title":"LogoResponse","description":"Logo response body."},"LogoUploadResponse":{"properties":{"has_logo":{"type":"boolean","title":"Has Logo","default":true},"logo_mimetype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Mimetype"},"logo_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Logo Size"}},"type":"object","title":"LogoUploadResponse"},"ManualHandoffAvailability":{"properties":{"available":{"type":"boolean","title":"Available"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["available"],"title":"ManualHandoffAvailability","description":"Whether the Chat Log offers \"hand off\" for this conversation."},"ManualHandoffRequestBody":{"properties":{"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","title":"ManualHandoffRequestBody"},"ManualHandoffResult":{"properties":{"handed_off":{"type":"boolean","title":"Handed Off"},"channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id"},"recorded":{"type":"boolean","title":"Recorded","default":true}},"type":"object","required":["handed_off"],"title":"ManualHandoffResult"},"MarkNonBillableRequest":{"properties":{"conversation_ids":{"items":{"type":"string"},"type":"array","maxItems":500,"minItems":1,"title":"Conversation Ids","description":"Conversation ids of this account, as shown in the conversation list."},"note":{"type":"string","maxLength":500,"minLength":1,"title":"Note","description":"Why these conversations are not billed."}},"type":"object","required":["conversation_ids","note"],"title":"MarkNonBillableRequest"},"MarkNonBillableResponse":{"properties":{"account_id":{"type":"string","title":"Account Id"},"marked":{"items":{"type":"string"},"type":"array","title":"Marked","description":"Conversation ids marked by this request."},"currently_billed":{"type":"integer","title":"Currently Billed","description":"How many of the marked conversations the account was being charged for."},"already_marked":{"items":{"type":"string"},"type":"array","title":"Already Marked"},"not_billed_anyway":{"items":{"type":"string"},"type":"array","title":"Not Billed Anyway","description":"Preview, eval or Copilot conversations — never billed, so left alone."}},"type":"object","required":["account_id","marked","currently_billed","already_marked","not_billed_anyway"],"title":"MarkNonBillableResponse"},"McpAdminConnection":{"properties":{"id":{"type":"string","title":"Id"},"client_name":{"type":"string","title":"Client Name"},"superadmin_email":{"type":"string","title":"Superadmin Email"},"scope":{"type":"string","title":"Scope"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"}},"type":"object","required":["id","client_name","superadmin_email","scope","created_at","last_used_at"],"title":"McpAdminConnection"},"McpAdminConnectionListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/McpAdminConnection"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"McpAdminConnectionListResponse"},"McpAdminSsoTicketResponse":{"properties":{"ticket":{"type":"string","title":"Ticket"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["ticket","expires_in"],"title":"McpAdminSsoTicketResponse"},"McpConnectionResponse":{"properties":{"id":{"type":"string","title":"Id"},"client_name":{"type":"string","title":"Client Name"},"project_id":{"type":"string","title":"Project Id"},"project_name":{"type":"string","title":"Project Name"},"user_name":{"type":"string","title":"User Name","description":"Who consented the connection"},"scope":{"type":"string","title":"Scope"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","client_name","project_id","project_name","user_name","scope","created_at","last_used_at","revoked_at"],"title":"McpConnectionResponse","description":"One MCP connection (grant) as shown in the dashboard."},"McpSsoTicketResponse":{"properties":{"ticket":{"type":"string","title":"Ticket"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["ticket","expires_in"],"title":"McpSsoTicketResponse","description":"One-time ticket for the MCP authorization server's SSO hand-off."},"MeAccount":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"account_type":{"type":"string","enum":["standalone","kaption"],"title":"Account Type"},"manages_users_externally":{"type":"boolean","title":"Manages Users Externally","description":"True when the account's people live in Rumo, not in Studio Chat (native accounts)"}},"type":"object","required":["id","account_type","manages_users_externally"],"title":"MeAccount"},"MeCapabilities":{"properties":{"native_rumo":{"type":"boolean","title":"Native Rumo","description":"The account IS a Rumo account, driven natively (no channel in between)"},"rumo_channel":{"type":"boolean","title":"Rumo Channel","description":"The account has Rumo connected as a channel"}},"type":"object","required":["native_rumo","rumo_channel"],"title":"MeCapabilities","description":"Two facts, both read from our own database. No adapter is called to answer this endpoint."},"MeResponse":{"properties":{"account":{"$ref":"#/components/schemas/MeAccount"},"user":{"$ref":"#/components/schemas/MeUser"},"surface":{"type":"string","enum":["app","rumo_embed"],"title":"Surface","description":"Where the dashboard is open"},"capabilities":{"$ref":"#/components/schemas/MeCapabilities"}},"type":"object","required":["account","user","surface","capabilities"],"title":"MeResponse"},"MeUser":{"properties":{"id":{"type":"integer","title":"Id","description":"Local user id; for a native Rumo account, Rumo's own user id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"is_admin":{"type":"boolean","title":"Is Admin","description":"Exactly what require_admin() decides for this caller"},"source":{"type":"string","enum":["local","rumo"],"title":"Source","description":"Who vouched for this person: a Studio Chat login, or Rumo"}},"type":"object","required":["id","is_admin","source"],"title":"MeUser"},"MediaAppliedFilters":{"properties":{"attributes":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Attributes"},"kind":{"anyOf":[{"type":"string","enum":["image","document","video","audio"]},{"type":"null"}],"title":"Kind"},"source":{"type":"string","enum":["request","ai","none"],"title":"Source","description":"The request's filters, the model's, or none","default":"none"},"widened":{"type":"boolean","title":"Widened","description":"The model's filters matched no file, so every file was searched","default":false},"hint_tags":{"items":{"type":"string"},"type":"array","title":"Hint Tags","description":"Tags the AI chose as hints for reading the files. They exclude no file."}},"type":"object","title":"MediaAppliedFilters","description":"The filters a search ran with, and who chose them."},"MediaAssetList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MediaAssetOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"facets":{"anyOf":[{"additionalProperties":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Facets","description":"Facet catalog ({key: [{value, count}]}) when include_facets=true"}},"type":"object","required":["items","total","limit","offset"],"title":"MediaAssetList"},"MediaAssetOut":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id"},"kind":{"type":"string","enum":["image","document","video","audio"],"title":"Kind"},"media_type":{"type":"string","title":"Media Type"},"filename":{"type":"string","title":"Filename"},"size_bytes":{"type":"integer","title":"Size Bytes"},"page_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Count"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"attributes":{"additionalProperties":{"type":"string"},"type":"object","title":"Attributes","description":"Facets the search filters on exactly, e.g. {\"location\": \"Colegiales\", \"area\": \"baño\"}"},"public_url":{"type":"string","title":"Public Url"},"send_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Send Url"},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"},"index_status":{"type":"string","enum":["pending","ready","failed"],"title":"Index Status"},"index_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Index Error"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","project_id","kind","media_type","filename","size_bytes","title","public_url","index_status","created_at","updated_at"],"title":"MediaAssetOut","description":"One file in the project's media library."},"MediaAssetPatch":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"attributes":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Attributes","description":"Replaces the whole facet map"}},"type":"object","title":"MediaAssetPatch"},"MediaBulkGenerate":{"properties":{"ids":{"items":{"type":"string"},"type":"array","maxItems":500,"minItems":1,"title":"Ids"},"overwrite":{"type":"boolean","title":"Overwrite","default":false},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"}},"type":"object","required":["ids"],"title":"MediaBulkGenerate"},"MediaBulkGenerateResult":{"properties":{"scheduled":{"type":"integer","title":"Scheduled","description":"Files queued; each shows index_status=pending until it is done"},"ids":{"items":{"type":"string"},"type":"array","title":"Ids"}},"type":"object","required":["scheduled","ids"],"title":"MediaBulkGenerateResult"},"MediaBulkPatch":{"properties":{"ids":{"items":{"type":"string"},"type":"array","maxItems":500,"minItems":1,"title":"Ids"},"attributes_merge":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Attributes Merge","description":"Facets to set on every file (others kept)"},"tags_add":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags Add"}},"type":"object","required":["ids"],"title":"MediaBulkPatch","description":"One edit applied to many files: 'these 20 photos are Colegiales'."},"MediaCreateReceipt":{"properties":{"asset":{"$ref":"#/components/schemas/MediaAssetOut"},"indexing":{"type":"string","enum":["scheduled","skipped"],"title":"Indexing","default":"scheduled"}},"type":"object","required":["asset"],"title":"MediaCreateReceipt"},"MediaFacetValue":{"properties":{"value":{"type":"string","title":"Value"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["value","count"],"title":"MediaFacetValue"},"MediaFacets":{"properties":{"facets":{"additionalProperties":{"items":{"$ref":"#/components/schemas/MediaFacetValue"},"type":"array"},"type":"object","title":"Facets"}},"type":"object","required":["facets"],"title":"MediaFacets","description":"The project's facet catalog, derived from the attributes in use."},"MediaFromUrl":{"properties":{"url":{"type":"string","title":"Url","description":"Public http(s) URL of the file to import"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"attributes":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Attributes"},"generate":{"type":"boolean","title":"Generate","description":"Write description and tags with AI after importing, filling only empty fields","default":false},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","description":"Language for the AI description (es/en/pt)"}},"type":"object","required":["url"],"title":"MediaFromUrl"},"MediaGenerateRequest":{"properties":{"overwrite":{"type":"boolean","title":"Overwrite","description":"Replace title, description and tags even when they have content. Default: fill only empty fields.","default":false},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","description":"Language to write in (es/en/pt). Default: Spanish."}},"type":"object","title":"MediaGenerateRequest"},"MediaGenerateResult":{"properties":{"asset":{"$ref":"#/components/schemas/MediaAssetOut"},"generated":{"items":{"type":"string"},"type":"array","title":"Generated","description":"Fields that were filled: any of title, description, tags. Empty when there was nothing to fill."}},"type":"object","required":["asset"],"title":"MediaGenerateResult"},"MediaSearchHit":{"properties":{"asset":{"$ref":"#/components/schemas/MediaAssetOut"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Why the model says this file matches"}},"type":"object","required":["asset"],"title":"MediaSearchHit"},"MediaSearchRequest":{"properties":{"query":{"type":"string","maxLength":500,"title":"Query","description":"What to find, in any language. Empty lists what `filters` match.","default":""},"filters":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Filters","description":"Attribute -> accepted values. Applied as given; the model then chooses no filters."},"kind":{"anyOf":[{"type":"string","enum":["image","document","video","audio"]},{"type":"null"}],"title":"Kind"},"one_per":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"One Per","description":"The first match per distinct value of this attribute"},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","default":8}},"type":"object","title":"MediaSearchRequest","description":"Search the library in two model calls: filters from its attributes and tags, then the files that match."},"MediaSearchResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/MediaSearchHit"},"type":"array","title":"Results"},"facets":{"additionalProperties":{"items":{"$ref":"#/components/schemas/MediaFacetValue"},"type":"array"},"type":"object","title":"Facets"},"applied_filters":{"$ref":"#/components/schemas/MediaAppliedFilters"}},"type":"object","required":["results","facets"],"title":"MediaSearchResponse"},"MediaUploadCreate":{"properties":{"filename":{"type":"string","maxLength":255,"minLength":1,"title":"Filename","description":"The file's name, with its extension"},"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"attributes":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Attributes","description":"e.g. {\"location\": \"Palermo\", \"area\": \"baño\"}"},"generate":{"type":"boolean","title":"Generate","description":"Write description and tags with AI after upload, filling only empty fields","default":false},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","description":"Language for AI-written fields (es/en/pt)"}},"type":"object","required":["filename"],"title":"MediaUploadCreate","description":"Mint a single-use upload URL, and say now what the file is."},"MediaUploadCreated":{"properties":{"upload_id":{"type":"string","title":"Upload Id"},"upload_url":{"type":"string","title":"Upload Url","description":"POST the raw file here. Accepts exactly one upload, then closes."},"upload_method":{"type":"string","const":"POST","title":"Upload Method","default":"POST"},"upload_headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Upload Headers","description":"Send verbatim, plus the file's Content-Type."},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"max_bytes":{"type":"integer","title":"Max Bytes"},"instructions":{"type":"string","title":"Instructions"}},"type":"object","required":["upload_id","upload_url","upload_headers","expires_at","max_bytes","instructions"],"title":"MediaUploadCreated"},"MemberCreate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name","description":"Optional: left out, it is read from Google (when the admin authorized userinfo.profile)"},"email":{"type":"string","maxLength":320,"minLength":3,"title":"Email","description":"The person's Google account email"}},"additionalProperties":false,"type":"object","required":["email"],"title":"MemberCreate"},"MemberUpdate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"MemberUpdate"},"MessageEventData":{"properties":{"content":{"type":"string","title":"Content","description":"Message content to send"}},"additionalProperties":false,"type":"object","required":["content"],"title":"MessageEventData","description":"Data for message event."},"MessageLineDiff":{"properties":{"turn_index":{"type":"integer","title":"Turn Index"},"role":{"type":"string","title":"Role"},"a_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"A Text"},"b_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"B Text"},"unified_diff":{"type":"string","title":"Unified Diff","description":"``difflib.unified_diff`` output (joined)"}},"type":"object","required":["turn_index","role","unified_diff"],"title":"MessageLineDiff","description":"One per-turn unified diff hunk over the assistant message body.\n\nOnly turns whose text actually differs surface in the ``EvalCaseDiff``\npayload — the BE keeps the response bounded by skipping equal turns."},"MetadataFieldValidation":{"properties":{"field":{"type":"string","title":"Field","description":"The proposed metadata field name"},"found":{"type":"boolean","title":"Found","description":"Whether the field was present on at least one chunk"},"distinct_count":{"type":"integer","title":"Distinct Count","description":"Number of distinct values observed for this field"},"example_values":{"items":{"type":"string"},"type":"array","title":"Example Values","description":"Up to sample_size distinct example values (as strings)"}},"type":"object","required":["field","found","distinct_count"],"title":"MetadataFieldValidation","description":"Validation result for a single proposed metadata field that exists in the collection."},"MetadataFilterFieldInfo":{"properties":{"values":{"items":{"type":"string"},"type":"array","title":"Values"},"is_array":{"type":"boolean","title":"Is Array","default":false}},"type":"object","title":"MetadataFilterFieldInfo","description":"Cached state for one custom-KB metadata filter field.\n\n``values`` is the distinct value list; ``is_array`` is True when chunks store the field as\nan array (tag) — e.g. ``modelo=[\"CEA60\",\"CEA80\"]`` for a multi-model document — which makes\nretrieval filter it with Chroma's ``$contains`` instead of ``$eq``/``$in``."},"MetricConversationRow":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"label":{"type":"string","title":"Label"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"first_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Message At"},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Message At"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"}},"type":"object","required":["conversation_id","label"],"title":"MetricConversationRow"},"MetricDashboardAnalytics":{"properties":{"metric":{"type":"string","title":"Metric"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","description":"Canonical label order"},"total_scored":{"type":"integer","title":"Total Scored","default":0},"distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Distribution"},"previous_distribution":{"anyOf":[{"additionalProperties":{"type":"integer"},"type":"object"},{"type":"null"}],"title":"Previous Distribution"},"time_granularity":{"type":"string","title":"Time Granularity","default":"day"},"time_series":{"items":{"$ref":"#/components/schemas/MetricTimeSeriesPoint"},"type":"array","title":"Time Series"},"conversations":{"items":{"$ref":"#/components/schemas/MetricConversationRow"},"type":"array","title":"Conversations"},"conversations_offset":{"type":"integer","title":"Conversations Offset","default":0},"total_conversations_filtered":{"type":"integer","title":"Total Conversations Filtered","default":0}},"type":"object","required":["metric"],"title":"MetricDashboardAnalytics","description":"Aggregate payload for one metric dashboard (sentiment / resources / etc)."},"MetricTimeSeriesPoint":{"properties":{"date":{"type":"string","title":"Date"},"total":{"type":"integer","title":"Total","default":0},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"}},"type":"object","required":["date"],"title":"MetricTimeSeriesPoint"},"MinimumAdjustment":{"properties":{"month":{"type":"string","title":"Month"},"minimum_usd":{"type":"number","title":"Minimum Usd"},"is_prorated":{"type":"boolean","title":"Is Prorated"},"usage_usd":{"type":"number","title":"Usage Usd"},"shortfall_usd":{"type":"number","title":"Shortfall Usd"}},"type":"object","required":["month","minimum_usd","is_prorated","usage_usd","shortfall_usd"],"title":"MinimumAdjustment","description":"A closed month where the account's monthly minimum applied."},"MinimumAdjustmentModel":{"properties":{"month":{"type":"string","title":"Month","description":"Calendar month, 'YYYY-MM'."},"minimum_usd":{"type":"number","title":"Minimum Usd","description":"The floor in effect, prorated by days for a partial month."},"is_prorated":{"type":"boolean","title":"Is Prorated","description":"True when the floor covered only part of the month."},"usage_usd":{"type":"number","title":"Usage Usd","description":"Metered consumption that month."},"shortfall_usd":{"type":"number","title":"Shortfall Usd","description":"max(0, minimum − usage) — charged to the balance."}},"type":"object","required":["month","minimum_usd","is_prorated","usage_usd","shortfall_usd"],"title":"MinimumAdjustmentModel","description":"One closed month where the account's contractual monthly minimum\napplied — the audit trail behind `minimum_shortfall_usd`."},"MintMyMemKeyResponse":{"properties":{"action":{"type":"string","title":"Action"},"revoked_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revoked Prefix"},"key":{"$ref":"#/components/schemas/OperatorMcpKey"}},"type":"object","required":["action","revoked_prefix","key"],"title":"MintMyMemKeyResponse"},"MintOperatorMcpKeyRequest":{"properties":{"token_prefix":{"type":"string","maxLength":16,"minLength":4,"title":"Token Prefix"},"token_hash":{"type":"string","maxLength":64,"minLength":64,"title":"Token Hash"}},"type":"object","required":["token_prefix","token_hash"],"title":"MintOperatorMcpKeyRequest","description":"Carries the key's PREFIX and HASH, never the key.\n\nThe panel generates the credential in the browser (crypto.getRandomValues +\nSHA-256) and sends only what the server needs to store — the same contract\nthe FGT tab uses, for the same reason: a plaintext the server never receives\ncannot leak from a server log, a trace, or an APM payload.\n\n`token_prefix` is display-only (see `app/mcp_admin/api_keys.py`): nothing\nauthenticates by it, and its format is all the server can check."},"MintOperatorMcpKeyResponse":{"properties":{"action":{"type":"string","title":"Action"},"revoked_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revoked Prefix"},"operator":{"$ref":"#/components/schemas/OperatorRow"}},"type":"object","required":["action","revoked_prefix","operator"],"title":"MintOperatorMcpKeyResponse"},"ModelBreakdownRow":{"properties":{"model":{"type":"string","title":"Model"},"cost_usd":{"type":"number","title":"Cost Usd"},"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"cache_read_tokens":{"type":"integer","title":"Cache Read Tokens"},"cache_write_tokens":{"type":"integer","title":"Cache Write Tokens"},"llm_requests":{"type":"integer","title":"Llm Requests"},"pct_of_total":{"type":"number","title":"Pct Of Total"}},"type":"object","required":["model","cost_usd","input_tokens","output_tokens","cache_read_tokens","cache_write_tokens","llm_requests","pct_of_total"],"title":"ModelBreakdownRow"},"ModelCostBreakdown":{"properties":{"model":{"type":"string","title":"Model"},"kind":{"type":"string","title":"Kind","description":"'playbook' for agent messages, 'postprocessing' for scoring aggregate","default":"playbook"},"total_cost_usd":{"type":"number","title":"Total Cost Usd"},"total_input_tokens":{"type":"integer","title":"Total Input Tokens"},"total_output_tokens":{"type":"integer","title":"Total Output Tokens"},"total_cache_read_tokens":{"type":"integer","title":"Total Cache Read Tokens"},"total_cache_write_tokens":{"type":"integer","title":"Total Cache Write Tokens"},"total_messages":{"type":"integer","title":"Total Messages"},"total_conversations":{"type":"integer","title":"Total Conversations"},"total_llm_requests":{"type":"integer","title":"Total Llm Requests"},"total_tool_calls":{"type":"integer","title":"Total Tool Calls"},"avg_cost_per_message":{"type":"number","title":"Avg Cost Per Message"}},"type":"object","required":["model","total_cost_usd","total_input_tokens","total_output_tokens","total_cache_read_tokens","total_cache_write_tokens","total_messages","total_conversations","total_llm_requests","total_tool_calls","avg_cost_per_message"],"title":"ModelCostBreakdown","description":"Per-model row. Single ``total_cost_usd`` because each row is either\n100% playbook OR 100% postprocessing — never mixed. The synthetic\npostprocessing row uses ``kind=\"postprocessing\"``."},"ModifyOrderRequest":{"properties":{"items_to_add":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items To Add","description":"List of {product_id, quantity} to add","default":[]},"items_to_remove":{"items":{"type":"string"},"type":"array","title":"Items To Remove","description":"List of product_ids to remove","default":[]}},"type":"object","title":"ModifyOrderRequest"},"MonitorComparisonKind":{"type":"string","enum":["absolute","baseline_relative"],"title":"MonitorComparisonKind"},"MonitorDefinitionCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filter","description":"Compound conversation filter (tag / skill / handoff combined with AND/OR). Null or empty group matches every conversation in the window."},"window_basis":{"$ref":"#/components/schemas/MonitorWindowBasis","default":"last_message"},"playbook_base_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Playbook Base Id","description":"Playbook scoping (version-stable Playbook.base_id). The FE form requires this; null is reserved for future cross-playbook use cases at the API level."},"cron_expression":{"type":"string","maxLength":100,"minLength":9,"title":"Cron Expression","default":"*/10 * * * *"},"window_minutes":{"type":"integer","maximum":1440.0,"minimum":1.0,"title":"Window Minutes"},"comparison_kind":{"$ref":"#/components/schemas/MonitorComparisonKind","default":"absolute"},"threshold":{"type":"number","exclusiveMinimum":0.0,"title":"Threshold"},"baseline_hours":{"anyOf":[{"type":"integer","maximum":168.0,"minimum":1.0},{"type":"null"}],"title":"Baseline Hours"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Recipients"}},"type":"object","required":["name","window_minutes","threshold"],"title":"MonitorDefinitionCreate"},"MonitorDefinitionResponse":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id"},"account_id":{"type":"string","title":"Account Id"},"name":{"type":"string","title":"Name"},"filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filter"},"window_basis":{"$ref":"#/components/schemas/MonitorWindowBasis"},"playbook_base_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"},"cron_expression":{"type":"string","title":"Cron Expression"},"window_minutes":{"type":"integer","title":"Window Minutes"},"comparison_kind":{"$ref":"#/components/schemas/MonitorComparisonKind"},"threshold":{"type":"number","title":"Threshold"},"baseline_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Baseline Hours"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Recipients"},"is_enabled":{"type":"boolean","title":"Is Enabled"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run At"},"last_triggered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Triggered At"},"recent_runs":{"items":{"$ref":"#/components/schemas/MonitorSparklinePoint"},"type":"array","title":"Recent Runs","default":[]}},"type":"object","required":["id","project_id","account_id","name","filter","window_basis","cron_expression","window_minutes","comparison_kind","threshold","baseline_hours","slack_channel","email_recipients","is_enabled","created_at","updated_at"],"title":"MonitorDefinitionResponse"},"MonitorDefinitionUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filter","description":"Compound conversation filter. Pass an empty group to clear the filter (match every conversation in the window)."},"window_basis":{"anyOf":[{"$ref":"#/components/schemas/MonitorWindowBasis"},{"type":"null"}]},"project_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Project Id","description":"Re-parent the monitor to a different project. Only meaningful when ``playbook_base_id`` also changes — the FE assistant grid ties the two fields together."},"playbook_base_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Playbook Base Id"},"cron_expression":{"anyOf":[{"type":"string","maxLength":100,"minLength":9},{"type":"null"}],"title":"Cron Expression"},"window_minutes":{"anyOf":[{"type":"integer","maximum":1440.0,"minimum":1.0},{"type":"null"}],"title":"Window Minutes"},"comparison_kind":{"anyOf":[{"$ref":"#/components/schemas/MonitorComparisonKind"},{"type":"null"}]},"threshold":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Threshold"},"baseline_hours":{"anyOf":[{"type":"integer","maximum":168.0,"minimum":1.0},{"type":"null"}],"title":"Baseline Hours"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Recipients"},"is_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Enabled"}},"type":"object","title":"MonitorDefinitionUpdate"},"MonitorDefinitionsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MonitorDefinitionResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"MonitorDefinitionsListResponse"},"MonitorPreviewBucket":{"properties":{"bucket_start":{"type":"string","format":"date-time","title":"Bucket Start"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["bucket_start","count"],"title":"MonitorPreviewBucket","description":"One day in the preview chart."},"MonitorPreviewRequest":{"properties":{"filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Filter"},"window_basis":{"$ref":"#/components/schemas/MonitorWindowBasis","default":"last_message"},"playbook_base_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Playbook Base Id"},"window_minutes":{"type":"integer","maximum":1440.0,"minimum":1.0,"title":"Window Minutes"}},"type":"object","required":["window_minutes"],"title":"MonitorPreviewRequest","description":"Live preview body — same scope fields as the monitor itself, plus a\nlookback ``window_minutes`` so the form can show the current count."},"MonitorPreviewResponse":{"properties":{"daily_buckets":{"items":{"$ref":"#/components/schemas/MonitorPreviewBucket"},"type":"array","title":"Daily Buckets"},"window_count":{"type":"integer","title":"Window Count"}},"type":"object","required":["daily_buckets","window_count"],"title":"MonitorPreviewResponse"},"MonitorRunResponse":{"properties":{"id":{"type":"string","title":"Id"},"monitor_id":{"type":"string","title":"Monitor Id"},"project_id":{"type":"string","title":"Project Id"},"account_id":{"type":"string","title":"Account Id"},"status":{"$ref":"#/components/schemas/MonitorRunStatus"},"triggered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Triggered"},"current_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Value"},"threshold_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold Value"},"baseline_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Baseline Value"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"window_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Window Start"},"window_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Window End"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","monitor_id","project_id","account_id","status","triggered","current_value","threshold_value","baseline_value","summary","window_start","window_end","error_message","started_at","completed_at","created_at"],"title":"MonitorRunResponse"},"MonitorRunStatus":{"type":"string","enum":["pending","running","completed","failed"],"title":"MonitorRunStatus"},"MonitorRunsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MonitorRunResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"MonitorRunsListResponse"},"MonitorSparklinePoint":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At"},"status":{"$ref":"#/components/schemas/MonitorRunStatus"},"triggered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Triggered"},"current_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Value"},"threshold_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold Value"},"baseline_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Baseline Value"}},"type":"object","required":["created_at","status","triggered","current_value","threshold_value","baseline_value"],"title":"MonitorSparklinePoint","description":"A compact run snapshot used by sparkline + chart UI surfaces."},"MonitorWindowBasis":{"type":"string","enum":["last_message","first_message"],"title":"MonitorWindowBasis","description":"Anchor for the monitor's time window.\n\n- LAST_MESSAGE: the conversation had any activity inside the window.\n- FIRST_MESSAGE: the conversation was created inside the window."},"MonthlyMinimumModel":{"properties":{"amount_usd":{"type":"number","title":"Amount Usd"},"starts_on":{"type":"string","format":"date","title":"Starts On"},"ends_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Ends On","description":"Exclusive end date, when the commitment ended."}},"type":"object","required":["amount_usd","starts_on"],"title":"MonthlyMinimumModel"},"MoveTaskRequest":{"properties":{"to_conversation_id":{"type":"string","minLength":1,"title":"To Conversation Id","description":"The conversation the task goes on in — where the person actually answered. It must not be pursuing a task of its own, nor have been handed off to a human.","examples":["215477031885392"]}},"type":"object","required":["to_conversation_id"],"title":"MoveTaskRequest","description":"Move a conversation's live task to another conversation of the same person."},"MyMemKeyResponse":{"properties":{"key":{"anyOf":[{"$ref":"#/components/schemas/OperatorMcpKey"},{"type":"null"}]}},"type":"object","required":["key"],"title":"MyMemKeyResponse"},"NoHandoffAssertion":{"properties":{"type":{"type":"string","const":"no_handoff","title":"Type","default":"no_handoff"}},"type":"object","title":"NoHandoffAssertion","description":"Assert that NO handoff event (agent or team) was emitted."},"NonBillableEntryModel":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"note":{"type":"string","title":"Note"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By","description":"Who marked it."},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When it was marked (not when the conversation happened)."}},"type":"object","required":["conversation_id","note"],"title":"NonBillableEntryModel"},"NonBillableListResponse":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"price_basis":{"type":"string","title":"Price Basis","description":"'resolved' (only deflected conversations are billed) or 'conversation'."},"total":{"type":"integer","title":"Total","description":"Marked conversations matching the filter, before limit/offset."},"items":{"items":{"$ref":"#/components/schemas/NonBillableEntryModel"},"type":"array","title":"Items"}},"type":"object","required":["account_id","account_name","price_basis","total","items"],"title":"NonBillableListResponse"},"NoteEventData":{"properties":{"content":{"type":"string","title":"Content","description":"Private note content"}},"additionalProperties":false,"type":"object","required":["content"],"title":"NoteEventData","description":"Data for note event."},"NoteItem":{"properties":{"text":{"type":"string","title":"Text","description":"The correction note text"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the note was created"}},"type":"object","required":["text"],"title":"NoteItem","description":"A single correction note with timestamp."},"NotionCredentialsUpdate":{"properties":{"notion_api_key":{"type":"string","title":"Notion Api Key","description":"New Notion API key"}},"type":"object","required":["notion_api_key"],"title":"NotionCredentialsUpdate","description":"Request model for updating Notion credentials."},"NotionItem":{"properties":{"id":{"type":"string","title":"Id","description":"Unique ID for RAG tracking"},"notion_page_id":{"type":"string","title":"Notion Page Id","description":"Original Notion page ID"},"title":{"type":"string","title":"Title","description":"Page title"},"content":{"type":"string","title":"Content","description":"Markdown content (editable)"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id","description":"Parent NotionItem.id for hierarchy (None = root)"},"depth":{"type":"integer","title":"Depth","description":"Nesting level (0 = root)","default":0},"last_imported_at":{"type":"string","format":"date-time","title":"Last Imported At","description":"When this page was imported"},"last_edited_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Edited At","description":"When user manually edited content"},"notion_last_modified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Notion Last Modified At","description":"Last modified time from Notion API"},"is_manually_edited":{"type":"boolean","title":"Is Manually Edited","description":"Track if content was manually edited","default":false},"notes":{"anyOf":[{"items":{"$ref":"#/components/schemas/NoteItem"},"type":"array"},{"type":"null"}],"title":"Notes","description":"Correction notes injected into RAG search results"}},"type":"object","required":["notion_page_id","title","content"],"title":"NotionItem","description":"A single Notion page item stored flat with parent reference for tree structure."},"NotionItemUpdate":{"properties":{"content":{"type":"string","title":"Content","description":"New markdown content"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Optional title update"}},"type":"object","required":["content"],"title":"NotionItemUpdate","description":"Request model for updating a Notion item's content."},"NotionKnowledgeBaseCreate":{"properties":{"title":{"type":"string","title":"Title","description":"Title of the knowledge base"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"Optional markdown-formatted instructions for LLM when using this KB"},"metadata_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Fields","description":"Optional list of additional metadata field names to extract from retrieved chunks"},"notion_api_key":{"type":"string","title":"Notion Api Key","description":"Notion API integration key (will be encrypted)"},"notion_root_page_id":{"type":"string","title":"Notion Root Page Id","description":"Notion page ID to import (with subpages)"},"kb_type":{"$ref":"#/components/schemas/KnowledgeBaseType","description":"Knowledge base type (always NOTION)","default":"notion"}},"type":"object","required":["title","notion_api_key","notion_root_page_id"],"title":"NotionKnowledgeBaseCreate","description":"Model for creating a NOTION knowledge base.\n\nImports pages from Notion recursively. The API key is encrypted and stored.\nSupports re-import to sync changes from Notion."},"NotionPreviewJobRequest":{"properties":{"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key","description":"Notion API key/integration token (optional in reimport)"},"page_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Id","description":"Notion page ID to import from (optional in reimport)"},"kb_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Id","description":"Existing KB ID (UUID) for reimport mode (to use stored credentials)"}},"type":"object","title":"NotionPreviewJobRequest","description":"Request model for starting a Notion preview job.\n\nIn reimport mode (kb_id provided), api_key and page_id are optional.\nIf not provided, they will be fetched from the existing KB."},"NotionPreviewJobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id","description":"Unique job ID to poll for progress"}},"type":"object","required":["job_id"],"title":"NotionPreviewJobResponse","description":"Response model for starting a Notion preview job."},"NotionReimportResponse":{"properties":{"knowledgebase":{"$ref":"#/components/schemas/KnowledgeBase"},"edited_pages_overwritten":{"items":{"type":"string"},"type":"array","title":"Edited Pages Overwritten","description":"Titles of manually edited pages that were overwritten"}},"type":"object","required":["knowledgebase"],"title":"NotionReimportResponse","description":"Response model for Notion reimport."},"NotionValidateResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"object_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object Type"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["valid"],"title":"NotionValidateResponse","description":"Response model for Notion API key/page validation."},"OperatorAccountRow":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"}},"type":"object","required":["account_id","account_name"],"title":"OperatorAccountRow"},"OperatorListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OperatorRow"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"OperatorListResponse"},"OperatorMcpKey":{"properties":{"token_prefix":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Prefix"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"}},"type":"object","required":["token_prefix","created_at","last_used_at"],"title":"OperatorMcpKey","description":"An operator's live mak_ key in one scope (an admin MCP key, or a mem key).\nNever the key itself — only the hash is stored, and the display prefix is\nall that can ever be shown again."},"OperatorMembershipResponse":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"user_id":{"type":"integer","title":"User Id"},"username":{"type":"string","title":"Username"},"is_admin":{"type":"boolean","title":"Is Admin"}},"type":"object","required":["account_id","account_name","user_id","username","is_admin"],"title":"OperatorMembershipResponse","description":"The operator's own seat inside a customer account.\n\nThe admin MCP asks this before it runs any cross-account write, so the\nanswer is the identity the write executes as — not a yes/no."},"OperatorOutboundRequest":{"properties":{"content":{"type":"string","minLength":1,"title":"Content","description":"The literal outbound text the operator sent.","examples":["Hola Karina, te queremos ofrecer un 50% de descuento en tu primer mes. ¿Te interesa?"]}},"type":"object","required":["content"],"title":"OperatorOutboundRequest","description":"Body for POST /playbooks/{base_id}/conversations/{cid}/operator-outbound.\n\nRecords an operator-initiated outbound (HSM template, broadcast, etc.)\nas a standalone assistant row in the conversation, before any user\nreply. When the user later replies via the chat endpoint, the LLM\npicks up this outbound as context automatically."},"OperatorOutboundResponse":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"The conversation the outbound was recorded against.","examples":["conv_abc123"]},"message_index":{"type":"integer","title":"Message Index","description":"The 0-based index of the persisted assistant row.","examples":[0]}},"type":"object","required":["conversation_id","message_index"],"title":"OperatorOutboundResponse","description":"Response for the operator-outbound endpoint."},"OperatorRow":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"totp_enrolled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Totp Enrolled At"},"accounts":{"items":{"$ref":"#/components/schemas/OperatorAccountRow"},"type":"array","title":"Accounts"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"is_service":{"type":"boolean","title":"Is Service"},"mcp_key":{"anyOf":[{"$ref":"#/components/schemas/OperatorMcpKey"},{"type":"null"}]},"mem_key":{"anyOf":[{"$ref":"#/components/schemas/OperatorMcpKey"},{"type":"null"}]}},"type":"object","required":["id","email","role","totp_enrolled_at","accounts","created_at","is_service","mcp_key","mem_key"],"title":"OperatorRow"},"Order":{"properties":{"id":{"type":"string","title":"Id"},"customer_name":{"type":"string","title":"Customer Name"},"customer_email":{"type":"string","title":"Customer Email"},"customer_phone":{"type":"string","title":"Customer Phone"},"delivery_address":{"type":"string","title":"Delivery Address"},"items":{"items":{"$ref":"#/components/schemas/OrderItem"},"type":"array","title":"Items"},"subtotal":{"type":"number","title":"Subtotal"},"delivery_fee":{"type":"number","title":"Delivery Fee"},"total":{"type":"number","title":"Total"},"payment_status":{"$ref":"#/components/schemas/PaymentStatus"},"delivery_status":{"$ref":"#/components/schemas/DeliveryStatus"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"estimated_delivery":{"type":"string","format":"date-time","title":"Estimated Delivery"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"}},"type":"object","required":["id","customer_name","customer_email","customer_phone","delivery_address","items","subtotal","delivery_fee","total","payment_status","delivery_status","created_at","estimated_delivery"],"title":"Order"},"OrderItem":{"properties":{"product_id":{"type":"string","title":"Product Id"},"product_name":{"type":"string","title":"Product Name"},"quantity":{"type":"integer","title":"Quantity"},"unit_price":{"type":"number","title":"Unit Price"},"total":{"type":"number","title":"Total"}},"type":"object","required":["product_id","product_name","quantity","unit_price","total"],"title":"OrderItem"},"OrganizationRef":{"properties":{"id":{"type":"string","title":"Id","description":"The caller's stable identifier for this organization (its company id, CRM account id, …).","examples":["acme-42"]}},"type":"object","required":["id"],"title":"OrganizationRef","description":"Which organization the human on the other side belongs to, as the calling channel knows it.\n\nObject form of ``PlaybookChatRequest.organization`` — the same shape as\n``UserRef``, one level up: in a B2B channel several people write on behalf of\none company, and this is the caller's id for that company."},"OutboundAttachment":{"properties":{"asset_id":{"type":"string","title":"Asset Id","description":"Media-library file id"},"kind":{"type":"string","enum":["image","document","video","audio"],"title":"Kind"},"media_type":{"type":"string","title":"Media Type"},"filename":{"type":"string","title":"Filename"},"url":{"type":"string","title":"Url","description":"Public URL a channel can fetch (images: the variant under 5 MB / 2000 px)"},"title":{"type":"string","title":"Title"},"caption":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caption"},"size_bytes":{"type":"integer","title":"Size Bytes","default":0},"thumbnail_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Url"}},"type":"object","required":["asset_id","kind","media_type","filename","url","title"],"title":"OutboundAttachment","description":"A media-library file the assistant attached to its reply, resolved and validated.\n\nThe events list carries the same file as an `image`/`file` event (or a link\nin a `message`); this typed list is for callers that render the reply\nthemselves (the dashboard, API consumers) and want the thumbnail and title."},"OverrideSchedule":{"properties":{"slots":{"items":{"$ref":"#/components/schemas/TimeSlot"},"type":"array","title":"Slots","description":"Time slots for this override"}},"type":"object","required":["slots"],"title":"OverrideSchedule","description":"Schedule for a date override (modified hours)."},"OverviewKpis":{"properties":{"total_cost_usd":{"type":"number","title":"Total Cost Usd"},"llm_requests":{"type":"integer","title":"Llm Requests"},"total_tokens":{"type":"integer","title":"Total Tokens"},"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"cache_read_tokens":{"type":"integer","title":"Cache Read Tokens"},"cache_write_tokens":{"type":"integer","title":"Cache Write Tokens"},"cache_hit_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cache Hit Rate"},"assistant_cache_hit_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Assistant Cache Hit Rate"},"previous":{"anyOf":[{"$ref":"#/components/schemas/KpiNumbers"},{"type":"null"}]}},"type":"object","required":["total_cost_usd","llm_requests","total_tokens","input_tokens","output_tokens","cache_read_tokens","cache_write_tokens","cache_hit_rate","assistant_cache_hit_rate","previous"],"title":"OverviewKpis"},"PaymentEntry":{"properties":{"id":{"type":"string","title":"Id"},"is_credit":{"type":"boolean","title":"Is Credit","description":"True = prepaid credit (feeds the Balance); False = plain payment."},"amount_usd":{"type":"number","title":"Amount Usd"},"paid_at":{"type":"string","format":"date-time","title":"Paid At","description":"Effective date (drives the revenue year)."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"}},"type":"object","required":["id","is_credit","amount_usd","paid_at"],"title":"PaymentEntry"},"PaymentLink":{"properties":{"id":{"type":"string","title":"Id"},"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"},"url":{"type":"string","title":"Url"},"amount":{"type":"number","title":"Amount"},"currency":{"type":"string","title":"Currency","default":"ARS"},"description":{"type":"string","title":"Description"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","url","amount","description","expires_at","created_at"],"title":"PaymentLink"},"PaymentPromise":{"properties":{"id":{"type":"string","title":"Id"},"invoice_id":{"type":"string","title":"Invoice Id"},"promised_date":{"type":"string","format":"date-time","title":"Promised Date"},"amount":{"type":"number","title":"Amount"},"contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","invoice_id","promised_date","amount","created_at"],"title":"PaymentPromise"},"PaymentState":{"properties":{"order_id":{"type":"string","title":"Order Id"},"status":{"type":"string","title":"Status","description":"pending | approved"},"amount":{"type":"number","title":"Amount"},"currency":{"type":"string","title":"Currency","default":"ARS"}},"type":"object","required":["order_id","status","amount"],"title":"PaymentState"},"PaymentStatus":{"type":"string","enum":["pending","completed","failed","refunded"],"title":"PaymentStatus"},"PendingChangeItem":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","required":["id","title"],"title":"PendingChangeItem","description":"One item that will change on the next training run."},"PendingChangesResponse":{"properties":{"kb_id":{"type":"string","title":"Kb Id"},"kb_type":{"type":"string","title":"Kb Type"},"has_backup":{"type":"boolean","title":"Has Backup"},"added":{"items":{"$ref":"#/components/schemas/PendingChangeItem"},"type":"array","title":"Added"},"edited":{"items":{"$ref":"#/components/schemas/PendingChangeItem"},"type":"array","title":"Edited"},"deleted":{"items":{"$ref":"#/components/schemas/PendingChangeItem"},"type":"array","title":"Deleted"}},"type":"object","required":["kb_id","kb_type","has_backup","added","edited","deleted"],"title":"PendingChangesResponse","description":"Item-level diff between a knowledge base and its backed-up previous version.\n\nUsed by the UI to let the user review exactly which items will be added,\nupdated, or removed before submitting the training job."},"PersonalityTone":{"properties":{"id":{"type":"string","title":"Id","description":"Language-agnostic personality tone identifier"},"name":{"type":"string","title":"Name","description":"Localized name of the personality tone"},"description":{"type":"string","title":"Description","description":"Localized description of the personality tone"},"examples":{"items":{"type":"string"},"type":"array","title":"Examples","description":"Localized examples demonstrating the personality tone"}},"type":"object","required":["id","name","description","examples"],"title":"PersonalityTone","description":"Personality tone with localized name, description, and examples."},"PersonalityToneEnum":{"type":"string","enum":["friendly","professional","informal","emojiFun","concise"],"title":"PersonalityToneEnum","description":"Supported personality tones for suggestions.\n\nThese must match the IDs defined in app/const.py PERSONALITY_TONES."},"PersonalityTonesResponse":{"properties":{"personality_tones":{"items":{"$ref":"#/components/schemas/PersonalityTone"},"type":"array","title":"Personality Tones","description":"List of available personality tones"},"language":{"type":"string","title":"Language","description":"Language of the returned personality tones"}},"type":"object","required":["personality_tones","language"],"title":"PersonalityTonesResponse","description":"Response containing list of available personality tones."},"PlaceCallRequest":{"properties":{"to":{"type":"string","title":"To","description":"The person's number, E.164 (+5491155550000).","examples":["+5491155550000"]},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"What the assistant is told about this call once the person answers, as `context` on every turn: the reason for calling, the order, the amount — whatever the instructions read.","examples":[{"monto":"15.000 pesos","motivo":"factura 1234 vencida"}]},"demo":{"type":"boolean","title":"Demo","description":"Run this call as a demo even if the number is not a demo line: a recorded StudioChat intro, the assistant speaks first, one minute of conversation, a recorded outro. On a demo line every call is one already.","default":false}},"type":"object","required":["to"],"title":"PlaceCallRequest","description":"Call someone from the assistant's number, the way a task is assigned: who, and what for."},"PlacedCall":{"properties":{"call":{"additionalProperties":true,"type":"object","title":"Call"}},"type":"object","required":["call"],"title":"PlacedCall"},"PlatformApprovalListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PlatformApprovalResponse"},"type":"array","title":"Items"},"pending_count":{"type":"integer","title":"Pending Count"}},"type":"object","required":["items","pending_count"],"title":"PlatformApprovalListResponse"},"PlatformApprovalResponse":{"properties":{"id":{"type":"string","title":"Id"},"proposed_by_user_id":{"type":"string","title":"Proposed By User Id"},"proposed_by_email":{"type":"string","title":"Proposed By Email"},"origin":{"type":"string","title":"Origin"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"},"kind":{"type":"string","title":"Kind"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"},"target_label":{"type":"string","title":"Target Label"},"field":{"type":"string","title":"Field"},"current_value":{"anyOf":[{},{"type":"null"}],"title":"Current Value"},"proposed_value":{"anyOf":[{},{"type":"null"}],"title":"Proposed Value"},"reason":{"type":"string","title":"Reason"},"request_method":{"type":"string","title":"Request Method"},"request_path":{"type":"string","title":"Request Path"},"status":{"type":"string","title":"Status"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"reviewed_by_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewed By Email"},"reviewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reviewed At"},"review_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Note"},"execution_status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Execution Status Code"},"execution_result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Execution Result"},"executed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Executed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","proposed_by_user_id","proposed_by_email","origin","client_name","kind","account_id","target_label","field","current_value","proposed_value","reason","request_method","request_path","status","expires_at","reviewed_by_email","reviewed_at","review_note","execution_status_code","execution_result","executed_at","created_at","updated_at"],"title":"PlatformApprovalResponse"},"Playbook":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the playbook"},"content":{"type":"string","title":"Content","description":"Free-text instructions for the project"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Global reference conversation examples"},"kb_ids":{"items":{"type":"string"},"type":"array","title":"Kb Ids","description":"List of knowledge base IDs the project can access"},"api_tools":{"items":{"type":"string"},"type":"array","title":"Api Tools","description":"List of API tool IDs active in this playbook version"},"enrichment_tool_ids":{"items":{"type":"string"},"type":"array","title":"Enrichment Tool Ids","description":"Subset of api_tools to auto-run at conversation start (enrichment). Their results are pre-loaded into the system prompt before the LLM's first turn."},"skip_attachments":{"type":"boolean","title":"Skip Attachments","description":"When True, message attachments (images, files) are stripped before reaching the LLM. Useful for non-vision models or playbooks where attachments are noise. Attachments are still stored on the conversation — only LLM input is filtered.","default":false},"tasks":{"items":{"$ref":"#/components/schemas/PlaybookTask"},"type":"array","title":"Tasks","description":"Catalog of tasks this assistant can pursue. Empty = plain reactive assistant. Which one a conversation pursues is set per conversation, not here."},"watches":{"items":{"$ref":"#/components/schemas/PlaybookWatch"},"type":"array","title":"Watches","description":"Catalog of watches this assistant can schedule (checks that run on their own every N minutes and wake the conversation when they resolve). A watch is exposed to the assistant only where a `{{ watch: name }}` pill names it."},"button_sets":{"anyOf":[{"$ref":"#/components/schemas/PlaybookButtonSets-Output"},{"type":"null"}],"description":"Predefined reply-button and suggestion sets the assistant offers by id ({{ buttons: id }} / {{ suggestions: id }} in its instructions), and the mode (sets_only, sets_and_free, free). Needs the account's button_sets flag. Null: no sets."},"card_sets":{"anyOf":[{"$ref":"#/components/schemas/PlaybookCardSets-Output"},{"type":"null"}],"description":"Predefined card sets (carousels) the assistant offers by id ({{ cards: id }} in its instructions). Shown only in Rumo Embedded inboxes; text elsewhere. Needs the account's card_sets flag. Null: no sets."},"flow_sets":{"anyOf":[{"items":{"$ref":"#/components/schemas/FlowSet"},"type":"array","maxItems":30},{"type":"null"}],"title":"Flow Sets","description":"WhatsApp Flows the assistant sends by id ({{ flow: id }} in its instructions). Only on WhatsApp Cloud Rumo inboxes; the text fallback elsewhere. Needs the account's flow_sets flag. Null: none."},"template_sets":{"anyOf":[{"items":{"$ref":"#/components/schemas/TemplateSet"},"type":"array","maxItems":30},{"type":"null"}],"title":"Template Sets","description":"Approved WhatsApp templates the assistant may send by id ({{ template: id }}): to re-engage outside the 24h window, to start a conversation (Tasks API) and for follow-ups. Needs the account's template_sets flag. Null: none."},"id":{"type":"string","title":"Id","description":"Unique ID for this specific playbook version"},"base_id":{"type":"string","title":"Base Id","description":"Common ID shared by all versions of this playbook"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this playbook belongs to"},"version_number":{"type":"integer","title":"Version Number","description":"Version number of this playbook","default":1},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Whether this playbook is soft-deleted","default":false},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Model configuration: single model name or experiment format 'model_a:90,model_b:10'"},"skills":{"items":{"$ref":"#/components/schemas/Skill-Output"},"type":"array","title":"Skills","description":"Skills attached to this playbook version"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When this specific version was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When the playbook was last updated"},"first_version_created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Version Created At","description":"When version 1 was created (for display purposes)"}},"type":"object","required":["name","content","id","base_id","project_id","created_at","updated_at"],"title":"Playbook","description":"Full playbook model with all fields.\n\nEach playbook version has a unique id.\nAll versions of the same playbook share a base_id."},"PlaybookAnalyticsMetrics":{"properties":{"playbook_id":{"type":"string","title":"Playbook Id","description":"Playbook ID"},"playbook_name":{"type":"string","title":"Playbook Name","description":"Playbook name"},"playbook_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Playbook Version","description":"Playbook version"},"total_conversations":{"type":"integer","title":"Total Conversations","description":"Total conversations for this playbook"},"conversations_with_handoff":{"type":"integer","title":"Conversations With Handoff","description":"Conversations that required handoff"},"deflection_rate":{"type":"number","title":"Deflection Rate","description":"Percentage of conversations resolved without handoff (0-100)"}},"type":"object","required":["playbook_id","playbook_name","total_conversations","conversations_with_handoff","deflection_rate"],"title":"PlaybookAnalyticsMetrics","description":"Analytics metrics for a specific playbook."},"PlaybookAttachments":{"properties":{"id":{"type":"string","title":"Id","description":"Unique ID for this specific playbook version"},"base_id":{"type":"string","title":"Base Id","description":"Common ID shared by all versions of this playbook"},"version_number":{"type":"integer","title":"Version Number","description":"Version number of this playbook"},"kb_ids":{"items":{"type":"string"},"type":"array","title":"Kb Ids","description":"Knowledge base IDs available to this assistant"},"api_tools":{"items":{"type":"string"},"type":"array","title":"Api Tools","description":"API tool IDs available to this assistant"},"enrichment_tool_ids":{"items":{"type":"string"},"type":"array","title":"Enrichment Tool Ids","description":"Subset of api_tools auto-run at conversation start (enrichment)."}},"type":"object","required":["id","base_id","version_number"],"title":"PlaybookAttachments","description":"kb_ids/api_tools/enrichment_tool_ids for one playbook version.\n\nSplit out of the main Playbook read responses (which exclude these three\nfields) so the few UI screens that actually need raw attachment ids —\nthe deleted-KB badge, the version-diff modal, the enrichment-tools\ndialog — fetch them explicitly instead of every assistant GET carrying\nunpopulated-looking id arrays."},"PlaybookButtonSets-Input":{"properties":{"mode":{"type":"string","enum":["free","sets_and_free","sets_only"],"title":"Mode","description":"sets_only: the assistant may only offer these sets. sets_and_free: sets, or buttons it writes itself. free: sets are not offered (buttons the assistant writes, as without sets).","default":"sets_and_free"},"sets":{"items":{"$ref":"#/components/schemas/ButtonSet-Input"},"type":"array","maxItems":50,"title":"Sets"}},"additionalProperties":false,"type":"object","title":"PlaybookButtonSets","description":"The assistant's predefined button and suggestion sets, and how freely it may use its own.\n\nVersioned with the playbook like tasks and watches. Only used when the\naccount has the ``button_sets`` flag and the assistant has reply buttons on."},"PlaybookButtonSets-Output":{"properties":{"mode":{"type":"string","enum":["free","sets_and_free","sets_only"],"title":"Mode","description":"sets_only: the assistant may only offer these sets. sets_and_free: sets, or buttons it writes itself. free: sets are not offered (buttons the assistant writes, as without sets).","default":"sets_and_free"},"sets":{"items":{"$ref":"#/components/schemas/ButtonSet-Output"},"type":"array","maxItems":50,"title":"Sets"}},"additionalProperties":false,"type":"object","title":"PlaybookButtonSets","description":"The assistant's predefined button and suggestion sets, and how freely it may use its own.\n\nVersioned with the playbook like tasks and watches. Only used when the\naccount has the ``button_sets`` flag and the assistant has reply buttons on."},"PlaybookCardSets-Input":{"properties":{"sets":{"items":{"$ref":"#/components/schemas/CardSet-Input"},"type":"array","maxItems":50,"title":"Sets"}},"additionalProperties":false,"type":"object","title":"PlaybookCardSets","description":"The assistant's predefined card sets (carousels).\n\nVersioned with the playbook like ``button_sets``. Only used when the account\nhas the ``card_sets`` flag and the assistant has reply buttons on. There is\nno mode: the assistant never writes cards of its own, it can only offer these."},"PlaybookCardSets-Output":{"properties":{"sets":{"items":{"$ref":"#/components/schemas/CardSet-Output"},"type":"array","maxItems":50,"title":"Sets"}},"additionalProperties":false,"type":"object","title":"PlaybookCardSets","description":"The assistant's predefined card sets (carousels).\n\nVersioned with the playbook like ``button_sets``. Only used when the account\nhas the ``card_sets`` flag and the assistant has reply buttons on. There is\nno mode: the assistant never writes cards of its own, it can only offer these."},"PlaybookChatRequest":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"Unique conversation identifier for tracking playbook state","examples":["conv_123456"]},"user_message":{"type":"string","title":"User Message","description":"The user's latest message","examples":["I need help with my order"]},"user":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/UserRef"},{"type":"null"}],"title":"User","description":"Who this conversation belongs to — the caller's own id for the human on the other side. Accepts a bare string or `{\"id\": \"...\"}`. **Set-once:** send it on every turn if that's simpler (resending the same id is a no-op, so bridges need no state); the first id wins and a later, different id is refused rather than applied — a conversation belongs to one person for its whole life. Surfaces to the assistant as the `{{ user: id }}` pill, which has its own namespace — whatever you send under `context.user` is yours and is left alone.","examples":["6543f2a1b9c",{"id":"6543f2a1b9c"}]},"organization":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/OrganizationRef"},{"type":"null"}],"title":"Organization","description":"Which organization this conversation belongs to — the caller's own id for the company the person writes on behalf of (B2B channels). Accepts a bare string or `{\"id\": \"...\"}`. Same **set-once** rule as `user`, and independent of it: resend it every turn if that's simpler; the first id wins and a later, different id is refused rather than applied. A conversation can have an organization without a user and vice versa. Surfaces to the assistant as the `{{ organization: id }}` pill, in its own namespace — `context.organization` is yours and is left alone.","examples":["acme-42",{"id":"acme-42"}]},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Optional context information about the conversation, user, or session. This can include user details, conversation metadata, or any additional context that helps the agent provide better responses or extract tool parameters.","examples":[{"account_type":"premium","email":"user@example.com","user_id":"user_123"}]},"is_eval":{"type":"boolean","title":"Is Eval","description":"Mark this conversation as an evaluation conversation. Eval conversations are excluded from the chat log by default.","default":false},"include_citations":{"type":"boolean","title":"Include Citations","description":"Include inline citation markers [[ID]] and citation metadata in the response. When False (default), citation markers are stripped from messages for backwards compatibility.","default":false},"include_example_refs":{"type":"boolean","title":"Include Example Refs","description":"Include inline example reference markers <<ID>> and example_refs metadata in the response. When False (default), markers are stripped.","default":false},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array"},{"type":"null"}],"title":"Attachments","description":"Optional list of attachments (e.g., images) to include with the message. Images will be sent to the LLM for visual analysis."},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Optional tags from the omnichannel to associate with this conversation. Accumulates across messages. Stored separately from agent-generated tags."},"accepts_attachments":{"anyOf":[{"items":{"type":"string","enum":["image","document","video","audio"]},"type":"array"},{"type":"null"}],"title":"Accepts Attachments","description":"Which kinds of file the caller can deliver to the person as native attachments. An assistant with a media library may attach files to its reply; images always come back as `image` events (every bridge has that type), while documents, videos and audio come back as `file` events ONLY for the kinds listed here — otherwise they degrade to a `message` event carrying the file's link, which every channel renders. Omit for a caller that never declared support (the safe default: only `image` events, links for the rest).","examples":[["image","document"]]},"accepts_buttons":{"type":"boolean","title":"Accepts Buttons","description":"The caller renders reply buttons. Only matters for an assistant with reply buttons on. True: its question comes back as a `buttons` event ({prompt, layout, items, suggestions, text}); `text` is the same question as a numbered list. False (default): the question comes back as a `message` event with the options as a numbered list, so a caller that only reads messages never loses it. The person can answer with the number or the text.","default":false},"accepts_flows":{"type":"boolean","title":"Accepts Flows","description":"The caller sends WhatsApp Flows (a Rumo bridge on a WhatsApp Cloud inbox). Only matters for an assistant with flow sets and the account's flow_sets flag. True: the assistant may pick a flow set and it comes back as a `flow` event {set_id, rumo_flow_id, inbox_id, cta, body, header, footer, screen, data, ref, fallback_template, fallback_text, text}. False (default): flow sets are not offered at all.","default":false},"accepts_templates":{"type":"boolean","title":"Accepts Templates","description":"The caller sends approved WhatsApp templates. Only matters for an assistant with template sets and the account's template_sets flag. True: a picked template comes back as a `template` event {set_id, inbox_id, template_name, language, category, template_params, ref, use, fallback_text, text}. False (default): template sets are not offered.","default":false},"accepts_cards":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Accepts Cards","description":"The caller renders card carousels (only matters for an assistant with card sets). True: a card set comes back as a `cards` event. False: it comes back as a `message` with the cards as text. Omitted: a turn that names a `channel_id` (a bridge) gets text; any other caller follows `accepts_buttons`, as before this field existed."},"accepts_close":{"type":"boolean","title":"Accepts Close","description":"The caller can close (resolve) the conversation in its system. Only matters for an assistant with the `{{ platform_tool: close_conversation }}` pill. True: when the assistant closes, the reply carries a `close` event {reason} as its LAST event (never in a turn that hands off); execute it after everything else in the reply. False (default): the assistant is told it cannot close and no `close` event is ever emitted.","default":false},"selection":{"anyOf":[{"$ref":"#/components/schemas/ChatSelection"},{"type":"null"}],"description":"The reply button the customer tapped, when this turn's message is a tap. Only a tap whose `signature` verifies (Rumo's kaption_selection signature) and that was not already used on another message reaches the assistant, as context.button_selection {title, value, menu_id, set_id}; anything else leaves the turn as plain text (`user_message` is the button title)."},"flow_response":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Flow Response","description":"The customer's answer to a WhatsApp Flow, when this turn's message is one: Rumo's content_attributes.kaption_flow ({flow_id, flow_name, ref, verified, flow_send_id, labels, fields, sensitive_keys}) plus `response_json` from whatsapp_flow_response. Only `verified: true` answers reach the assistant (as a <flow_response> block and context.flow_response); flow_token is dropped."},"channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id","description":"The registered channel (adapter) this conversation arrives through — the id the channel registration minted, the same one that keys the adapter's stored config. Send it on every turn; the backend validates it belongs to your account (a foreign id is ignored and logged, the turn never fails over it) and stamps it on the conversation. The stamp is how a follow-up later finds its way back to your adapter. Omit for traffic that has no channel (direct API, playground).","examples":["4f1855b8-2c1d-4b0a-9a3e-1f2e3d4c5b6a"]},"playbook_override":{"anyOf":[{"$ref":"#/components/schemas/PlaybookOverride"},{"type":"null"}],"description":"Override playbook fields in memory for this chat (instructions, skills, examples, KBs, tools). Requires admin or API-key authentication. Forces the conversation into preview+eval mode so it doesn't affect production analytics. Use for QA / iteration without saving a new playbook version."},"tool_mocks":{"anyOf":[{"additionalProperties":{"anyOf":[{"$ref":"#/components/schemas/ToolMockSpec"},{"items":{"$ref":"#/components/schemas/ToolMockSpec"},"type":"array"}]},"type":"object"},{"type":"null"}],"title":"Tool Mocks","description":"Optional tool-call mocks for this chat (admin / API-key only). Keys are tool names; values are one or more ``ToolMockSpec`` rules — same shape as ``EvalCase.tool_mocks``. Matching calls return the canned ``return_value`` or raise ``error`` instead of executing the real tool. Mocked calls surface with ``is_mocked=true`` on the response's ``tool_calls`` entries so the QA caller can tell them apart from real ones. Passing this field forces the conversation into preview+eval mode (excluded from chatlogs / sticky-model assignment / production analytics) the same way ``playbook_override`` does, and the mock list is exhaustive per tool: a call that matches none of the rules for a mocked tool fails the turn with a loud error rather than falling through to the real implementation. Tools NOT listed here are unaffected and execute for real."},"prior_assistant_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prior Assistant Message","description":"Optional operator-initiated outbound to bundle with this user reply. Persisted as its own assistant row (marked kind=operator_outbound) and used to wrap the user prompt so the LLM picks up the context on the first reply. Only applied when this is the first message in the conversation (first_seen=True). Subsequent calls with this field set are silently ignored.\n\nIf you do NOT have the user reply yet (e.g., you just sent an HSM template and want to pre-register it), call the dedicated POST /playbooks/{base_id}/conversations/{conversation_id}/operator-outbound endpoint instead. When the user later replies via this chat endpoint, the LLM will pick up the pre-registered outbound automatically — no need to repeat it here.","examples":["Hola Karina, soy Mudafy. Te asignamos un asesor para tu consulta sobre el departamento en Tucumán 3096."]},"prior_messages":{"anyOf":[{"items":{"$ref":"#/components/schemas/PriorMessage"},"type":"array","maxItems":50},{"type":"null"}],"title":"Prior Messages","description":"What was said on the channel before the assistant joined: an automated menu, a form, another bot or a person that answered first. Oldest first, without `user_message`. Only applied on the conversation's first turn, like `prior_assistant_message`, and ignored afterwards — so a channel can send it on every turn without keeping state. Stored as one block of context the assistant reads on every turn and the chat log shows; it does not count as messages of the conversation.","examples":[[{"content":"Hola, no puedo ver la clase grabada de ayer","role":"user"},{"content":"¿Sobre qué querés consultar?","role":"assistant"},{"content":"Cursos y contenido","role":"user"}]]}},"type":"object","required":["conversation_id","user_message"],"title":"PlaybookChatRequest","description":"Request for chatting with a playbook agent."},"PlaybookChatResponse":{"properties":{"explanation":{"type":"string","title":"Explanation","description":"LLM-generated explanation of where we are in the playbook execution","examples":["User asked for help with their order. I greeted them and asked for their order number."]},"events":{"items":{"$ref":"#/components/schemas/ConversationEventModel"},"type":"array","title":"Events","description":"List of conversation events generated by the agent. Possible event types:\n- message: Send a message to the user\n- label: Apply a label to the conversation\n- priority: Set conversation priority\n- note: Add a private note\n- handoff_agent: Transfer to a specific agent\n- handoff_team: Transfer to a team\n- close: Close (resolve) the conversation, last — only when the request said accepts_close"},"collected_data":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Collected Data","description":"Form data when collect is completed (key-value pairs)","examples":[{"email":"user@example.com","order_number":"12345"}]},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCall"},"type":"array","title":"Tool Calls","description":"List of tool calls made by the agent during execution"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/CitationRef"},"type":"array"},{"type":"null"}],"title":"Citations","description":"Citation references from KB search results for inline citation display"},"example_refs":{"anyOf":[{"items":{"$ref":"#/components/schemas/ExampleRef"},"type":"array"},{"type":"null"}],"title":"Example Refs","description":"Example references indicating which conversation examples the assistant followed"},"elapsed_time_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Elapsed Time Ms","description":"Time taken to generate the response in milliseconds"},"pre_loaded_enrichments":{"anyOf":[{"items":{"$ref":"#/components/schemas/PreloadedEnrichment"},"type":"array"},{"type":"null"}],"title":"Pre Loaded Enrichments","description":"Enrichment API tool results preloaded into context this turn (no in-turn tool_call event)"},"task":{"anyOf":[{"$ref":"#/components/schemas/TaskEvaluation"},{"type":"null"}],"description":"The assistant's read on the task after this turn. Null for assistants without an task, or when the model did not emit the block."},"first_seen":{"type":"boolean","title":"First Seen","description":"True if this is the first message for this conversation, False otherwise"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"The user this conversation is bound to. Null when no caller has ever sent `user`. Echoed on every turn so the caller can see the binding without a second request.","examples":["6543f2a1b9c"]},"user_id_refused":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id Refused","description":"Set only when this request's `user` differed from the one already bound: the id we declined to switch to. The conversation stays with `user_id` — a transcript never changes hands. Null on every normal turn."},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id","description":"The organization this conversation is bound to. Null when no caller has ever sent `organization`. Echoed on every turn, like `user_id`.","examples":["acme-42"]},"organization_id_refused":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id Refused","description":"Set only when this request's `organization` differed from the one already bound: the id we declined to switch to. The conversation stays with `organization_id`. Null on every normal turn."},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/OutboundAttachment"},"type":"array"},{"type":"null"}],"title":"Attachments","description":"Media-library files attached to this reply, resolved to public URLs. Null when none."},"deep_link":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deep Link","description":"Chatlog URL anchored to this specific response (…/activity/chatlogs/{conversation_id}?r={response_index})","examples":["https://app.studiochat.io/activity/chatlogs/abc-123?r=2"]}},"type":"object","required":["explanation","first_seen"],"title":"PlaybookChatResponse","description":"Response from playbook agent containing events and metadata.","example":{"events":[{"data":{"content":"Hello! I can help you track your order. Could you please provide your order number?","private":false},"event_type":"message"},{"data":{"label":"order_support"},"event_type":"label"},{"data":{"priority":"medium"},"event_type":"priority"},{"data":{"content":"Customer inquiring about order tracking"},"event_type":"note"}],"explanation":"User asked for help with their order. I greeted them and asked for their order number.","first_seen":true,"tool_calls":[]}},"PlaybookConversation":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"Unique conversation identifier"},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id","description":"The caller's id for the human this conversation belongs to, as supplied by the channel via the chat request's `user` field. Null for conversations whose channel doesn't send one."},"external_organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Organization Id","description":"The caller's id for the organization this conversation belongs to, as supplied by the channel via the chat request's `organization` field. Null for conversations whose channel doesn't send one."},"inbox_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbox Id","description":"Chatwoot inbox ID (if from Chatwoot)"},"inbox_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbox Name","description":"Human-readable inbox name (if from Chatwoot)"},"playbook_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Id","description":"ID of the last playbook handling this conversation"},"playbook_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Name","description":"Name of the last playbook (fetched from DB)"},"playbook_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Playbook Version","description":"Version number of the last playbook (fetched from DB)"},"playbook_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Playbook Ids","description":"All playbook IDs that participated (null for pre-migration conversations)"},"playbooks_info":{"items":{"$ref":"#/components/schemas/PlaybookInfo"},"type":"array","title":"Playbooks Info","description":"Resolved info for all playbooks that participated"},"message_count":{"type":"integer","title":"Message Count","description":"Total number of messages in this conversation"},"first_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Message At","description":"Timestamp of the first message"},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Message At","description":"Timestamp of the last message"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Timestamp when the conversation was created"},"first_message_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Message Preview","description":"Preview of the first user message (max 100 chars)"},"first_user_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First User Message","description":"First user message in the conversation"},"last_assistant_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Assistant Message","description":"Last assistant message in the conversation"},"has_handoff":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Handoff","description":"Whether the conversation has a handoff"},"handoff_enabled":{"type":"boolean","title":"Handoff Enabled","description":"Whether the assistant that handled this conversation can hand off. False for no-handoff assistants — the UI hides the deflected/handoff dot.","default":true},"has_error":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Error","description":"Whether the conversation has an error (timeout, agent_error, usage_limit)"},"task_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Status","description":"Latest task status reported by the assistant (in_progress / done / failed). Null when the assistant has no task."},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Tags/labels applied during the conversation"},"external_tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"External Tags","description":"Tags provided externally via the chat API"},"avg_response_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Response Latency Ms","description":"Average response latency in milliseconds"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"LLM model used for this conversation"},"winback_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Winback Sent At","description":"Timestamp of the most recent winback sent (null = none sent). Updated on every winback."},"winback_answered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Winback Answered At","description":"When user replied after winback (null = not answered)"},"sentiment_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Label","description":"Customer sentiment: negative, neutral, or positive (null if not scored)"},"sentiment_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Reason","description":"Explanation of the sentiment scoring, in the conversation language"},"resources_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resources Label","description":"Resources relevance: irrelevant, partial, or relevant (null if no tools used or not scored)"},"resources_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resources Reason","description":"Explanation of the resource relevance scoring"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary","description":"AI-generated summary of the conversation (null if not scored)"},"user_intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Intent","description":"Free text describing what the user wanted to accomplish"},"sentiment_shift":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Shift","description":"How sentiment changed: improved, stable, degraded"},"sentiment_shift_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Shift Reason","description":"Explanation of sentiment shift"},"deflection_quality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deflection Quality","description":"Quality of deflection (non-handoff only): resolved, actioned, partial, no_response"},"deflection_quality_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deflection Quality Reason","description":"Explanation of deflection quality"},"handoff_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handoff Reason","description":"Why handoff occurred (handoff only): policy, user_request, frustration, bot_limitation"},"handoff_reason_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Handoff Reason Detail","description":"Explanation of handoff reason"},"recontact_risk":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recontact Risk","description":"Risk of recontact: low, medium, high"},"recontact_risk_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recontact Risk Reason","description":"Explanation of recontact risk"},"skills":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Skills","description":"Skills loaded during the conversation"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Context dict passed to the agent (e.g. conversation context, contact info)"},"csat":{"anyOf":[{"$ref":"#/components/schemas/ConversationCSATInfo"},{"type":"null"}],"description":"CSAT rating imported from a connected enrichment (e.g. Intercom)"}},"type":"object","required":["conversation_id","message_count"],"title":"PlaybookConversation","description":"Metadata about a conversation in a project."},"PlaybookConversationMessage-Input":{"properties":{"role":{"type":"string","title":"Role","description":"Message role: 'user', 'assistant', or 'tool'"},"content":{"type":"string","title":"Content","description":"Message content"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Timestamp when message was created"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Additional metadata (inbox_id, inbox_name, etc.)"},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCall"},"type":"array","title":"Tool Calls","description":"Tool calls made in this message (for assistant messages)"},"is_winback":{"type":"boolean","title":"Is Winback","description":"Whether this message is a winback follow-up message","default":false},"attachments":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array","title":"Attachments","description":"Attachments (images) included with this message"},"turn_index":{"type":"integer","title":"Turn Index","description":"Zero-based position of this turn among user + assistant raw turns. All expanded rows of a single raw assistant turn (multi-message V1/V2 payloads) share the same value — group bubbles by it and key turn-level actions (e.g. Improve Answer) off it."},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Per-message context dict sent with this (user) message at chat time. Null for messages that carried no context. Lets the UI show how context evolves across the conversation instead of only the latest snapshot."}},"type":"object","required":["role","content","turn_index"],"title":"PlaybookConversationMessage","description":"A single message in a playbook conversation."},"PlaybookConversationMessage-Output":{"properties":{"role":{"type":"string","title":"Role","description":"Message role: 'user', 'assistant', or 'tool'"},"content":{"type":"string","title":"Content","description":"Message content"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Timestamp when message was created"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Additional metadata (inbox_id, inbox_name, etc.)"},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCall"},"type":"array","title":"Tool Calls","description":"Tool calls made in this message (for assistant messages)"},"is_winback":{"type":"boolean","title":"Is Winback","description":"Whether this message is a winback follow-up message","default":false},"attachments":{"items":{"$ref":"#/components/schemas/Attachment"},"type":"array","title":"Attachments","description":"Attachments (images) included with this message"},"turn_index":{"type":"integer","title":"Turn Index","description":"Zero-based position of this turn among user + assistant raw turns. All expanded rows of a single raw assistant turn (multi-message V1/V2 payloads) share the same value — group bubbles by it and key turn-level actions (e.g. Improve Answer) off it."},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Per-message context dict sent with this (user) message at chat time. Null for messages that carried no context. Lets the UI show how context evolves across the conversation instead of only the latest snapshot."}},"type":"object","required":["role","content","turn_index"],"title":"PlaybookConversationMessage","description":"A single message in a playbook conversation."},"PlaybookConversationsResponse":{"properties":{"conversations":{"items":{"$ref":"#/components/schemas/PlaybookConversation"},"type":"array","title":"Conversations","description":"List of conversations"},"total":{"type":"integer","title":"Total","description":"Total number of conversations (before pagination)"},"limit":{"type":"integer","title":"Limit","description":"Maximum number of conversations returned"},"offset":{"type":"integer","title":"Offset","description":"Number of conversations skipped"}},"type":"object","required":["conversations","total","limit","offset"],"title":"PlaybookConversationsResponse","description":"Response for listing project conversations with pagination metadata."},"PlaybookCostBreakdown":{"properties":{"playbook_cost_usd":{"type":"number","title":"Playbook Cost Usd","description":"Playbook-agent LLM cost (ChatMessage.cost_usd sum)","default":0.0},"postprocessing_cost_usd":{"type":"number","title":"Postprocessing Cost Usd","description":"Conversation-metrics / scoring LLM cost (ConversationMetrics.cost_usd sum)","default":0.0},"eval_cost_usd":{"type":"number","title":"Eval Cost Usd","description":"Eval-only overhead cost (EvalRun.eval_overhead_cost_usd sum) — simulator + LLM-judge OpenRouter spend. Populated for account-level and per-playbook rows; 0 on dimensions where eval cost is not well-defined (tags, models, individual conversations).","default":0.0},"total_cost_usd":{"type":"number","title":"Total Cost Usd","description":"playbook_cost_usd + postprocessing_cost_usd + eval_cost_usd","default":0.0},"playbook_name":{"type":"string","title":"Playbook Name"},"playbook_base_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"},"total_input_tokens":{"type":"integer","title":"Total Input Tokens"},"total_output_tokens":{"type":"integer","title":"Total Output Tokens"},"total_messages":{"type":"integer","title":"Total Messages"},"total_conversations":{"type":"integer","title":"Total Conversations"},"avg_cost_per_conversation":{"type":"number","title":"Avg Cost Per Conversation"}},"type":"object","required":["playbook_name","total_input_tokens","total_output_tokens","total_messages","total_conversations","avg_cost_per_conversation"],"title":"PlaybookCostBreakdown"},"PlaybookCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the playbook"},"content":{"type":"string","title":"Content","description":"Free-text instructions for the project"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Global reference conversation examples"},"kb_ids":{"items":{"type":"string"},"type":"array","title":"Kb Ids","description":"List of knowledge base IDs the project can access"},"api_tools":{"items":{"type":"string"},"type":"array","title":"Api Tools","description":"List of API tool IDs active in this playbook version"},"enrichment_tool_ids":{"items":{"type":"string"},"type":"array","title":"Enrichment Tool Ids","description":"Subset of api_tools to auto-run at conversation start (enrichment). Their results are pre-loaded into the system prompt before the LLM's first turn."},"skip_attachments":{"type":"boolean","title":"Skip Attachments","description":"When True, message attachments (images, files) are stripped before reaching the LLM. Useful for non-vision models or playbooks where attachments are noise. Attachments are still stored on the conversation — only LLM input is filtered.","default":false},"tasks":{"items":{"$ref":"#/components/schemas/PlaybookTask"},"type":"array","title":"Tasks","description":"Catalog of tasks this assistant can pursue. Empty = plain reactive assistant. Which one a conversation pursues is set per conversation, not here."},"watches":{"items":{"$ref":"#/components/schemas/PlaybookWatch"},"type":"array","title":"Watches","description":"Catalog of watches this assistant can schedule (checks that run on their own every N minutes and wake the conversation when they resolve). A watch is exposed to the assistant only where a `{{ watch: name }}` pill names it."},"button_sets":{"anyOf":[{"$ref":"#/components/schemas/PlaybookButtonSets-Input"},{"type":"null"}],"description":"Predefined reply-button and suggestion sets the assistant offers by id ({{ buttons: id }} / {{ suggestions: id }} in its instructions), and the mode (sets_only, sets_and_free, free). Needs the account's button_sets flag. Null: no sets."},"card_sets":{"anyOf":[{"$ref":"#/components/schemas/PlaybookCardSets-Input"},{"type":"null"}],"description":"Predefined card sets (carousels) the assistant offers by id ({{ cards: id }} in its instructions). Shown only in Rumo Embedded inboxes; text elsewhere. Needs the account's card_sets flag. Null: no sets."},"flow_sets":{"anyOf":[{"items":{"$ref":"#/components/schemas/FlowSet"},"type":"array","maxItems":30},{"type":"null"}],"title":"Flow Sets","description":"WhatsApp Flows the assistant sends by id ({{ flow: id }} in its instructions). Only on WhatsApp Cloud Rumo inboxes; the text fallback elsewhere. Needs the account's flow_sets flag. Null: none."},"template_sets":{"anyOf":[{"items":{"$ref":"#/components/schemas/TemplateSet"},"type":"array","maxItems":30},{"type":"null"}],"title":"Template Sets","description":"Approved WhatsApp templates the assistant may send by id ({{ template: id }}): to re-engage outside the 24h window, to start a conversation (Tasks API) and for follow-ups. Needs the account's template_sets flag. Null: none."},"handoff_enabled":{"type":"boolean","title":"Handoff Enabled","description":"True if the assistant can hand off to a human; False for a no-handoff assistant. Editable afterwards via the playbook settings endpoint.","default":true}},"type":"object","required":["name","content"],"title":"PlaybookCreate","description":"Model for creating a new playbook."},"PlaybookDemoPublicConfig":{"properties":{"playbook_base_id":{"type":"string","title":"Playbook Base Id"},"assistant_name":{"type":"string","title":"Assistant Name","description":"Display name of the active version"},"account_name":{"type":"string","title":"Account Name","description":"The account's name, for the brand header"},"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url","description":"API-relative URL of the account logo, or None when there is none"},"api_key":{"type":"string","title":"Api Key","description":"Browser-exposed API key to send as X-API-Key on the chat route"},"api_key_expires_at":{"type":"string","format":"date-time","title":"Api Key Expires At","description":"When api_key stops working (about an hour). Fetch this route again for the next one."},"channels":{"items":{"type":"string"},"type":"array","title":"Channels","description":"Demo channels available: whatsapp, web, email"},"tasks":{"items":{"$ref":"#/components/schemas/DemoTask"},"type":"array","title":"Tasks","description":"Tasks the visitor may start the conversation with (POST .../demo/start): the active version's catalog, when the account has tasks. Name and inputs only — never the task's text."}},"type":"object","required":["playbook_base_id","assistant_name","account_name","api_key","api_key_expires_at","channels"],"title":"PlaybookDemoPublicConfig","description":"Everything the public demo page needs to render and chat. No auth: the page is public.\n\n``api_key`` is a ``kps_`` key flagged ``is_public`` — it can only reach\n``POST /playbooks/{base_id}/active/chat`` and is rate-limited per IP, so handing\nit to any visitor is the design, not a leak. See app/auth.py PUBLIC_CLIENT_ALLOWED_ROUTES."},"PlaybookDemoStatus":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"True when the demo is on (the switch), whatever the key's state"},"urls":{"additionalProperties":{"type":"string"},"type":"object","title":"Urls","description":"Shareable demo URL per channel (whatsapp, web, email). Empty when disabled."},"api_key_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Id","description":"The browser-exposed project API key the demo minted last"},"api_key_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key Name","description":"Name of that key ('Demo · <assistant> #<n>'), as listed under Settings → API keys"},"api_key_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Api Key Expires At","description":"When that key stops working. Past = the next visitor to open a demo page gets the next one minted."},"key_sequence":{"type":"integer","title":"Key Sequence","description":"How many keys this demo has minted so far","default":0},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["enabled"],"title":"PlaybookDemoStatus","description":"What an operator sees about an assistant's public demo."},"PlaybookDeployment":{"properties":{"id":{"type":"string","title":"Id","description":"Deployment ID"},"playbook_id":{"type":"string","title":"Playbook Id","description":"ID of the deployed playbook version"},"inbox_id":{"type":"string","title":"Inbox Id","description":"Chatwoot inbox ID where the playbook is deployed"},"deployed_at":{"type":"string","format":"date-time","title":"Deployed At","description":"When the playbook was deployed"}},"type":"object","required":["id","playbook_id","inbox_id","deployed_at"],"title":"PlaybookDeployment","description":"Full playbook deployment model.\n\nPoints to a specific playbook version ID.\nTo check if outdated, join with playbooks on base_id and compare version_number."},"PlaybookDeploymentCreate":{"properties":{"inbox_id":{"type":"string","title":"Inbox Id","description":"Chatwoot inbox ID to deploy the playbook to"}},"type":"object","required":["inbox_id"],"title":"PlaybookDeploymentCreate","description":"Model for deploying a playbook to an inbox."},"PlaybookHistoryItem":{"properties":{"id":{"type":"string","title":"Id","description":"Unique ID of this playbook version"},"version_number":{"type":"integer","title":"Version Number","description":"Version number of this snapshot"},"name":{"type":"string","title":"Name","description":"Name of the playbook at this version"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When this version was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When this version was last updated"}},"type":"object","required":["id","version_number","name","created_at","updated_at"],"title":"PlaybookHistoryItem","description":"Lightweight playbook history item without content."},"PlaybookInfo":{"properties":{"id":{"type":"string","title":"Id","description":"Playbook version UUID"},"name":{"type":"string","title":"Name","description":"Playbook name"},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version","description":"Version number"}},"type":"object","required":["id","name"],"title":"PlaybookInfo","description":"Compact playbook identity for multi-playbook display."},"PlaybookOverride":{"properties":{"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content","description":"Replacement playbook instructions (the main free-text content)."},"skills":{"anyOf":[{"items":{"$ref":"#/components/schemas/SkillOverrideInput"},"type":"array"},{"$ref":"#/components/schemas/PlaybookSkillsPatch"},{"type":"null"}],"title":"Skills","description":"Skills override. List form = full replace (empty list disables all). Object form (add/replace/remove) = surgical patch on top of the saved skills. Each skill object only needs name + description + content (trigger is not exposed because the agent's system prompt only surfaces name/description for skill discovery). Each skill is treated as active regardless of any flag."},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Replacement global reference conversation examples."},"kb_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Kb Ids","description":"Replacement list of knowledge base IDs."},"api_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Api Tools","description":"Replacement list of API tool IDs."},"enrichment_tool_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Enrichment Tool Ids","description":"Replacement list of enrichment tool IDs (auto-run at conversation start)."}},"type":"object","title":"PlaybookOverride","description":"Ephemeral playbook overrides for QA iteration.\n\nEach non-null field replaces the corresponding field on the playbook\n*in memory* before compilation. Nothing is persisted — the saved\nplaybook version is untouched. Intended for the QA skill / admin\nflows that need to iterate on instructions and skills (casuísticas)\nwithout saving a new version each time.\n\nConversations using an override are forced into preview+eval mode by\nthe caller so they don't pollute production analytics, sticky model\nassignment, or chatlogs.\n\nField semantics:\n  - ``None`` (default) → keep the playbook's value.\n  - Provided value → replace entirely (no merge / partial patch).\n  - ``skills`` accepts TWO shapes:\n      * ``list[SkillBase]`` → full replace (drop everything, use\n        exactly these). Empty list disables all skills.\n      * ``PlaybookSkillsPatch`` (``{add, replace, remove}``) →\n        surgical edit on top of the saved skills."},"PlaybookReference":{"properties":{"base_id":{"type":"string","title":"Base Id","description":"Base ID of the playbook"},"name":{"type":"string","title":"Name","description":"Name of the playbook"},"version_number":{"type":"integer","title":"Version Number","description":"Version number currently active/deployed"}},"type":"object","required":["base_id","name","version_number"],"title":"PlaybookReference","description":"Lightweight reference to a playbook for display in KB/tool lists."},"PlaybookSettings":{"properties":{"id":{"type":"string","title":"Id","description":"Unique ID of this settings record"},"playbook_base_id":{"type":"string","title":"Playbook Base Id","description":"Base ID of the playbook these settings belong to"},"url_shortener_enabled":{"type":"boolean","title":"Url Shortener Enabled","description":"Whether URL shortening is enabled","default":false},"url_shortener_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Url Shortener Params","description":"Query parameters config: {customParams: [{key, valueType, value?}]}"},"url_shortener_regex":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url Shortener Regex","description":"Regex pattern to filter which URLs to shorten (null = all URLs)"},"winback_enabled":{"type":"boolean","title":"Winback Enabled","description":"Derived, read-only: true when at least one follow-up rule is enabled. There is no per-assistant switch any more — follow-ups are enabled by the channel that delivers them (its adapter declares the `followup` capability) and declared by the rules.","default":false},"winback_webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Winback Webhook Url","description":"LEGACY transport, from before channels delivered follow-ups. While set it wins; clear it to deliver through the registered channel adapter."},"winback_rules":{"items":{"$ref":"#/components/schemas/WinbackRule-Output"},"type":"array","title":"Winback Rules","description":"Ordered winback rules. Each: tag filter → schedule → send gate (always | llm judge with the operator's criteria) → message brief → delivery tag. The first rule whose filter matches a quiet conversation owns it. Empty = nothing is ever sent."},"has_webhook_secret":{"type":"boolean","title":"Has Webhook Secret","description":"Whether a webhook secret is configured for HMAC signing","default":false},"proactive_webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proactive Webhook Url","description":"DEPRECATED — read by nothing. A proactive start goes through the channel named in the request (`channel_id` on POST /playbooks/{base_id}/conversations/start), not through a per-assistant URL. Kept only so a stored value is not lost."},"is_disabled":{"type":"boolean","title":"Is Disabled","description":"Kill switch - disables all chat endpoints for this playbook","default":false},"active_hours":{"anyOf":[{"$ref":"#/components/schemas/ActiveHours-Output"},{"type":"null"}],"description":"When the assistant is ON (weekly window); the cron flips is_disabled at its edges. null = manual only"},"active_hours_applied":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active Hours Applied","description":"Read-only: the state the window last put the assistant in (true = on, false = off), null = not applied yet. A manual toggle after that holds until the next edge."},"active_hours_applied_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active Hours Applied At","description":"Read-only: when the window last changed it"},"active_hours_next_change_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active Hours Next Change At","description":"Read-only, computed: the next edge of the window (UTC), when the cron will turn it on or off. null when the window is off, missing, or does not change within the next week."},"handoff_enabled":{"type":"boolean","title":"Handoff Enabled","description":"True if the assistant can hand off to a human; False if there is no human team and it never escalates","default":true},"buttons_enabled":{"type":"boolean","title":"Buttons Enabled","description":"True if the assistant may answer with reply buttons and suggestion chips","default":false},"voice":{"type":"string","enum":["male","female"],"title":"Voice","description":"The voice the assistant speaks with on a call: 'male' or 'female'","default":"male"},"call_recording_enabled":{"type":"boolean","title":"Call Recording Enabled","description":"True if the assistant's calls are recorded (stereo MP3, played back in the Chat Log, deleted after 90 days). The assistant tells the person at the start of a recorded call.","default":false},"max_history_turns":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max History Turns","description":"Max conversation turns to keep in history (null = global default of 30)"},"response_pacing":{"type":"string","title":"Response Pacing","description":"Response delay: 'none', 'medium' (1.5s), 'long' (5s), or seconds as text ('7', max 15)","default":"none"},"response_pacing_typing_wait":{"type":"boolean","title":"Response Pacing Typing Wait","description":"Wait for typing indicator to clear before responding","default":false},"default_messages":{"$ref":"#/components/schemas/AssistantDefaultMessages","description":"Static messages the channel sends for unsupported media and for the assistant being unavailable"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When these settings were created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When these settings were last updated"}},"type":"object","required":["id","playbook_base_id","created_at","updated_at"],"title":"PlaybookSettings","description":"Playbook-level settings that apply across all versions.\n\nStored in playbook_settings table, keyed by playbook base_id."},"PlaybookSettingsUpdate":{"properties":{"url_shortener_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Url Shortener Enabled","description":"Whether URL shortening is enabled"},"url_shortener_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Url Shortener Params","description":"Query parameters config: {customParams: [{key, valueType, value?}]}"},"url_shortener_regex":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url Shortener Regex","description":"Regex pattern to filter which URLs to shorten (null = all URLs)"},"winback_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Winback Enabled","description":"DEPRECATED and ignored: follow-ups are enabled by the channel and declared by the rules (disable a rule to pause it). Accepted so older clients do not 422."},"winback_webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Winback Webhook Url","description":"LEGACY transport. Send an empty string to clear it and deliver through the channel."},"winback_rules":{"anyOf":[{"items":{"$ref":"#/components/schemas/WinbackRule-Input"},"type":"array"},{"type":"null"}],"title":"Winback Rules","description":"Replaces the WHOLE list (read it first): order is priority, a rule you leave out is deleted. Keep each rule's id when editing it — conversations mid-campaign are pinned to it. Every rule needs at least one schedule step."},"proactive_webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proactive Webhook Url","description":"DEPRECATED — read by nothing: a proactive start goes through the channel named in the request (`channel_id` on /conversations/start). Accepted so existing clients don't break."},"is_disabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Disabled","description":"Kill switch - disables all chat endpoints for this playbook"},"active_hours":{"anyOf":[{"$ref":"#/components/schemas/ActiveHours-Input"},{"type":"null"}],"description":"When the assistant is ON, as a weekly window (timezone + slots per day; a slot whose end is not after its start crosses midnight). Saving it applies it immediately — is_disabled lands where the window says now — and from then on the active-hours cron (every 10 min) turns the assistant on and off at each edge. A manual is_disabled change holds until the next edge. enabled=false stops applying it and leaves the switch where it is."},"handoff_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Handoff Enabled","description":"Whether the assistant can hand off to a human. Takes effect on the next turn. Turning it OFF does not undo handoffs that already happened — those conversations stay handed off; the assistant simply stops being able to escalate new ones."},"buttons_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Buttons Enabled","description":"Whether the assistant may answer with reply buttons and suggestion chips. Takes effect on the next turn."},"voice":{"anyOf":[{"type":"string","enum":["male","female"]},{"type":"null"}],"title":"Voice","description":"The voice the assistant speaks with on a call: 'male' or 'female'. Takes effect on the next call."},"call_recording_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Call Recording Enabled","description":"Whether the assistant's calls are recorded. Takes effect on the next call; the assistant then tells the person at the start that the call is recorded. Recordings are deleted after 90 days."},"max_history_turns":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max History Turns","description":"Max conversation turns to keep in history (null = use global default)"},"response_pacing":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Pacing","description":"Response delay: 'none', 'medium' (1.5s), 'long' (5s), or seconds as text ('7', max 15)"},"response_pacing_typing_wait":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Response Pacing Typing Wait","description":"Wait for typing indicator to clear"},"default_messages":{"anyOf":[{"$ref":"#/components/schemas/AssistantDefaultMessages"},{"type":"null"}],"description":"Static messages for unsupported media and for the assistant being unavailable. Send the whole object; a slot set to null means 'not configured' and the channel keeps its own default."}},"type":"object","title":"PlaybookSettingsUpdate","description":"Update model for playbook settings."},"PlaybookSkillsPatch":{"properties":{"add":{"anyOf":[{"items":{"$ref":"#/components/schemas/SkillOverrideInput"},"type":"array"},{"type":"null"}],"title":"Add","description":"New skills to append. Their names must not already exist after remove is applied."},"replace":{"anyOf":[{"items":{"$ref":"#/components/schemas/SkillOverrideInput"},"type":"array"},{"type":"null"}],"title":"Replace","description":"Skills to replace by name. 422 if the named skill is not on the saved playbook."},"remove":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Remove","description":"Names of saved skills to drop. 422 if a name is not found."}},"type":"object","title":"PlaybookSkillsPatch","description":"Surgical skills patch — operator-based form of the ``skills`` override.\n\nUse this shape when you want to keep most of the saved playbook's\nskills and only **modify a subset**. Each operator targets skills by\n``name``:\n\n- ``remove``: drop the named skills. Names that don't exist raise 422.\n- ``replace``: swap the body of an existing skill (matched by name).\n  Names that don't exist raise 422 — explicit so typos surface fast.\n- ``add``: append new skills. Their ``name`` must not collide with an\n  existing saved skill (after ``remove`` has been applied) or with\n  another entry in ``add`` / ``replace``.\n\nOperators are applied in this order: ``remove`` → ``replace`` →\n``add``. The result is the full skill list used for the chat — no\nstorage refetch happens afterwards.\n\nUse the list-shape (``skills: [...]``) instead when you want the\nsimpler \"drop everything, use exactly these\" semantics."},"PlaybookTask":{"properties":{"id":{"type":"string","title":"Id","description":"Stable identifier, minted once when the task is first stored and preserved across renames and versions — this is what the API references, so a rename never breaks an integration. Empty only on a task that has never been saved: minting happens on the WRITE path (see storage._with_task_ids), never on read, because a read that mints hands out a different id on every request.","default":"","examples":["tsk_7f3ab2c19d04"]},"name":{"type":"string","title":"Name","description":"Kebab-case label, unique within the assistant (e.g. 'cobrar-deuda').","examples":["cobrar-deuda"]},"instructions":{"type":"string","title":"Instructions","description":"What to achieve and how it ends, in prose. Supports the same macros as instructions and skills ({{ kb() }}, {{ tool() }}, {{ custom_tool: }}, {{ examples: }}, {{ integration() }}, {{ context: }}) plus {{success}} / {{failure}}, which mark where the task terminates.","default":""}},"type":"object","required":["name"],"title":"PlaybookTask","description":"An task the assistant can pursue in a conversation.\n\nAn assistant carries a CATALOG of tasks (see ``Playbook.tasks``);\nwhich one a given conversation pursues is decided by whoever opens it, not\nby a condition here. Tasks live on the playbook VERSION, so editing\none creates a new version exactly like editing a skill — they are text, and\ntext is versioned.\n\nThe body is prose, not structured criteria: the outcomes are marked inline\nwith the ``{{success}}`` / ``{{failure}}`` macros, which lets an author\nexpress branches (\"insist for 3 days, then give up\") that a flat list of\ncriteria cannot."},"PlaybookUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Updated name of the playbook"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content","description":"Updated instructions for the project"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Updated global reference examples"},"kb_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Kb Ids","description":"Updated list of knowledge base IDs"},"api_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Api Tools","description":"Updated list of API tool IDs"},"enrichment_tool_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Enrichment Tool Ids","description":"Updated list of API tool IDs to auto-run at conversation start"},"skills":{"anyOf":[{"items":{"$ref":"#/components/schemas/SkillBase"},"type":"array"},{"type":"null"}],"title":"Skills","description":"Full set of skills to replace existing ones"},"skip_attachments":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Skip Attachments","description":"Toggle to skip attachments (images, files) when calling the LLM"},"tasks":{"anyOf":[{"items":{"$ref":"#/components/schemas/PlaybookTask"},"type":"array"},{"type":"null"}],"title":"Tasks","description":"Full replacement set of tasks. Omit to keep the current ones; send [] to remove them all and turn the assistant back into a plain reactive one."},"watches":{"anyOf":[{"items":{"$ref":"#/components/schemas/PlaybookWatch"},"type":"array"},{"type":"null"}],"title":"Watches","description":"Full replacement set of watches. Omit to keep the current ones; send [] to remove them all."},"button_sets":{"anyOf":[{"$ref":"#/components/schemas/PlaybookButtonSets-Input"},{"type":"null"}],"description":"Full replacement of the button sets and their mode. Omit to keep the current ones; send {\"mode\": \"free\", \"sets\": []} to remove them."},"card_sets":{"anyOf":[{"$ref":"#/components/schemas/PlaybookCardSets-Input"},{"type":"null"}],"description":"Full replacement of the card sets. Omit to keep the current ones; send {\"sets\": []} to remove them."},"flow_sets":{"anyOf":[{"items":{"$ref":"#/components/schemas/FlowSet"},"type":"array","maxItems":30},{"type":"null"}],"title":"Flow Sets","description":"Full replacement of the flow sets. Omit to keep the current ones; send [] to remove them."},"template_sets":{"anyOf":[{"items":{"$ref":"#/components/schemas/TemplateSet"},"type":"array","maxItems":30},{"type":"null"}],"title":"Template Sets","description":"Full replacement of the template sets. Omit to keep the current ones; send [] to remove them."},"expected_latest_version":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Expected Latest Version","description":"Optional guard against overwriting a newer version: the latest version number the caller saw when it loaded the assistant. If a newer version exists by the time this save runs, nothing is saved and the answer is 409 `stale_version` with the latest version's number. Omit to save unconditionally, as before."}},"type":"object","title":"PlaybookUpdate","description":"Model for updating a playbook."},"PlaybookWatch":{"properties":{"id":{"type":"string","title":"Id","description":"Stable identifier, minted once on first store and preserved across renames and versions (see storage._with_watch_ids). Empty only on a watch never saved.","default":"","examples":["wch_7f3ab2c19d04"]},"name":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{0,63}$","title":"Name","description":"Kebab-case label, unique within the assistant. The pill is `{{ watch: name }}` and the assistant's tool is `create_watch_<name with _>`.","examples":["deposito-pendiente"]},"instructions":{"type":"string","title":"Instructions","description":"What the runner does on each check, in prose, and how it ends. Supports the same macros as instructions and skills ({{ tool() }}, {{ custom_tool: }}, {{ kb() }}, {{ context: }}) plus {{completed}} marking where the watch ends. Reference the parameters by name.","default":""},"parameters":{"items":{"$ref":"#/components/schemas/WatchParameter"},"type":"array","title":"Parameters","description":"Values the assistant must collect before scheduling. All required."},"every_minutes":{"type":"integer","maximum":1440.0,"minimum":1.0,"title":"Every Minutes","description":"Minutes between checks. The cron runs every 5, so 5 is the floor.","default":10},"expires_minutes":{"type":"integer","maximum":10080.0,"minimum":1.0,"title":"Expires Minutes","description":"Give up after this long without completing; the assistant is told. Default and hard cap: 10080 (7 days) — no watch outlives a week.","default":10080},"on_resolve":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"On Resolve","description":"What to do when it resolves, for the assistant that is woken with the result: what to tell the person on completed / expired. It still decides — an empty reply is valid."},"on_pending":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"On Pending","description":"What to do after every check that has not completed yet (e.g. 'tell them we are still reviewing it'). Set = the assistant is woken with it after each such check; empty = it only hears the final outcome. A check that could not run (an error) never wakes it."}},"type":"object","required":["name"],"title":"PlaybookWatch","description":"A check the assistant can schedule on a conversation and be woken by.\n\n``WATCHES_MIN_EVERY_MINUTES`` lowers the cadence floor for a local run\n(``=1`` lets a test watch fire every minute); production leaves it at the\ncron's period.\n\n\"In ten minutes verify the transfer arrived\": the operator writes WHAT to\ncheck and HOW it ends here; the assistant schedules it mid-conversation\nwith the values it collected. A task on demand — same catalog shape as\n``Playbook.tasks``, same versioning (editing one cuts a version), same\na Completed marker for where it ends — plus what a task never has: a\ncadence, a deadline, and the parameters the assistant fills in.\n\nExposed to the assistant only where its instructions carry the\n``{{ watch: name }}`` pill: that placement is the switch, and inside a\nskill it is gated by that skill like any other referenced tool."},"PlaybookWithInboxes-Input":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the playbook"},"content":{"type":"string","title":"Content","description":"Free-text instructions for the project"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Global reference conversation examples"},"kb_ids":{"items":{"type":"string"},"type":"array","title":"Kb Ids","description":"List of knowledge base IDs the project can access"},"api_tools":{"items":{"type":"string"},"type":"array","title":"Api Tools","description":"List of API tool IDs active in this playbook version"},"enrichment_tool_ids":{"items":{"type":"string"},"type":"array","title":"Enrichment Tool Ids","description":"Subset of api_tools to auto-run at conversation start (enrichment). Their results are pre-loaded into the system prompt before the LLM's first turn."},"skip_attachments":{"type":"boolean","title":"Skip Attachments","description":"When True, message attachments (images, files) are stripped before reaching the LLM. Useful for non-vision models or playbooks where attachments are noise. Attachments are still stored on the conversation — only LLM input is filtered.","default":false},"tasks":{"items":{"$ref":"#/components/schemas/PlaybookTask"},"type":"array","title":"Tasks","description":"Catalog of tasks this assistant can pursue. Empty = plain reactive assistant. Which one a conversation pursues is set per conversation, not here."},"watches":{"items":{"$ref":"#/components/schemas/PlaybookWatch"},"type":"array","title":"Watches","description":"Catalog of watches this assistant can schedule (checks that run on their own every N minutes and wake the conversation when they resolve). A watch is exposed to the assistant only where a `{{ watch: name }}` pill names it."},"button_sets":{"anyOf":[{"$ref":"#/components/schemas/PlaybookButtonSets-Input"},{"type":"null"}],"description":"Predefined reply-button and suggestion sets the assistant offers by id ({{ buttons: id }} / {{ suggestions: id }} in its instructions), and the mode (sets_only, sets_and_free, free). Needs the account's button_sets flag. Null: no sets."},"card_sets":{"anyOf":[{"$ref":"#/components/schemas/PlaybookCardSets-Input"},{"type":"null"}],"description":"Predefined card sets (carousels) the assistant offers by id ({{ cards: id }} in its instructions). Shown only in Rumo Embedded inboxes; text elsewhere. Needs the account's card_sets flag. Null: no sets."},"flow_sets":{"anyOf":[{"items":{"$ref":"#/components/schemas/FlowSet"},"type":"array","maxItems":30},{"type":"null"}],"title":"Flow Sets","description":"WhatsApp Flows the assistant sends by id ({{ flow: id }} in its instructions). Only on WhatsApp Cloud Rumo inboxes; the text fallback elsewhere. Needs the account's flow_sets flag. Null: none."},"template_sets":{"anyOf":[{"items":{"$ref":"#/components/schemas/TemplateSet"},"type":"array","maxItems":30},{"type":"null"}],"title":"Template Sets","description":"Approved WhatsApp templates the assistant may send by id ({{ template: id }}): to re-engage outside the 24h window, to start a conversation (Tasks API) and for follow-ups. Needs the account's template_sets flag. Null: none."},"id":{"type":"string","title":"Id","description":"Unique ID for this specific playbook version"},"base_id":{"type":"string","title":"Base Id","description":"Common ID shared by all versions of this playbook"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this playbook belongs to"},"version_number":{"type":"integer","title":"Version Number","description":"Version number of this playbook","default":1},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Whether this playbook is soft-deleted","default":false},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Model configuration: single model name or experiment format 'model_a:90,model_b:10'"},"skills":{"items":{"$ref":"#/components/schemas/Skill-Input"},"type":"array","title":"Skills","description":"Skills attached to this playbook version"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When this specific version was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When the playbook was last updated"},"first_version_created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Version Created At","description":"When version 1 was created (for display purposes)"},"connected_inboxes":{"items":{"$ref":"#/components/schemas/InboxWithPlaybook"},"type":"array","title":"Connected Inboxes","description":"List of inboxes where this playbook is deployed"},"latest_ci_run":{"anyOf":[{"$ref":"#/components/schemas/EvalRun"},{"type":"null"}],"description":"Most recent CI eval run (``trigger_source=ci``) for this playbook, across all versions — the GitHub-style check badge the assistants list renders. ``None`` when the playbook never had a CI run (kaption account, no eval cases, or feature off)."},"active_version_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active Version Number","description":"Version number currently serving production for this playbook (``playbook_active_versions``). The playbook itself is always the LATEST version, so a value lower than ``version_number`` means the latest edit is saved but not live. ``None`` means no version was ever activated — not that version 1 is active."},"active_version_set_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active Version Set At","description":"When ``active_version_number`` was activated. ``None`` when no version was ever activated."}},"type":"object","required":["name","content","id","base_id","project_id","created_at","updated_at"],"title":"PlaybookWithInboxes","description":"Playbook model with connected inbox information."},"PlaybookWithInboxes-Output":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the playbook"},"content":{"type":"string","title":"Content","description":"Free-text instructions for the project"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Global reference conversation examples"},"kb_ids":{"items":{"type":"string"},"type":"array","title":"Kb Ids","description":"List of knowledge base IDs the project can access"},"api_tools":{"items":{"type":"string"},"type":"array","title":"Api Tools","description":"List of API tool IDs active in this playbook version"},"enrichment_tool_ids":{"items":{"type":"string"},"type":"array","title":"Enrichment Tool Ids","description":"Subset of api_tools to auto-run at conversation start (enrichment). Their results are pre-loaded into the system prompt before the LLM's first turn."},"skip_attachments":{"type":"boolean","title":"Skip Attachments","description":"When True, message attachments (images, files) are stripped before reaching the LLM. Useful for non-vision models or playbooks where attachments are noise. Attachments are still stored on the conversation — only LLM input is filtered.","default":false},"tasks":{"items":{"$ref":"#/components/schemas/PlaybookTask"},"type":"array","title":"Tasks","description":"Catalog of tasks this assistant can pursue. Empty = plain reactive assistant. Which one a conversation pursues is set per conversation, not here."},"watches":{"items":{"$ref":"#/components/schemas/PlaybookWatch"},"type":"array","title":"Watches","description":"Catalog of watches this assistant can schedule (checks that run on their own every N minutes and wake the conversation when they resolve). A watch is exposed to the assistant only where a `{{ watch: name }}` pill names it."},"button_sets":{"anyOf":[{"$ref":"#/components/schemas/PlaybookButtonSets-Output"},{"type":"null"}],"description":"Predefined reply-button and suggestion sets the assistant offers by id ({{ buttons: id }} / {{ suggestions: id }} in its instructions), and the mode (sets_only, sets_and_free, free). Needs the account's button_sets flag. Null: no sets."},"card_sets":{"anyOf":[{"$ref":"#/components/schemas/PlaybookCardSets-Output"},{"type":"null"}],"description":"Predefined card sets (carousels) the assistant offers by id ({{ cards: id }} in its instructions). Shown only in Rumo Embedded inboxes; text elsewhere. Needs the account's card_sets flag. Null: no sets."},"flow_sets":{"anyOf":[{"items":{"$ref":"#/components/schemas/FlowSet"},"type":"array","maxItems":30},{"type":"null"}],"title":"Flow Sets","description":"WhatsApp Flows the assistant sends by id ({{ flow: id }} in its instructions). Only on WhatsApp Cloud Rumo inboxes; the text fallback elsewhere. Needs the account's flow_sets flag. Null: none."},"template_sets":{"anyOf":[{"items":{"$ref":"#/components/schemas/TemplateSet"},"type":"array","maxItems":30},{"type":"null"}],"title":"Template Sets","description":"Approved WhatsApp templates the assistant may send by id ({{ template: id }}): to re-engage outside the 24h window, to start a conversation (Tasks API) and for follow-ups. Needs the account's template_sets flag. Null: none."},"id":{"type":"string","title":"Id","description":"Unique ID for this specific playbook version"},"base_id":{"type":"string","title":"Base Id","description":"Common ID shared by all versions of this playbook"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this playbook belongs to"},"version_number":{"type":"integer","title":"Version Number","description":"Version number of this playbook","default":1},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Whether this playbook is soft-deleted","default":false},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Model configuration: single model name or experiment format 'model_a:90,model_b:10'"},"skills":{"items":{"$ref":"#/components/schemas/Skill-Output"},"type":"array","title":"Skills","description":"Skills attached to this playbook version"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When this specific version was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When the playbook was last updated"},"first_version_created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Version Created At","description":"When version 1 was created (for display purposes)"},"connected_inboxes":{"items":{"$ref":"#/components/schemas/InboxWithPlaybook"},"type":"array","title":"Connected Inboxes","description":"List of inboxes where this playbook is deployed"},"latest_ci_run":{"anyOf":[{"$ref":"#/components/schemas/EvalRun"},{"type":"null"}],"description":"Most recent CI eval run (``trigger_source=ci``) for this playbook, across all versions — the GitHub-style check badge the assistants list renders. ``None`` when the playbook never had a CI run (kaption account, no eval cases, or feature off)."},"active_version_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active Version Number","description":"Version number currently serving production for this playbook (``playbook_active_versions``). The playbook itself is always the LATEST version, so a value lower than ``version_number`` means the latest edit is saved but not live. ``None`` means no version was ever activated — not that version 1 is active."},"active_version_set_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active Version Set At","description":"When ``active_version_number`` was activated. ``None`` when no version was ever activated."}},"type":"object","required":["name","content","id","base_id","project_id","created_at","updated_at"],"title":"PlaybookWithInboxes","description":"Playbook model with connected inbox information."},"PnlCostBucket":{"properties":{"key":{"type":"string","title":"Key"},"cost_usd":{"type":"number","title":"Cost Usd"}},"type":"object","required":["key","cost_usd"],"title":"PnlCostBucket"},"PreloadedEnrichment":{"properties":{"tool_name":{"type":"string","title":"Tool Name","description":"Name of the enrichment API tool that was pre-run"},"result":{"title":"Result","description":"The parsed tool result that was injected into context"},"fetched_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fetched At","description":"When the enrichment data was fetched (ISO timestamp)"}},"type":"object","required":["tool_name"],"title":"PreloadedEnrichment","description":"An enrichment (pre-loaded) API tool result present in a conversation.\n\nEnrichment tools run before the LLM's turn and their result is injected into\nthe system prompt's <pre_loaded_context> — they fire no in-turn tool_call, so\nthe UI surfaces them as static pills (like always_load skills), with the\nfetched result available on hover. Rides on both the live chat response\n(preview/playground) and the persisted ChatLog messages response."},"PriorMessage":{"properties":{"role":{"type":"string","enum":["user","assistant"],"title":"Role","description":"`user`: the person the conversation is with. `assistant`: anyone answering them before the assistant joined — a menu, a bot, a teammate."},"content":{"type":"string","maxLength":8000,"title":"Content","description":"The message text."},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At","description":"When it was sent, if the channel knows."}},"type":"object","required":["role","content"],"title":"PriorMessage","description":"One message said on the channel before the assistant joined (see ``prior_messages``)."},"PrivateNoteContainsAssertion":{"properties":{"type":{"type":"string","const":"private_note_contains","title":"Type","default":"private_note_contains"},"substring":{"type":"string","title":"Substring","description":"Substring that must appear in some note"},"case_insensitive":{"type":"boolean","title":"Case Insensitive","description":"Whether the match is case-insensitive","default":true}},"type":"object","required":["substring"],"title":"PrivateNoteContainsAssertion","description":"Assert that some ``note`` event content contains the substring."},"Product":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"category":{"$ref":"#/components/schemas/ProductCategory"},"price":{"type":"number","title":"Price"},"unit":{"type":"string","title":"Unit"},"stock":{"type":"integer","title":"Stock"},"organic":{"type":"boolean","title":"Organic","default":false},"image_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Image Url"}},"type":"object","required":["id","name","category","price","unit","stock"],"title":"Product"},"ProductCategory":{"type":"string","enum":["fruit","vegetable"],"title":"ProductCategory"},"ProductionAutosuggestionRequest":{"properties":{"account_id":{"type":"integer","title":"Account Id","description":"Account ID"},"inbox_id":{"type":"integer","title":"Inbox Id","description":"Inbox ID"},"conversation_id":{"type":"integer","title":"Conversation Id","description":"Conversation ID"},"user_metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"User Metadata","description":"Optional metadata about the user"},"agent_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Prompt","description":"Optional agent prompt for specific information requests (e.g., 'answer with the address of the new store in NY'). When provided, bypasses triage filter."},"language":{"anyOf":[{"$ref":"#/components/schemas/SuggestionLanguage"},{"type":"null"}],"description":"Optional language for the suggestion response (en, es, or pt). Forces response in specified language."}},"type":"object","required":["account_id","inbox_id","conversation_id"],"title":"ProductionAutosuggestionRequest","description":"Request for autosuggestions (production endpoint with API key auth)."},"Project":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the project"},"id":{"type":"string","title":"Id"},"account_id":{"type":"string","title":"Account Id","description":"UUID of the account that owns this project"},"is_custom":{"type":"boolean","title":"Is Custom","description":"Whether this is a custom project managed by Kaption team (cannot modify KBs or retrain)","default":false},"collection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Id","description":"Current active Chroma collection ID"},"personality_tone":{"anyOf":[{"$ref":"#/components/schemas/PersonalityToneEnum"},{"type":"null"}],"description":"Default personality tone for the project"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["name","account_id"],"title":"Project","description":"Project model with ID and metadata."},"ProjectApiKeyCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name","description":"Name for the API key"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Optional description"},"is_public":{"type":"boolean","title":"Is Public","description":"Set true only for a key that ships inside a browser bundle (a public web widget). A public key may ONLY chat with the assistant's active version — every other endpoint answers 403 — and its chat is rate-limited per IP. Leave false for a server-side key: it would lose the rest of the API, and rate-limiting a bridge by IP would throttle the whole integration from its one server address.","default":false}},"type":"object","required":["name"],"title":"ProjectApiKeyCreate","description":"Request model for creating a project API key."},"ProjectApiKeyCreateResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique API key ID"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this key belongs to"},"name":{"type":"string","title":"Name","description":"Name of the API key"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the key is active"},"is_public":{"type":"boolean","title":"Is Public","description":"Whether the key is browser-exposed (chat-only, and rate-limited per IP)","default":false},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At","description":"Last time the key was used"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the key was created"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"When the key stops authenticating. None = never (every key minted by hand). Demo pages mint one-hour keys."},"raw_key":{"type":"string","title":"Raw Key","description":"The full API key. IMPORTANT: This is only shown once and cannot be retrieved again."}},"type":"object","required":["id","project_id","name","is_active","created_at","raw_key"],"title":"ProjectApiKeyCreateResponse","description":"Response model for newly created API key (includes raw key ONCE)."},"ProjectApiKeyResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Unique API key ID"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this key belongs to"},"name":{"type":"string","title":"Name","description":"Name of the API key"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Optional description"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the key is active"},"is_public":{"type":"boolean","title":"Is Public","description":"Whether the key is browser-exposed (chat-only, and rate-limited per IP)","default":false},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At","description":"Last time the key was used"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the key was created"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"When the key stops authenticating. None = never (every key minted by hand). Demo pages mint one-hour keys."}},"type":"object","required":["id","project_id","name","is_active","created_at"],"title":"ProjectApiKeyResponse","description":"Response model for project API key (without raw key)."},"ProjectApiKeyUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"is_public":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Public"}},"type":"object","title":"ProjectApiKeyUpdate","description":"Request model for updating a project API key."},"ProjectCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the project"}},"type":"object","required":["name"],"title":"ProjectCreate","description":"Model for creating a project."},"ProjectInbox":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["id"],"title":"ProjectInbox"},"ProjectInboxesResponse":{"properties":{"inboxes":{"items":{"$ref":"#/components/schemas/ProjectInbox"},"type":"array","title":"Inboxes"}},"type":"object","required":["inboxes"],"title":"ProjectInboxesResponse"},"ProjectIssueCategoryEnum":{"type":"string","enum":["kb","api_tool","assistant"],"title":"ProjectIssueCategoryEnum"},"ProjectIssueCommentCreate":{"properties":{"body":{"type":"string","title":"Body"}},"type":"object","required":["body"],"title":"ProjectIssueCommentCreate"},"ProjectIssueCommentResponse":{"properties":{"id":{"type":"string","title":"Id"},"author_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Id"},"author_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Name"},"body":{"type":"string","title":"Body"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","body","created_at"],"title":"ProjectIssueCommentResponse"},"ProjectIssueCreate":{"properties":{"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"category":{"$ref":"#/components/schemas/ProjectIssueCategoryEnum","default":"kb"}},"type":"object","required":["title"],"title":"ProjectIssueCreate"},"ProjectIssueFollowupCreate":{"properties":{"body":{"type":"string","title":"Body"}},"type":"object","required":["body"],"title":"ProjectIssueFollowupCreate"},"ProjectIssueFollowupResponse":{"properties":{"id":{"type":"string","title":"Id"},"body":{"type":"string","title":"Body"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","body","created_at"],"title":"ProjectIssueFollowupResponse"},"ProjectIssueResponse":{"properties":{"id":{"type":"integer","title":"Id"},"project_id":{"type":"string","title":"Project Id"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"category":{"$ref":"#/components/schemas/ProjectIssueCategoryEnum"},"status":{"$ref":"#/components/schemas/ProjectIssueStatusEnum"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved By"},"regressed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Regressed At"},"occurrence_count":{"type":"integer","title":"Occurrence Count"},"last_seen_at":{"type":"string","format":"date-time","title":"Last Seen At"},"followups":{"items":{"$ref":"#/components/schemas/ProjectIssueFollowupResponse"},"type":"array","title":"Followups","default":[]},"comments":{"items":{"$ref":"#/components/schemas/ProjectIssueCommentResponse"},"type":"array","title":"Comments","default":[]},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","project_id","title","description","body","category","status","resolved_at","resolved_by","occurrence_count","last_seen_at","created_at","updated_at"],"title":"ProjectIssueResponse"},"ProjectIssueStatusEnum":{"type":"string","enum":["open","resolved"],"title":"ProjectIssueStatusEnum"},"ProjectIssuesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ProjectIssueResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"open_count":{"type":"integer","title":"Open Count"}},"type":"object","required":["items","total","open_count"],"title":"ProjectIssuesListResponse"},"ProjectResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Project UUID"},"name":{"type":"string","title":"Name","description":"Project name"},"created_at":{"type":"string","title":"Created At","description":"ISO 8601 creation timestamp"}},"type":"object","required":["id","name","created_at"],"title":"ProjectResponse"},"ProjectSchedule":{"properties":{"name":{"type":"string","title":"Name","description":"User-friendly name for this schedule","default":"Working Hours"},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone (e.g., 'America/New_York')","default":"UTC"},"weekly_schedule":{"$ref":"#/components/schemas/WeeklySchedule-Output","description":"Weekly schedule configuration"},"enabled":{"type":"boolean","title":"Enabled","description":"Whether office hours enforcement is enabled","default":true},"id":{"type":"string","title":"Id","description":"Unique schedule ID"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this schedule belongs to"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the schedule was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When the schedule was last updated"}},"type":"object","required":["id","project_id","created_at","updated_at"],"title":"ProjectSchedule","description":"Full project schedule model with all fields."},"ProjectScheduleCreate":{"properties":{"name":{"type":"string","title":"Name","description":"User-friendly name for this schedule","default":"Working Hours"},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone (e.g., 'America/New_York')","default":"UTC"},"weekly_schedule":{"$ref":"#/components/schemas/WeeklySchedule-Input","description":"Weekly schedule configuration"},"enabled":{"type":"boolean","title":"Enabled","description":"Whether office hours enforcement is enabled","default":true}},"type":"object","title":"ProjectScheduleCreate","description":"Model for creating a project schedule."},"ProjectScheduleUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Updated schedule name"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone","description":"Updated timezone"},"weekly_schedule":{"anyOf":[{"$ref":"#/components/schemas/WeeklySchedule-Input"},{"type":"null"}],"description":"Updated weekly schedule"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","description":"Updated enabled status"}},"type":"object","title":"ProjectScheduleUpdate","description":"Model for updating a project schedule."},"ProjectSettings":{"properties":{"personality_tone":{"anyOf":[{"$ref":"#/components/schemas/PersonalityToneEnum"},{"type":"null"}],"description":"Default personality tone for the project"}},"type":"object","title":"ProjectSettings","description":"Project settings model."},"ProjectSettingsResponse":{"properties":{"project_id":{"type":"string","title":"Project Id"},"settings":{"$ref":"#/components/schemas/ProjectSettings"}},"type":"object","required":["project_id","settings"],"title":"ProjectSettingsResponse","description":"Response for project settings."},"ProjectSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"ProjectSummary"},"ProjectTagsResponse":{"properties":{"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts","default":{}}},"type":"object","required":["tags"],"title":"ProjectTagsResponse"},"ProjectUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","title":"ProjectUpdate","description":"Model for updating a project."},"ProjectWithStatus":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the project"},"id":{"type":"string","title":"Id"},"account_id":{"type":"string","title":"Account Id","description":"UUID of the account that owns this project"},"is_custom":{"type":"boolean","title":"Is Custom","description":"Whether this is a custom project managed by Kaption team (cannot modify KBs or retrain)","default":false},"collection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Id","description":"Current active Chroma collection ID"},"personality_tone":{"anyOf":[{"$ref":"#/components/schemas/PersonalityToneEnum"},{"type":"null"}],"description":"Default personality tone for the project"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"needs_retraining":{"type":"boolean","title":"Needs Retraining","description":"Whether the project has pending knowledge base changes requiring retraining"}},"type":"object","required":["name","account_id","needs_retraining"],"title":"ProjectWithStatus","description":"Project model with training status information."},"PylonCredentialsUpdate":{"properties":{"pylon_api_key":{"type":"string","title":"Pylon Api Key","description":"New Pylon API bearer token"}},"type":"object","required":["pylon_api_key"],"title":"PylonCredentialsUpdate","description":"Request model for updating Pylon credentials."},"PylonItem":{"properties":{"id":{"type":"string","title":"Id","description":"Unique ID for RAG tracking"},"pylon_article_id":{"type":"string","title":"Pylon Article Id","description":"Original Pylon article ID"},"title":{"type":"string","title":"Title","description":"Article title"},"content":{"type":"string","title":"Content","description":"Markdown content (converted from HTML)"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Article description/slug"},"parent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id","description":"Parent PylonItem.id for hierarchy (None = root)"},"parent_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Type","description":"Parent type: 'collection' or None"},"collection_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Id","description":"Pylon collection ID this article belongs to"},"collection_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Name","description":"Name of the collection this article belongs to"},"collection_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Collection Path","description":"Full hierarchy path (e.g., 'KB > Parent > Child')"},"depth":{"type":"integer","title":"Depth","description":"Nesting level (0 = root)","default":0},"state":{"type":"string","title":"State","description":"Article state: 'published' or 'draft'","default":"published"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Public URL of the article"},"knowledge_base_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Knowledge Base Id","description":"Pylon Knowledge Base ID the article lives in"},"last_imported_at":{"type":"string","format":"date-time","title":"Last Imported At","description":"When this article was imported"},"last_edited_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Edited At","description":"When user manually edited content"},"pylon_last_modified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pylon Last Modified At","description":"Last published time from Pylon API"},"is_manually_edited":{"type":"boolean","title":"Is Manually Edited","description":"Track if content was manually edited","default":false},"notes":{"anyOf":[{"items":{"$ref":"#/components/schemas/NoteItem"},"type":"array"},{"type":"null"}],"title":"Notes","description":"Correction notes injected into RAG search results"}},"type":"object","required":["pylon_article_id","title","content"],"title":"PylonItem","description":"A single Pylon Knowledge Base article stored flat with parent reference for tree structure."},"PylonItemUpdate":{"properties":{"content":{"type":"string","title":"Content","description":"New markdown content"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Optional title update"}},"type":"object","required":["content"],"title":"PylonItemUpdate","description":"Request model for updating a Pylon article's content."},"PylonKnowledgeBaseCreate":{"properties":{"title":{"type":"string","title":"Title","description":"Title of the knowledge base"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"Optional markdown-formatted instructions for LLM when using this KB"},"metadata_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Fields","description":"Optional list of additional metadata field names to extract from retrieved chunks"},"pylon_api_key":{"type":"string","title":"Pylon Api Key","description":"Pylon API bearer token (will be encrypted)"},"selected_article_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Selected Article Ids","description":"Optional list of article IDs to import (None = all)"},"include_drafts":{"type":"boolean","title":"Include Drafts","description":"Whether to include draft articles","default":false},"kb_type":{"$ref":"#/components/schemas/KnowledgeBaseType","description":"Knowledge base type (always PYLON)","default":"pylon"}},"type":"object","required":["title","pylon_api_key"],"title":"PylonKnowledgeBaseCreate","description":"Model for creating a PYLON knowledge base.\n\nImports articles from Pylon Knowledge Bases using API key authentication.\nSupports selective import by article IDs and draft article inclusion."},"PylonPreviewJobRequest":{"properties":{"access_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Token","description":"Pylon API bearer token (optional in reimport)"},"include_drafts":{"type":"boolean","title":"Include Drafts","description":"Whether to include draft articles","default":false},"kb_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kb Id","description":"Existing KB ID (UUID) for reimport mode (to use stored credentials)"}},"type":"object","title":"PylonPreviewJobRequest","description":"Request model for starting a Pylon preview job.\n\nIn reimport mode (kb_id provided), access_token is optional.\nIf not provided, it will be fetched from the existing KB."},"PylonPreviewJobResponse":{"properties":{"job_id":{"type":"string","title":"Job Id","description":"Unique job ID to poll for progress"}},"type":"object","required":["job_id"],"title":"PylonPreviewJobResponse","description":"Response model for starting a Pylon preview job."},"PylonPreviewRequest":{"properties":{"api_key":{"type":"string","title":"Api Key","description":"Pylon API bearer token"},"include_drafts":{"type":"boolean","title":"Include Drafts","description":"Whether to include draft articles","default":false}},"type":"object","required":["api_key"],"title":"PylonPreviewRequest","description":"Request model for getting Pylon articles preview (synchronous)."},"PylonPreviewResponse":{"properties":{"collections":{"items":{"$ref":"#/components/schemas/app__routers__pylon__CollectionPreview-Output"},"type":"array","title":"Collections"},"uncategorized":{"items":{"$ref":"#/components/schemas/app__routers__pylon__ArticlePreview"},"type":"array","title":"Uncategorized"},"total_count":{"type":"integer","title":"Total Count"}},"type":"object","required":["collections","uncategorized","total_count"],"title":"PylonPreviewResponse","description":"Response model for Pylon articles preview."},"PylonReimportResponse":{"properties":{"knowledgebase":{"$ref":"#/components/schemas/KnowledgeBase"},"edited_articles_overwritten":{"items":{"type":"string"},"type":"array","title":"Edited Articles Overwritten","description":"Titles of manually edited articles that were overwritten"}},"type":"object","required":["knowledgebase"],"title":"PylonReimportResponse","description":"Response model for Pylon reimport."},"PylonValidateRequest":{"properties":{"api_key":{"type":"string","title":"Api Key","description":"Pylon API bearer token"}},"type":"object","required":["api_key"],"title":"PylonValidateRequest","description":"Request model for validating a Pylon API key."},"PylonValidateResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"app_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Name"},"knowledge_base_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Knowledge Base Count"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["valid"],"title":"PylonValidateResponse","description":"Response model for Pylon API key validation."},"QuoteRequest":{"properties":{"plan":{"type":"string","title":"Plan"},"vip":{"type":"boolean","title":"Vip"},"seats":{"type":"integer","title":"Seats"}},"type":"object","required":["plan","vip","seats"],"title":"QuoteRequest"},"RemoveNoteRequest":{"properties":{"note":{"type":"string","title":"Note"}},"type":"object","required":["note"],"title":"RemoveNoteRequest","description":"Request body for removing a note."},"ReportArtifactResponse":{"properties":{"id":{"type":"string","title":"Id"},"run_id":{"type":"string","title":"Run Id"},"markdown_content":{"type":"string","title":"Markdown Content"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","run_id","markdown_content","created_at"],"title":"ReportArtifactResponse"},"ReportDefinitionCreate":{"properties":{"name":{"type":"string","title":"Name"},"instructions":{"type":"string","title":"Instructions"},"schedule_type":{"type":"string","title":"Schedule Type","default":"manual"},"cron_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cron Expression"},"playbook_base_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Playbook Base Ids"},"time_window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Time Window Days"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Recipients"}},"type":"object","required":["name","instructions"],"title":"ReportDefinitionCreate"},"ReportDefinitionResponse":{"properties":{"id":{"type":"string","title":"Id"},"project_id":{"type":"string","title":"Project Id"},"name":{"type":"string","title":"Name"},"instructions":{"type":"string","title":"Instructions"},"schedule_type":{"type":"string","title":"Schedule Type"},"cron_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cron Expression"},"playbook_base_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Playbook Base Ids"},"time_window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Time Window Days"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Recipients"},"is_enabled":{"type":"boolean","title":"Is Enabled"},"is_one_off":{"type":"boolean","title":"Is One Off","default":false},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","project_id","name","instructions","schedule_type","cron_expression","playbook_base_ids","time_window_days","slack_channel","email_recipients","is_enabled","created_at","updated_at"],"title":"ReportDefinitionResponse"},"ReportDefinitionUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions"},"schedule_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Type"},"cron_expression":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cron Expression"},"playbook_base_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Playbook Base Ids"},"time_window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Time Window Days"},"slack_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Slack Channel"},"email_recipients":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Email Recipients"},"is_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Enabled"}},"type":"object","title":"ReportDefinitionUpdate"},"ReportDefinitionsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReportDefinitionResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"ReportDefinitionsListResponse"},"ReportOneOffCreate":{"properties":{"instructions":{"type":"string","minLength":1,"title":"Instructions"},"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"playbook_base_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Playbook Base Ids"},"time_window_days":{"anyOf":[{"type":"integer","maximum":366.0,"minimum":1.0},{"type":"null"}],"title":"Time Window Days"},"time_window_hours":{"anyOf":[{"type":"integer","maximum":744.0,"minimum":1.0},{"type":"null"}],"title":"Time Window Hours"}},"type":"object","required":["instructions"],"title":"ReportOneOffCreate","description":"Define and run a report in one call, for a definition nobody will keep.\n\nThe window is the one thing worth stating twice: `time_window_hours` exists\nbecause \"the last 24 hours\" is what a person asks for, and a run stores the\nexact window anyway. Pass one of the two, or neither (7 days, like a manual\nrun)."},"ReportOneOffResponse":{"properties":{"report":{"$ref":"#/components/schemas/ReportDefinitionResponse"},"run":{"$ref":"#/components/schemas/ReportRunResponse"}},"type":"object","required":["report","run"],"title":"ReportOneOffResponse","description":"What a one-off returns: the run to poll, and the definition it hangs off."},"ReportRunLogEntry":{"properties":{"ts":{"type":"string","title":"Ts"},"step":{"type":"string","title":"Step"},"detail":{"type":"string","title":"Detail","default":""}},"type":"object","required":["ts","step"],"title":"ReportRunLogEntry"},"ReportRunResponse":{"properties":{"id":{"type":"string","title":"Id"},"report_definition_id":{"type":"string","title":"Report Definition Id"},"status":{"$ref":"#/components/schemas/ReportRunStatus"},"trigger_type":{"type":"string","title":"Trigger Type"},"window_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Window Start"},"window_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Window End"},"sami_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sami Session Id"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"execution_log":{"anyOf":[{"items":{"$ref":"#/components/schemas/ReportRunLogEntry"},"type":"array"},{"type":"null"}],"title":"Execution Log"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","report_definition_id","status","trigger_type","sami_session_id","error_message","started_at","completed_at","created_at"],"title":"ReportRunResponse"},"ReportRunStatus":{"type":"string","enum":["pending","running","completed","completed_with_warnings","failed","cancelled"],"title":"ReportRunStatus"},"ReportRunsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReportRunResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"ReportRunsListResponse"},"ResetPasswordRequest":{"properties":{"send_email":{"type":"boolean","title":"Send Email","description":"Send email with new credentials to the user","default":false}},"type":"object","title":"ResetPasswordRequest"},"ResetPasswordResponse":{"properties":{"user":{"$ref":"#/components/schemas/app__routers__account_management__UserResponse"},"temporary_password":{"type":"string","title":"Temporary Password","description":"New temporary password for the user (shown once)"}},"type":"object","required":["user","temporary_password"],"title":"ResetPasswordResponse"},"RetrievalConfig":{"properties":{"rerank_enabled":{"type":"boolean","title":"Rerank Enabled","description":"Enable Cohere rerank as a second retrieval stage","default":false},"rerank_model":{"type":"string","title":"Rerank Model","description":"Cohere rerank model to use","default":"rerank-v4.0-fast"},"top_k_wide":{"type":"integer","maximum":100.0,"minimum":10.0,"title":"Top K Wide","description":"Wide top-k for the dense first stage","default":75},"top_n":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Top N","description":"Final chunk count after rerank (None = caller's generality-based top_k)"},"min_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Score","description":"Minimum rerank relevance score; chunks below are dropped"}},"type":"object","title":"RetrievalConfig","description":"Per-KB retrieval tuning for two-stage retrieval (dense wide -> Cohere rerank -> top_n)."},"RetrievalConfigOverride":{"properties":{"rerank_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Rerank Enabled","description":"Override: enable Cohere rerank as a second stage"},"rerank_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rerank Model","description":"Override: Cohere rerank model to use"},"top_k_wide":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":10.0},{"type":"null"}],"title":"Top K Wide","description":"Override: wide top-k for the dense first stage"},"top_n":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Top N","description":"Override: final chunk count after rerank"},"min_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Score","description":"Override: minimum rerank relevance score; chunks below dropped"}},"type":"object","title":"RetrievalConfigOverride","description":"All-optional twin of RetrievalConfig for per-request retrieval tuning (eval/hyperparameter sweeps).\n\nAny field left None falls back to the KB-resolved effective config, so an empty override is a no-op\n(byte-identical to passing no override at all)."},"RevenueEntryModel":{"properties":{"id":{"type":"string","title":"Id"},"is_credit":{"type":"boolean","title":"Is Credit","description":"True = prepaid credit (feeds the Balance); False = plain post-paid payment."},"amount_usd":{"type":"number","title":"Amount Usd"},"date":{"type":"string","format":"date-time","title":"Date","description":"The row's paid_at (effective date)."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"}},"type":"object","required":["id","is_credit","amount_usd","date"],"title":"RevenueEntryModel"},"RevenuePaymentEntry":{"properties":{"id":{"type":"string","title":"Id"},"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"is_credit":{"type":"boolean","title":"Is Credit","description":"True = prepaid credit/refill; False = plain post-paid payment."},"amount_usd":{"type":"number","title":"Amount Usd"},"paid_at":{"type":"string","format":"date-time","title":"Paid At"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"}},"type":"object","required":["id","account_id","is_credit","amount_usd","paid_at"],"title":"RevenuePaymentEntry"},"RevenueRangeSummary":{"properties":{"start_date":{"type":"string","format":"date-time","title":"Start Date","description":"Window start (ISO, inclusive) — echoes the query param."},"end_date":{"type":"string","format":"date-time","title":"End Date","description":"Window end (ISO, exclusive) — echoes the query param."},"accounts":{"items":{"$ref":"#/components/schemas/AccountRevenue"},"type":"array","title":"Accounts","description":"Per-client totals, highest first."},"payments":{"items":{"$ref":"#/components/schemas/RevenuePaymentEntry"},"type":"array","title":"Payments","description":"Every payment row in the window (prepaid + post-paid), newest first."},"total_usd":{"type":"number","title":"Total Usd"},"prepaid_total_usd":{"type":"number","title":"Prepaid Total Usd"},"post_paid_total_usd":{"type":"number","title":"Post Paid Total Usd"}},"type":"object","required":["start_date","end_date","total_usd","prepaid_total_usd","post_paid_total_usd"],"title":"RevenueRangeSummary"},"RevenueResponse":{"properties":{"year":{"type":"integer","title":"Year"},"available_years":{"items":{"type":"integer"},"type":"array","title":"Available Years","description":"Years with any revenue, newest first."},"accounts":{"items":{"$ref":"#/components/schemas/AccountRevenueModel"},"type":"array","title":"Accounts","description":"Highest revenue first."},"total_usd":{"type":"number","title":"Total Usd"},"prepaid_total_usd":{"type":"number","title":"Prepaid Total Usd"},"post_paid_total_usd":{"type":"number","title":"Post Paid Total Usd"}},"type":"object","required":["year","total_usd","prepaid_total_usd","post_paid_total_usd"],"title":"RevenueResponse"},"RevenueSummary":{"properties":{"year":{"type":"integer","title":"Year"},"available_years":{"items":{"type":"integer"},"type":"array","title":"Available Years"},"accounts":{"items":{"$ref":"#/components/schemas/AccountRevenue"},"type":"array","title":"Accounts","description":"Highest revenue first."},"total_usd":{"type":"number","title":"Total Usd"},"prepaid_total_usd":{"type":"number","title":"Prepaid Total Usd"},"post_paid_total_usd":{"type":"number","title":"Post Paid Total Usd"}},"type":"object","required":["year","total_usd","prepaid_total_usd","post_paid_total_usd"],"title":"RevenueSummary"},"ReviewBody":{"properties":{"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"}},"type":"object","title":"ReviewBody"},"ReviewHitRequest":{"properties":{"disposition":{"type":"string","title":"Disposition","description":"Short verdict id. Today: 'not_a_risk'. Allow-list enforced server-side."},"reviewed_by_email":{"type":"string","maxLength":255,"minLength":3,"title":"Reviewed By Email","description":"Operator identity recorded on the row. Required because the shared X-API-Key carries no user identity — bulk tooling must say who ran it."},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes","description":"Optional free-text comment. Surfaced in the superadmin dismissed-rows view."}},"type":"object","required":["disposition","reviewed_by_email"],"title":"ReviewHitRequest"},"ReviewHitResponse":{"properties":{"id":{"type":"string","title":"Id"},"reviewed_at":{"type":"string","format":"date-time","title":"Reviewed At"},"reviewed_by_email":{"type":"string","title":"Reviewed By Email"},"reviewer_disposition":{"type":"string","title":"Reviewer Disposition"},"reviewer_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer Notes"}},"type":"object","required":["id","reviewed_at","reviewed_by_email","reviewer_disposition","reviewer_notes"],"title":"ReviewHitResponse"},"ReviewViolationRequest":{"properties":{"disposition":{"type":"string","title":"Disposition","description":"Short verdict id. Today: 'not_a_risk'. Allow-list enforced server-side."},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes","description":"Optional free-text comment from the operator. Surfaced inline in dismissed-rows view."}},"type":"object","required":["disposition"],"title":"ReviewViolationRequest"},"ReviewViolationResponse":{"properties":{"id":{"type":"string","title":"Id"},"reviewed_at":{"type":"string","format":"date-time","title":"Reviewed At"},"reviewed_by_email":{"type":"string","title":"Reviewed By Email"},"reviewer_disposition":{"type":"string","title":"Reviewer Disposition"},"reviewer_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewer Notes"}},"type":"object","required":["id","reviewed_at","reviewed_by_email","reviewer_disposition","reviewer_notes"],"title":"ReviewViolationResponse"},"RumoSetsValidateRequest":{"properties":{"flow_sets":{"anyOf":[{"items":{"$ref":"#/components/schemas/FlowSet"},"type":"array"},{"type":"null"}],"title":"Flow Sets"},"template_sets":{"anyOf":[{"items":{"$ref":"#/components/schemas/TemplateSet"},"type":"array"},{"type":"null"}],"title":"Template Sets"}},"type":"object","title":"RumoSetsValidateRequest"},"RunTrendPoint":{"properties":{"run_id":{"type":"string","title":"Run Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"playbook_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Playbook Version"},"status":{"$ref":"#/components/schemas/EvalRunStatus"},"total_cases":{"type":"integer","title":"Total Cases"},"passed_cases":{"type":"integer","title":"Passed Cases"},"failed_cases":{"type":"integer","title":"Failed Cases"},"pass_rate":{"type":"number","title":"Pass Rate","description":"passed_cases / total_cases (0–100)"},"trigger_source":{"anyOf":[{"$ref":"#/components/schemas/EvalTriggerSource"},{"type":"null"}]}},"type":"object","required":["run_id","created_at","status","total_cases","passed_cases","failed_cases","pass_rate"],"title":"RunTrendPoint","description":"A single point in the pass-rate-over-time series."},"SamiAttachmentRef":{"properties":{"file_id":{"type":"string","title":"File Id","description":"Anthropic Files API id returned by the upload endpoint"},"filename":{"type":"string","title":"Filename","description":"Original filename (for display)"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes","description":"File size in bytes"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type","description":"File MIME type"}},"type":"object","required":["file_id","filename"],"title":"SamiAttachmentRef","description":"A file attached to a Sami turn.\n\n``file_id`` comes from POST /sami/v2/sessions/{id}/attachments (an Anthropic\nFiles API id). The rest is metadata used to render the attachment chip and\nbuild the note that tells the agent where the file is mounted."},"SamiCreateSessionResponse":{"properties":{"session_id":{"type":"string","title":"Session Id","description":"Unique session identifier"},"sandbox_id":{"type":"string","title":"Sandbox Id","description":"Legacy sandbox ID — always empty on v2 sessions"},"sandbox_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sandbox Expires At","description":"When the sandbox will expire (UTC)"}},"type":"object","required":["session_id","sandbox_id"],"title":"SamiCreateSessionResponse","description":"Response model for creating a Sami session with a pre-provisioned sandbox."},"SamiMessage":{"properties":{"id":{"type":"string","title":"Id","description":"Message ID"},"role":{"type":"string","title":"Role","description":"Message role (user/assistant)"},"content":{"type":"string","title":"Content","description":"Message content"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the message was created"},"tool_calls":{"anyOf":[{"items":{"$ref":"#/components/schemas/CopilotToolCall"},"type":"array"},{"type":"null"}],"title":"Tool Calls","description":"Tool calls for assistant messages"},"content_blocks":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Content Blocks","description":"Ordered content blocks (text + tool calls interleaved)"},"attachments":{"anyOf":[{"items":{"$ref":"#/components/schemas/SamiAttachmentRef"},"type":"array"},{"type":"null"}],"title":"Attachments","description":"Files the user attached to this message (user messages only)"}},"type":"object","required":["id","role","content"],"title":"SamiMessage","description":"Message in a Sami session."},"SamiSession":{"properties":{"session_id":{"type":"string","title":"Session Id","description":"Unique session identifier"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Session title (first user message)"},"message_count":{"type":"integer","title":"Message Count","description":"Number of messages","default":0},"first_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Message At","description":"First message timestamp"},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Message At","description":"Last message timestamp"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the session was created"},"sandbox_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sandbox Expires At","description":"When the sandbox will expire (UTC)"},"chat_status":{"type":"string","title":"Chat Status","description":"Chat processing status: idle or processing","default":"idle"},"is_expired":{"type":"boolean","title":"Is Expired","description":"Session is past the account's age cap","default":false},"is_cost_capped":{"type":"boolean","title":"Is Cost Capped","description":"Session hit the account's spend cap and is read-only","default":false},"cost_fraction":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Fraction","description":"Estimated spend as a fraction of the cap (0..1+)"},"show_cost_warning":{"type":"boolean","title":"Show Cost Warning","description":"Spend is near the cap (≥80%) and worth surfacing","default":false}},"type":"object","required":["session_id"],"title":"SamiSession","description":"Sami session metadata for sidebar display."},"SamiSessionFile":{"properties":{"file_id":{"type":"string","title":"File Id"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["file_id"],"title":"SamiSessionFile"},"SamiSessionFilesResponse":{"properties":{"files":{"items":{"$ref":"#/components/schemas/SamiSessionFile"},"type":"array","title":"Files"}},"type":"object","required":["files"],"title":"SamiSessionFilesResponse"},"SamiSessionLimitsUpdate":{"properties":{"max_age_hours":{"anyOf":[{"type":"number","maximum":2160.0,"minimum":0.0},{"type":"null"}],"title":"Max Age Hours"},"cost_cap_usd":{"anyOf":[{"type":"number","maximum":1000.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Cost Cap Usd"}},"type":"object","title":"SamiSessionLimitsUpdate","description":"Set (or clear, with an explicit null) an account's Sami session limits.\n\nBoth fields are independent: only the ones present in ``model_fields_set``\nare written, so the UI can patch one without clobbering the other."},"SamiSessionsResponse":{"properties":{"sessions":{"items":{"$ref":"#/components/schemas/SamiSession"},"type":"array","title":"Sessions","description":"List of sessions"},"total":{"type":"integer","title":"Total","description":"Total number of sessions"}},"type":"object","required":["sessions","total"],"title":"SamiSessionsResponse","description":"Response model for listing Sami sessions."},"SavedFilter":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Display name, unique per account"},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description","description":"Optional free-text description"},"definition":{"oneOf":[{"$ref":"#/components/schemas/TagLeaf"},{"$ref":"#/components/schemas/TagGroup-Output"}],"title":"Definition","description":"The saved tag-filter expression (AND/OR/NOT over tags)","discriminator":{"propertyName":"type","mapping":{"group":"#/components/schemas/TagGroup-Output","tag":"#/components/schemas/TagLeaf"}}},"id":{"type":"string","title":"Id","description":"Unique saved-filter id"},"account_id":{"type":"string","title":"Account Id","description":"Owning account"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["name","definition","id","account_id","created_at","updated_at"],"title":"SavedFilter","description":"Full saved filter returned from the API."},"SavedFilterCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Display name, unique per account"},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description","description":"Optional free-text description"},"definition":{"oneOf":[{"$ref":"#/components/schemas/TagLeaf"},{"$ref":"#/components/schemas/TagGroup-Input"}],"title":"Definition","description":"The saved tag-filter expression (AND/OR/NOT over tags)","discriminator":{"propertyName":"type","mapping":{"group":"#/components/schemas/TagGroup-Input","tag":"#/components/schemas/TagLeaf"}}}},"type":"object","required":["name","definition"],"title":"SavedFilterCreate","description":"Payload to create a saved filter.\n\nThe name-trim and definition-bounds validators live on the input models\n(Create/Update) — NOT on ``SavedFilterBase`` — so the ``SavedFilter`` response\nmodel serializes stored rows verbatim and never rejects an already-persisted\ndefinition on the read path (e.g. if bounds are later tightened)."},"SavedFilterUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name","description":"Updated display name (unique per account)"},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description","description":"Updated description (empty string clears)"},"definition":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/TagLeaf"},{"$ref":"#/components/schemas/TagGroup-Input"}],"discriminator":{"propertyName":"type","mapping":{"group":"#/components/schemas/TagGroup-Input","tag":"#/components/schemas/TagLeaf"}}},{"type":"null"}],"title":"Definition","description":"Updated tag-filter expression"}},"type":"object","title":"SavedFilterUpdate","description":"Partial update — every field optional; omitted fields are left unchanged."},"ScenarioBlocks":{"properties":{"persona":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Persona","description":"Who the user is: register (tutea/usted), mood, language if not the default."},"objetivo":{"type":"string","title":"Objetivo","description":"The user's single task — one per case, observable; should mirror the case's termination."},"datos":{"items":{"$ref":"#/components/schemas/ScenarioDato"},"type":"array","title":"Datos","description":"Exact data the user holds (IDs, amounts, dates) with per-datum delivery policy."},"reacciones":{"items":{"$ref":"#/components/schemas/ScenarioReaccion"},"type":"array","title":"Reacciones","description":"Branch coverage: the assistant's likely moves and the user's response to each."},"catch_all":{"type":"string","title":"Catch All","description":"What the user does on any branch not covered by reacciones.","default":"responder breve y neutro, sin inventar datos"},"cierre":{"type":"string","title":"Cierre","description":"When and how the user closes the conversation (prevents farewell loops).","default":"cuando el objetivo se cumpla, agradecer y despedirse en UN solo mensaje"},"primer_mensaje":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primer Mensaje","description":"Optional exact first message. Projects onto the case's ``first_message`` field — pins the opening turn deterministically."},"terminacion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Terminacion","description":"Optional expected-outcome condition. Projects onto the case's ``termination`` field — should mirror ``objetivo`` as an already-occurred, observable fact."}},"type":"object","required":["objetivo"],"title":"ScenarioBlocks","description":"Structured scenario (v2) — a decision tree for the simulated user.\n\nReplaces free-prose scenarios with enforceable blocks. When present on a\ncase, the server renders the canonical text scenario from these blocks\n(see :meth:`render`) and stores it on ``scenario``, so the simulator and\nevery legacy consumer keep working unchanged (backwards compatible)."},"ScenarioDato":{"properties":{"dato":{"type":"string","title":"Dato","description":"The datum, with its literal value (e.g. 'pedido=1042')"},"entrega":{"anyOf":[{"type":"string","enum":["de_entrada","si_lo_piden","nunca"]},{"type":"null"}],"title":"Entrega","description":"DEPRECATED delivery policy, kept for old cases: 'de_entrada' (volunteer it in the first message), 'si_lo_piden' (only when asked), 'nunca' (refuse it). New cases omit it — the user simply has the data; express refusals in reacciones."}},"type":"object","required":["dato"],"title":"ScenarioDato","description":"One datum the simulated user holds.\n\nThe user HAS this data and uses it naturally whenever the assistant asks\nor it serves the task — no delivery choreography. Withholding behaviors\n(\"never gives the ID\") belong in ``reacciones``, where the branch is\nexplicit. ``entrega`` survives as an optional legacy field so cases\nauthored with delivery policies keep their behavior."},"ScenarioReaccion":{"properties":{"si":{"type":"string","title":"Si","description":"The assistant's move (e.g. 'pide el ID del pedido')"},"entonces":{"type":"string","title":"Entonces","description":"The user's response on that branch (e.g. 'darlo')"}},"type":"object","required":["si","entonces"],"title":"ScenarioReaccion","description":"One branch of the user's decision tree: what to do when the assistant does X."},"ScheduleWithOverrides":{"properties":{"schedule":{"anyOf":[{"$ref":"#/components/schemas/ProjectSchedule"},{"type":"null"}],"description":"The project's weekly schedule (null if not configured)"},"date_overrides":{"items":{"$ref":"#/components/schemas/DateOverride"},"type":"array","title":"Date Overrides","description":"All date overrides for the project"}},"type":"object","title":"ScheduleWithOverrides","description":"Combined response with schedule and all date overrides."},"Segment":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Kebab-case identifier, unique per account (e.g. 'latam-vip')"},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description","description":"Optional free-text description"},"definition":{"$ref":"#/components/schemas/SkillConditionGroup-Output","description":"The segment's logical definition over context"},"id":{"type":"string","title":"Id","description":"Unique segment id (referenced from skill conditions)"},"account_id":{"type":"string","title":"Account Id","description":"Owning account"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["name","definition","id","account_id","created_at","updated_at"],"title":"Segment","description":"Full segment returned from the API."},"SegmentCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Kebab-case identifier, unique per account (e.g. 'latam-vip')"},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description","description":"Optional free-text description"},"definition":{"$ref":"#/components/schemas/SkillConditionGroup-Input","description":"The segment's logical definition over context"}},"type":"object","required":["name","definition"],"title":"SegmentCreate","description":"Payload to create a segment. Normalizes the name to kebab-case on input.\n\nNormalization lives here (not on ``SegmentBase``) so the ``Segment`` response\nmodel reads the stored name verbatim rather than rewriting it on every read."},"SegmentUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name","description":"Updated kebab-case name (unique per account)"},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description","description":"Updated description (empty string clears)"},"definition":{"anyOf":[{"$ref":"#/components/schemas/SkillConditionGroup-Input","description":"The segment's logical definition over context"},{"type":"null"}],"description":"Updated logical definition"}},"type":"object","title":"SegmentUpdate","description":"Partial update — every field optional; omitted fields are left unchanged."},"SentimentBreakdown":{"properties":{"positive":{"type":"integer","title":"Positive","description":"Number of positive sentiment conversations","default":0},"neutral":{"type":"integer","title":"Neutral","description":"Number of neutral sentiment conversations","default":0},"negative":{"type":"integer","title":"Negative","description":"Number of negative sentiment conversations","default":0}},"type":"object","title":"SentimentBreakdown","description":"Sentiment distribution for a topic."},"SeriesBucket":{"properties":{"bucket":{"type":"string","title":"Bucket"},"cost_by_source":{"additionalProperties":{"type":"number"},"type":"object","title":"Cost By Source"},"cost_by_model":{"additionalProperties":{"type":"number"},"type":"object","title":"Cost By Model"},"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"cache_read_tokens":{"type":"integer","title":"Cache Read Tokens"},"llm_requests":{"type":"integer","title":"Llm Requests"},"production_requests":{"type":"integer","title":"Production Requests"},"production_cost_by_model":{"additionalProperties":{"type":"number"},"type":"object","title":"Production Cost By Model"},"production_input_tokens":{"type":"integer","title":"Production Input Tokens"},"production_output_tokens":{"type":"integer","title":"Production Output Tokens"},"production_cache_read_tokens":{"type":"integer","title":"Production Cache Read Tokens"}},"type":"object","required":["bucket","cost_by_source","cost_by_model","input_tokens","output_tokens","cache_read_tokens","llm_requests","production_requests","production_cost_by_model","production_input_tokens","production_output_tokens","production_cache_read_tokens"],"title":"SeriesBucket"},"SessionCheckResponse":{"properties":{"valid":{"type":"boolean","title":"Valid","description":"Whether session is valid"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id","description":"Account ID if valid (string - UUID for standalone, numeric for KAPTION)"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username","description":"Username if valid"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Email if valid"}},"type":"object","required":["valid"],"title":"SessionCheckResponse","description":"Session check response."},"SessionMessageForLLM":{"properties":{"role":{"type":"string","title":"Role","description":"Message role (user/assistant)"},"content":{"type":"string","title":"Content","description":"Message content"},"sender_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Type","description":"Sender type"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the message was created"}},"type":"object","required":["role","content"],"title":"SessionMessageForLLM","description":"A single Chatwoot conversation message formatted for LLM context."},"SessionMessagesResponse":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"Conversation ID"},"account_id":{"type":"integer","title":"Account Id","description":"Kaption account ID"},"messages":{"items":{"$ref":"#/components/schemas/SessionMessageForLLM"},"type":"array","title":"Messages","description":"Conversation messages"},"formatted_context":{"type":"string","title":"Formatted Context","description":"Pre-formatted context string for LLM injection"},"message_count":{"type":"integer","title":"Message Count","description":"Number of messages"}},"type":"object","required":["conversation_id","account_id","formatted_context","message_count"],"title":"SessionMessagesResponse","description":"Response for session messages endpoint."},"SetActiveVersionRequest":{"properties":{"version_number":{"type":"integer","exclusiveMinimum":0.0,"title":"Version Number","description":"Version number to set as active"}},"type":"object","required":["version_number"],"title":"SetActiveVersionRequest","description":"Request body for setting a playbook's active version."},"SetClientActiveVersionRequest":{"properties":{"version_number":{"type":"integer","minimum":1.0,"title":"Version Number"}},"type":"object","required":["version_number"],"title":"SetClientActiveVersionRequest"},"SharedConversationMessage":{"properties":{"role":{"type":"string","title":"Role","description":"Message role: 'user' or 'assistant'"},"content":{"type":"string","title":"Content","description":"Message content"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"Timestamp when message was created"},"metadata":{"anyOf":[{"$ref":"#/components/schemas/SharedConversationMessageMetadata"},{"type":"null"}],"description":"Message metadata"}},"type":"object","required":["role","content"],"title":"SharedConversationMessage","description":"A single message in a shared conversation (public view, no tool calls)."},"SharedConversationMessageMetadata":{"properties":{"labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Labels","description":"Labels applied to the conversation"},"private_notes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Private Notes","description":"Private notes from the assistant"},"handoff":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Handoff","description":"Handoff info with type and agent_id/team_id"},"explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation","description":"Agent's reasoning for its response"}},"type":"object","title":"SharedConversationMessageMetadata","description":"Metadata for a shared conversation message."},"SharedConversationResponse":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"Unique conversation identifier"},"playbook_name":{"type":"string","title":"Playbook Name","description":"Name of the playbook/assistant"},"playbook_version":{"type":"integer","title":"Playbook Version","description":"Version number of the playbook"},"messages":{"items":{"$ref":"#/components/schemas/SharedConversationMessage"},"type":"array","title":"Messages","description":"Conversation messages"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the conversation started"}},"type":"object","required":["conversation_id","playbook_name","playbook_version","messages"],"title":"SharedConversationResponse","description":"Response for a shared conversation (public endpoint)."},"SimulatorTurn-Input":{"properties":{"role":{"type":"string","title":"Role","description":"Role: 'user' or 'assistant'"},"content":{"type":"string","title":"Content","description":"Message content"},"events":{"items":{"$ref":"#/components/schemas/AgentEvent-Input"},"type":"array","title":"Events","description":"Structured agent events for this turn (assistant turns only)"},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCallTrace"},"type":"array","title":"Tool Calls","description":"Tool calls made by the agent during this turn (assistant turns only)"},"explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation","description":"Brief reasoning the agent produced for this assistant turn — same string the live preview chat shows as an italic line. None for user turns and for legacy stored conversations."},"flow_run":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Flow Run","description":"On a user turn injected by an eval flow step: the Rumo flow simulation that produced it (step index, flow, verified, ok, transcript summary). None everywhere else."}},"type":"object","required":["role","content"],"title":"SimulatorTurn","description":"A single turn in a simulated conversation.\n\nFor assistant turns, ``events`` and ``tool_calls`` capture the structured\noutput of the agent (handoffs, notes, labels) and every tool call made\nduring that turn. These power structured assertions and the event-aware\nresult viewer. Default empty lists keep legacy data deserializable."},"SimulatorTurn-Output":{"properties":{"role":{"type":"string","title":"Role","description":"Role: 'user' or 'assistant'"},"content":{"type":"string","title":"Content","description":"Message content"},"events":{"items":{"$ref":"#/components/schemas/AgentEvent-Output"},"type":"array","title":"Events","description":"Structured agent events for this turn (assistant turns only)"},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCallTrace"},"type":"array","title":"Tool Calls","description":"Tool calls made by the agent during this turn (assistant turns only)"},"explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation","description":"Brief reasoning the agent produced for this assistant turn — same string the live preview chat shows as an italic line. None for user turns and for legacy stored conversations."},"flow_run":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Flow Run","description":"On a user turn injected by an eval flow step: the Rumo flow simulation that produced it (step index, flow, verified, ok, transcript summary). None everywhere else."}},"type":"object","required":["role","content"],"title":"SimulatorTurn","description":"A single turn in a simulated conversation.\n\nFor assistant turns, ``events`` and ``tool_calls`` capture the structured\noutput of the agent (handoffs, notes, labels) and every tool call made\nduring that turn. These power structured assertions and the event-aware\nresult viewer. Default empty lists keep legacy data deserializable."},"Skill-Input":{"properties":{"name":{"type":"string","maxLength":100,"title":"Name","description":"Kebab-case identifier (e.g. 'refund-process')"},"description":{"type":"string","maxLength":1024,"title":"Description","description":"Short summary shown to the agent for skill discovery"},"trigger":{"type":"string","maxLength":2048,"title":"Trigger","description":"When the agent should load this skill"},"content":{"type":"string","title":"Content","description":"Full instructions (supports template macros)"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Reference conversation examples"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether this skill is active","default":true},"order":{"type":"integer","title":"Order","description":"Display/listing order","default":0},"enable_condition":{"anyOf":[{"$ref":"#/components/schemas/SkillConditionGroup-Input","description":"The segment's logical definition over context"},{"type":"null"}],"description":"Structured condition (groups of {path, operator, value} clauses) evaluated per turn against the live conversation context. None = unconditional. Only consulted when is_active is true; non-matching skills are excluded from the agent entirely."},"always_load":{"type":"boolean","title":"Always Load","description":"Inline the skill's full content into the static system prompt instead of loading it on demand via load_skill. Best for skills used in most conversations: their tokens join the cross-conversation prompt-cache prefix (read at ~0.1x price by every conversation) and the load_skill round-trip disappears. Only applies while the skill is enabled for the turn (is_active + schedule window + enable_condition).","default":false},"active_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active From","description":"Start of the skill's schedule window, as an ISO-8601 timestamp with a UTC offset (e.g. '2026-10-02T08:00:00-03:00'). Before it the skill is not in effect: not listed, not loadable, its tools not registered. None = in effect from now."},"active_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active Until","description":"End of the skill's schedule window (exclusive), as an ISO-8601 timestamp with a UTC offset. From then on the skill is no longer in effect, and a conversation that had loaded it stops seeing its instructions. None = no end."},"schedule_timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Schedule Timezone","description":"IANA timezone the schedule window is written in (e.g. 'America/Guayaquil'), for a skill that follows another country's clock. It is how the window is shown and edited; when the skill is in effect is decided by active_from / active_until alone. A write that sends it may give those two as local times without an offset ('2026-10-02T08:00:00'), read in this timezone."},"id":{"type":"string","title":"Id","description":"Unique ID for this skill instance"},"playbook_id":{"type":"string","title":"Playbook Id","description":"Playbook version this skill belongs to"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When this skill was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When this skill was last updated"}},"type":"object","required":["name","description","trigger","content","id","playbook_id","created_at","updated_at"],"title":"Skill","description":"Full skill model returned from API."},"Skill-Output":{"properties":{"name":{"type":"string","maxLength":100,"title":"Name","description":"Kebab-case identifier (e.g. 'refund-process')"},"description":{"type":"string","maxLength":1024,"title":"Description","description":"Short summary shown to the agent for skill discovery"},"trigger":{"type":"string","maxLength":2048,"title":"Trigger","description":"When the agent should load this skill"},"content":{"type":"string","title":"Content","description":"Full instructions (supports template macros)"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Reference conversation examples"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether this skill is active","default":true},"order":{"type":"integer","title":"Order","description":"Display/listing order","default":0},"enable_condition":{"anyOf":[{"$ref":"#/components/schemas/SkillConditionGroup-Output","description":"The segment's logical definition over context"},{"type":"null"}],"description":"Structured condition (groups of {path, operator, value} clauses) evaluated per turn against the live conversation context. None = unconditional. Only consulted when is_active is true; non-matching skills are excluded from the agent entirely."},"always_load":{"type":"boolean","title":"Always Load","description":"Inline the skill's full content into the static system prompt instead of loading it on demand via load_skill. Best for skills used in most conversations: their tokens join the cross-conversation prompt-cache prefix (read at ~0.1x price by every conversation) and the load_skill round-trip disappears. Only applies while the skill is enabled for the turn (is_active + schedule window + enable_condition).","default":false},"active_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active From","description":"Start of the skill's schedule window, as an ISO-8601 timestamp with a UTC offset (e.g. '2026-10-02T08:00:00-03:00'). Before it the skill is not in effect: not listed, not loadable, its tools not registered. None = in effect from now."},"active_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active Until","description":"End of the skill's schedule window (exclusive), as an ISO-8601 timestamp with a UTC offset. From then on the skill is no longer in effect, and a conversation that had loaded it stops seeing its instructions. None = no end."},"schedule_timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Schedule Timezone","description":"IANA timezone the schedule window is written in (e.g. 'America/Guayaquil'), for a skill that follows another country's clock. It is how the window is shown and edited; when the skill is in effect is decided by active_from / active_until alone. A write that sends it may give those two as local times without an offset ('2026-10-02T08:00:00'), read in this timezone."},"id":{"type":"string","title":"Id","description":"Unique ID for this skill instance"},"playbook_id":{"type":"string","title":"Playbook Id","description":"Playbook version this skill belongs to"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When this skill was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When this skill was last updated"}},"type":"object","required":["name","description","trigger","content","id","playbook_id","created_at","updated_at"],"title":"Skill","description":"Full skill model returned from API."},"SkillAnalyticsResponse":{"properties":{"total_calls":{"type":"integer","title":"Total Calls"},"successful_calls":{"type":"integer","title":"Successful Calls"},"failed_calls":{"type":"integer","title":"Failed Calls"},"time_series":{"items":{"$ref":"#/components/schemas/SkillTimeSeriesPoint"},"type":"array","title":"Time Series"},"recent":{"items":{"$ref":"#/components/schemas/SkillRecentItem"},"type":"array","title":"Recent"}},"type":"object","required":["total_calls","successful_calls","failed_calls"],"title":"SkillAnalyticsResponse"},"SkillBase":{"properties":{"name":{"type":"string","maxLength":100,"title":"Name","description":"Kebab-case identifier (e.g. 'refund-process')"},"description":{"type":"string","maxLength":1024,"title":"Description","description":"Short summary shown to the agent for skill discovery"},"trigger":{"type":"string","maxLength":2048,"title":"Trigger","description":"When the agent should load this skill"},"content":{"type":"string","title":"Content","description":"Full instructions (supports template macros)"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Reference conversation examples"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether this skill is active","default":true},"order":{"type":"integer","title":"Order","description":"Display/listing order","default":0},"enable_condition":{"anyOf":[{"$ref":"#/components/schemas/SkillConditionGroup-Input","description":"The segment's logical definition over context"},{"type":"null"}],"description":"Structured condition (groups of {path, operator, value} clauses) evaluated per turn against the live conversation context. None = unconditional. Only consulted when is_active is true; non-matching skills are excluded from the agent entirely."},"always_load":{"type":"boolean","title":"Always Load","description":"Inline the skill's full content into the static system prompt instead of loading it on demand via load_skill. Best for skills used in most conversations: their tokens join the cross-conversation prompt-cache prefix (read at ~0.1x price by every conversation) and the load_skill round-trip disappears. Only applies while the skill is enabled for the turn (is_active + schedule window + enable_condition).","default":false},"active_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active From","description":"Start of the skill's schedule window, as an ISO-8601 timestamp with a UTC offset (e.g. '2026-10-02T08:00:00-03:00'). Before it the skill is not in effect: not listed, not loadable, its tools not registered. None = in effect from now."},"active_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active Until","description":"End of the skill's schedule window (exclusive), as an ISO-8601 timestamp with a UTC offset. From then on the skill is no longer in effect, and a conversation that had loaded it stops seeing its instructions. None = no end."},"schedule_timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Schedule Timezone","description":"IANA timezone the schedule window is written in (e.g. 'America/Guayaquil'), for a skill that follows another country's clock. It is how the window is shown and edited; when the skill is in effect is decided by active_from / active_until alone. A write that sends it may give those two as local times without an offset ('2026-10-02T08:00:00'), read in this timezone."}},"type":"object","required":["name","description","trigger","content"],"title":"SkillBase","description":"Base skill model — sub-instructions loaded on-demand for context window management."},"SkillConditionCheckRequest":{"properties":{"condition":{"additionalProperties":true,"type":"object","title":"Condition","description":"Condition AST to validate/evaluate (same shape as enable_condition)"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"Sample conversation context to evaluate against (e.g. pasted from the ChatLog context timeline). Omitted = validate only."},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id","description":"Evaluate against a real conversation: the latest per-message context snapshot of this conversation is used. Takes precedence over `context`."}},"type":"object","required":["condition"],"title":"SkillConditionCheckRequest","description":"Dry-run a skill enable_condition against a sample context or a real conversation."},"SkillConditionCheckResponse":{"properties":{"valid":{"type":"boolean","title":"Valid","description":"Whether the condition parses and passes validation"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Validation error when valid is false"},"rendered":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rendered","description":"Human-readable form of the condition"},"result":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Result","description":"Evaluation outcome against the provided context (null when validate-only or invalid)"},"context_found":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Context Found","description":"When conversation_id was given: whether the conversation had any context snapshot"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"The context the condition was evaluated against (echoed back for conversation dry-runs)"}},"type":"object","required":["valid"],"title":"SkillConditionCheckResponse","description":"Validation + evaluation outcome for a condition dry-run."},"SkillConditionClause":{"properties":{"path":{"type":"string","maxLength":256,"pattern":"^[A-Za-z0-9_-]+(\\.[A-Za-z0-9_-]+)*$","title":"Path","description":"Dotted context path (context-pill grammar)"},"operator":{"type":"string","enum":["eq","neq","in","not_in","contains","exists","not_exists","gt","gte","lt","lte"],"title":"Operator"},"value":{"title":"Value","description":"JSON scalar, or array for in/not_in; omitted for exists/not_exists"},"negate":{"type":"boolean","title":"Negate","default":false}},"type":"object","required":["path","operator"],"title":"SkillConditionClause","description":"A single ``path <operator> value`` check against the context dict."},"SkillConditionGroup-Input":{"properties":{"op":{"type":"string","enum":["and","or"],"title":"Op"},"clauses":{"items":{"anyOf":[{"$ref":"#/components/schemas/SkillConditionGroup-Input"},{"$ref":"#/components/schemas/SkillConditionClause"},{"$ref":"#/components/schemas/SkillConditionSegmentRef"}]},"type":"array","minItems":1,"title":"Clauses"},"negate":{"type":"boolean","title":"Negate","default":false}},"type":"object","required":["op","clauses"],"title":"SkillConditionGroup","description":"Boolean combination of clauses, segment refs, and (one level of) nested groups."},"SkillConditionGroup-Output":{"properties":{"op":{"type":"string","enum":["and","or"],"title":"Op"},"clauses":{"items":{"anyOf":[{"$ref":"#/components/schemas/SkillConditionGroup-Output"},{"$ref":"#/components/schemas/SkillConditionClause"},{"$ref":"#/components/schemas/SkillConditionSegmentRef"}]},"type":"array","minItems":1,"title":"Clauses"},"negate":{"type":"boolean","title":"Negate","default":false}},"type":"object","required":["op","clauses"],"title":"SkillConditionGroup","description":"Boolean combination of clauses, segment refs, and (one level of) nested groups."},"SkillConditionSegmentRef":{"properties":{"segment_id":{"type":"string","maxLength":64,"pattern":"^[A-Za-z0-9_-]{1,64}$","title":"Segment Id","description":"Id of a saved segment in this account"},"negate":{"type":"boolean","title":"Negate","default":false}},"type":"object","required":["segment_id"],"title":"SkillConditionSegmentRef","description":"Reference to a saved segment (a named, reusable ``SkillConditionGroup``).\n\nExpanded at evaluation time against a resolver map ``{segment_id: group}``\nsupplied by the caller (the leaf module never touches storage). An\nunresolvable / cyclic / malformed reference is fail-closed to False and its\n``negate`` is ignored — a broken reference must never *enable* a skill."},"SkillCreate":{"properties":{"name":{"type":"string","maxLength":100,"title":"Name","description":"Kebab-case identifier (e.g. 'refund-process')"},"description":{"type":"string","maxLength":1024,"title":"Description","description":"Short summary shown to the agent for skill discovery"},"trigger":{"type":"string","maxLength":2048,"title":"Trigger","description":"When the agent should load this skill"},"content":{"type":"string","title":"Content","description":"Full instructions (supports template macros)"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Reference conversation examples"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether this skill is active","default":true},"order":{"type":"integer","title":"Order","description":"Display/listing order","default":0},"enable_condition":{"anyOf":[{"$ref":"#/components/schemas/SkillConditionGroup-Input","description":"The segment's logical definition over context"},{"type":"null"}],"description":"Structured condition (groups of {path, operator, value} clauses) evaluated per turn against the live conversation context. None = unconditional. Only consulted when is_active is true; non-matching skills are excluded from the agent entirely."},"always_load":{"type":"boolean","title":"Always Load","description":"Inline the skill's full content into the static system prompt instead of loading it on demand via load_skill. Best for skills used in most conversations: their tokens join the cross-conversation prompt-cache prefix (read at ~0.1x price by every conversation) and the load_skill round-trip disappears. Only applies while the skill is enabled for the turn (is_active + schedule window + enable_condition).","default":false},"active_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active From","description":"Start of the skill's schedule window, as an ISO-8601 timestamp with a UTC offset (e.g. '2026-10-02T08:00:00-03:00'). Before it the skill is not in effect: not listed, not loadable, its tools not registered. None = in effect from now."},"active_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active Until","description":"End of the skill's schedule window (exclusive), as an ISO-8601 timestamp with a UTC offset. From then on the skill is no longer in effect, and a conversation that had loaded it stops seeing its instructions. None = no end."},"schedule_timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Schedule Timezone","description":"IANA timezone the schedule window is written in (e.g. 'America/Guayaquil'), for a skill that follows another country's clock. It is how the window is shown and edited; when the skill is in effect is decided by active_from / active_until alone. A write that sends it may give those two as local times without an offset ('2026-10-02T08:00:00'), read in this timezone."}},"type":"object","required":["name","description","trigger","content"],"title":"SkillCreate","description":"Model for creating a new skill. Creates a new playbook version."},"SkillListItem-Input":{"properties":{"name":{"type":"string","maxLength":100,"title":"Name","description":"Kebab-case identifier (e.g. 'refund-process')"},"description":{"type":"string","maxLength":1024,"title":"Description","description":"Short summary shown to the agent for skill discovery"},"trigger":{"type":"string","maxLength":2048,"title":"Trigger","description":"When the agent should load this skill"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content","description":"Full instructions; null when omitted from a catalog listing"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Reference conversation examples"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether this skill is active","default":true},"order":{"type":"integer","title":"Order","description":"Display/listing order","default":0},"enable_condition":{"anyOf":[{"$ref":"#/components/schemas/SkillConditionGroup-Input","description":"The segment's logical definition over context"},{"type":"null"}],"description":"Structured condition (groups of {path, operator, value} clauses) evaluated per turn against the live conversation context. None = unconditional. Only consulted when is_active is true; non-matching skills are excluded from the agent entirely."},"always_load":{"type":"boolean","title":"Always Load","description":"Inline the skill's full content into the static system prompt instead of loading it on demand via load_skill. Best for skills used in most conversations: their tokens join the cross-conversation prompt-cache prefix (read at ~0.1x price by every conversation) and the load_skill round-trip disappears. Only applies while the skill is enabled for the turn (is_active + schedule window + enable_condition).","default":false},"active_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active From","description":"Start of the skill's schedule window, as an ISO-8601 timestamp with a UTC offset (e.g. '2026-10-02T08:00:00-03:00'). Before it the skill is not in effect: not listed, not loadable, its tools not registered. None = in effect from now."},"active_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active Until","description":"End of the skill's schedule window (exclusive), as an ISO-8601 timestamp with a UTC offset. From then on the skill is no longer in effect, and a conversation that had loaded it stops seeing its instructions. None = no end."},"schedule_timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Schedule Timezone","description":"IANA timezone the schedule window is written in (e.g. 'America/Guayaquil'), for a skill that follows another country's clock. It is how the window is shown and edited; when the skill is in effect is decided by active_from / active_until alone. A write that sends it may give those two as local times without an offset ('2026-10-02T08:00:00'), read in this timezone."},"id":{"type":"string","title":"Id","description":"Unique ID for this skill instance"},"playbook_id":{"type":"string","title":"Playbook Id","description":"Playbook version this skill belongs to"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When this skill was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When this skill was last updated"},"content_chars":{"type":"integer","title":"Content Chars","description":"Size of the full content in characters, even when content is null","default":0},"schedule_state":{"anyOf":[{"type":"string","enum":["active","pending","ended"]},{"type":"null"}],"title":"Schedule State","description":"Where the clock falls in the skill's schedule window right now: 'pending' (not started), 'active' (in effect) or 'ended'. Null when the skill has no window. A skill is in effect only when is_active is true AND this is 'active' or null."}},"type":"object","required":["name","description","trigger","id","playbook_id","created_at","updated_at"],"title":"SkillListItem","description":"A skill as returned by the list endpoint, where the body is optional.\n\nCatalog listings (``include_content=false``) null out ``content`` instead of\nsubstituting a summary string: a null cannot be round-tripped back through\nSkillUpdate as the skill's new text, a placeholder can. ``content_chars``\nstill reports the real size, so an omitted body is distinguishable from an\nempty one without fetching it."},"SkillListItem-Output":{"properties":{"name":{"type":"string","maxLength":100,"title":"Name","description":"Kebab-case identifier (e.g. 'refund-process')"},"description":{"type":"string","maxLength":1024,"title":"Description","description":"Short summary shown to the agent for skill discovery"},"trigger":{"type":"string","maxLength":2048,"title":"Trigger","description":"When the agent should load this skill"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content","description":"Full instructions; null when omitted from a catalog listing"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Reference conversation examples"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether this skill is active","default":true},"order":{"type":"integer","title":"Order","description":"Display/listing order","default":0},"enable_condition":{"anyOf":[{"$ref":"#/components/schemas/SkillConditionGroup-Output","description":"The segment's logical definition over context"},{"type":"null"}],"description":"Structured condition (groups of {path, operator, value} clauses) evaluated per turn against the live conversation context. None = unconditional. Only consulted when is_active is true; non-matching skills are excluded from the agent entirely."},"always_load":{"type":"boolean","title":"Always Load","description":"Inline the skill's full content into the static system prompt instead of loading it on demand via load_skill. Best for skills used in most conversations: their tokens join the cross-conversation prompt-cache prefix (read at ~0.1x price by every conversation) and the load_skill round-trip disappears. Only applies while the skill is enabled for the turn (is_active + schedule window + enable_condition).","default":false},"active_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active From","description":"Start of the skill's schedule window, as an ISO-8601 timestamp with a UTC offset (e.g. '2026-10-02T08:00:00-03:00'). Before it the skill is not in effect: not listed, not loadable, its tools not registered. None = in effect from now."},"active_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active Until","description":"End of the skill's schedule window (exclusive), as an ISO-8601 timestamp with a UTC offset. From then on the skill is no longer in effect, and a conversation that had loaded it stops seeing its instructions. None = no end."},"schedule_timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Schedule Timezone","description":"IANA timezone the schedule window is written in (e.g. 'America/Guayaquil'), for a skill that follows another country's clock. It is how the window is shown and edited; when the skill is in effect is decided by active_from / active_until alone. A write that sends it may give those two as local times without an offset ('2026-10-02T08:00:00'), read in this timezone."},"id":{"type":"string","title":"Id","description":"Unique ID for this skill instance"},"playbook_id":{"type":"string","title":"Playbook Id","description":"Playbook version this skill belongs to"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When this skill was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When this skill was last updated"},"content_chars":{"type":"integer","title":"Content Chars","description":"Size of the full content in characters, even when content is null","default":0},"schedule_state":{"anyOf":[{"type":"string","enum":["active","pending","ended"]},{"type":"null"}],"title":"Schedule State","description":"Where the clock falls in the skill's schedule window right now: 'pending' (not started), 'active' (in effect) or 'ended'. Null when the skill has no window. A skill is in effect only when is_active is true AND this is 'active' or null."}},"type":"object","required":["name","description","trigger","id","playbook_id","created_at","updated_at"],"title":"SkillListItem","description":"A skill as returned by the list endpoint, where the body is optional.\n\nCatalog listings (``include_content=false``) null out ``content`` instead of\nsubstituting a summary string: a null cannot be round-tripped back through\nSkillUpdate as the skill's new text, a placeholder can. ``content_chars``\nstill reports the real size, so an omitted body is distinguishable from an\nempty one without fetching it."},"SkillLoadedAssertion":{"properties":{"type":{"type":"string","const":"skill_loaded","title":"Type","default":"skill_loaded"},"skill":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skill","description":"Skill name that must have been loaded; null/omitted matches any skill."}},"type":"object","title":"SkillLoadedAssertion","description":"Assert that the agent loaded a skill (casuística) during the conversation.\n\nFirst-class skill check: internally it verifies the ``load_skill`` tool\ncall trace (skills ARE loaded via a tool under the hood), but it is\ndeclared — and surfaced in results — as a skill event, not as a tool\nassertion. ``skill=None`` matches any skill load."},"SkillOverrideInput":{"properties":{"name":{"type":"string","maxLength":100,"title":"Name","description":"Kebab-case identifier (e.g. 'refund-flow')."},"description":{"type":"string","maxLength":1024,"title":"Description","description":"Summary shown to the agent for skill discovery. This IS what the LLM reads."},"content":{"type":"string","title":"Content","description":"Full skill instructions (supports template macros)."},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Optional reference conversation examples."},"order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Order","description":"Optional display/listing order; auto-assigned if omitted."},"enable_condition":{"anyOf":[{"$ref":"#/components/schemas/SkillConditionGroup-Input","description":"The segment's logical definition over context"},{"type":"null"}],"description":"Structured condition evaluated against the conversation context; omitted = unconditional."},"active_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active From","description":"Start of the skill's schedule window, as an ISO-8601 timestamp with a UTC offset (e.g. '2026-10-02T08:00:00-03:00'). Before it the skill is not in effect: not listed, not loadable, its tools not registered. None = in effect from now."},"active_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active Until","description":"End of the skill's schedule window (exclusive), as an ISO-8601 timestamp with a UTC offset. From then on the skill is no longer in effect, and a conversation that had loaded it stops seeing its instructions. None = no end."},"schedule_timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Schedule Timezone","description":"IANA timezone the schedule window is written in (e.g. 'America/Guayaquil'), for a skill that follows another country's clock. It is how the window is shown and edited; when the skill is in effect is decided by active_from / active_until alone. A write that sends it may give those two as local times without an offset ('2026-10-02T08:00:00'), read in this timezone."}},"type":"object","required":["name","description","content"],"title":"SkillOverrideInput","description":"Skill payload accepted by the override endpoint.\n\nTrimmed compared to the saved-version ``SkillBase``: ``trigger`` is\nomitted because the agent's system prompt only surfaces ``name`` and\n``description`` for skill discovery (see ``compiler_utils.py`` —\n``Skills (load with load_skill before responding):`` block). The\ntrigger column exists on the saved playbook for UI display, but the\nLLM never sees it — so exposing it on the override would be noise.\n\n``examples`` / ``order`` are also optional; the wrapper synthesises\ndefaults when they're omitted."},"SkillRecentItem":{"properties":{"id":{"type":"string","title":"Id"},"skill_name":{"type":"string","title":"Skill Name"},"success":{"type":"boolean","title":"Success"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"}},"type":"object","required":["id","skill_name","success","created_at"],"title":"SkillRecentItem"},"SkillTimeSeriesPoint":{"properties":{"date":{"type":"string","title":"Date"},"count":{"type":"integer","title":"Count"},"success_count":{"type":"integer","title":"Success Count"}},"type":"object","required":["date","count","success_count"],"title":"SkillTimeSeriesPoint"},"SkillUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name","description":"Updated kebab-case identifier"},"description":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Description","description":"Updated summary"},"trigger":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Trigger","description":"Updated trigger condition"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content","description":"Updated instructions"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Updated reference examples"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Updated active state"},"order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Order","description":"Updated display order"},"enable_condition":{"anyOf":[{"$ref":"#/components/schemas/SkillConditionGroup-Input","description":"The segment's logical definition over context"},{"type":"null"}],"description":"Updated condition. Explicit null clears it (back to unconditional); omitted keeps the current one."},"always_load":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Always Load","description":"Updated always-load flag (inline content into the static prompt). Omitted keeps the current value."},"active_from":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active From","description":"Updated start of the schedule window. Explicit null clears it; omitted keeps the current one."},"active_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Active Until","description":"Updated end of the schedule window. Explicit null clears it; omitted keeps the current one."},"schedule_timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Schedule Timezone","description":"Updated IANA timezone of the schedule window. Explicit null clears it; omitted keeps the current one. Sent together with active_from / active_until, those two may be local times without an offset, read in this timezone."}},"type":"object","title":"SkillUpdate","description":"Model for updating a skill. Creates a new playbook version."},"SlackTestMessageRequest":{"properties":{"channel":{"type":"string","title":"Channel","description":"Channel ID (OAuth picker) or #name (bot token)"}},"type":"object","required":["channel"],"title":"SlackTestMessageRequest","description":"Request to send a test message to a Slack channel via the project's toolkit."},"SlackTestMessageResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the test message was delivered"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error detail when delivery failed"}},"type":"object","required":["success"],"title":"SlackTestMessageResponse","description":"Result of a Slack test-message send."},"SlimRef":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"}},"type":"object","required":["id","label"],"title":"SlimRef","description":"Minimal {id, label} reference for pill rendering in the read-only\nviewer. Deliberately NOT the full resource: ApiTool rows carry headers\nthat may embed customer credentials — those must never ride a\nsuperadmin listing."},"SnippetItem":{"properties":{"id":{"type":"string","title":"Id","description":"Unique ID for this snippet"},"title":{"type":"string","title":"Title","description":"Title of the snippet"},"content":{"type":"string","title":"Content","description":"Content of the snippet"},"notes":{"anyOf":[{"items":{"$ref":"#/components/schemas/NoteItem"},"type":"array"},{"type":"null"}],"title":"Notes","description":"Correction notes injected into RAG search results"}},"type":"object","required":["title","content"],"title":"SnippetItem","description":"A single snippet item with ID, title, and content."},"SnippetsKnowledgeBaseCreate":{"properties":{"title":{"type":"string","title":"Title","description":"Title of the knowledge base"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"Optional markdown-formatted instructions for LLM when using this KB"},"metadata_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Fields","description":"Optional list of additional metadata field names to extract from retrieved chunks"},"snippet_items":{"items":{"$ref":"#/components/schemas/SnippetItem"},"type":"array","minItems":1,"title":"Snippet Items","description":"List of snippet items (at least one required)"},"kb_type":{"$ref":"#/components/schemas/KnowledgeBaseType","description":"Knowledge base type (always SNIPPETS)","default":"snippets"}},"type":"object","required":["title","snippet_items"],"title":"SnippetsKnowledgeBaseCreate","description":"Model for creating a SNIPPETS knowledge base.\n\nSnippets are ideal for catalogs, collections, product lists, etc.\nEach snippet has its own title and content, and becomes a separate vector node."},"SourceBreakdownRow":{"properties":{"source":{"type":"string","title":"Source"},"cost_usd":{"type":"number","title":"Cost Usd"},"llm_requests":{"type":"integer","title":"Llm Requests"},"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"cache_read_tokens":{"type":"integer","title":"Cache Read Tokens"}},"type":"object","required":["source","cost_usd","llm_requests","input_tokens","output_tokens","cache_read_tokens"],"title":"SourceBreakdownRow"},"SparklineItem":{"properties":{"total":{"type":"integer","title":"Total"},"series":{"items":{"$ref":"#/components/schemas/app__routers__resource_analytics__TimeSeriesPoint"},"type":"array","title":"Series"}},"type":"object","required":["total"],"title":"SparklineItem"},"StandaloneAccountDetail":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"is_active":{"type":"boolean","title":"Is Active"},"playbooks_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbooks Model"},"copilot_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Copilot Model"},"sami_session_max_age_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sami Session Max Age Hours"},"sami_session_max_age_hours_default":{"type":"number","title":"Sami Session Max Age Hours Default"},"sami_session_max_age_hours_effective":{"type":"number","title":"Sami Session Max Age Hours Effective"},"sami_session_cost_cap_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sami Session Cost Cap Usd"},"sami_session_cost_cap_usd_default":{"type":"number","title":"Sami Session Cost Cap Usd Default"},"sami_session_cost_cap_usd_effective":{"type":"number","title":"Sami Session Cost Cap Usd Effective"},"projects":{"items":{"$ref":"#/components/schemas/StandaloneProjectSummary"},"type":"array","title":"Projects"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","is_active","playbooks_model","copilot_model","sami_session_max_age_hours","sami_session_max_age_hours_default","sami_session_max_age_hours_effective","sami_session_cost_cap_usd","sami_session_cost_cap_usd_default","sami_session_cost_cap_usd_effective","projects","created_at","updated_at"],"title":"StandaloneAccountDetail","description":"Account detail with projects inlined. Each standalone account has\nat most one today, so this typically returns a single-element list."},"StandaloneAccountListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/StandaloneAccountSummary"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"global_fallback_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Global Fallback Model"}},"type":"object","required":["items","total","limit","offset"],"title":"StandaloneAccountListResponse"},"StandaloneAccountSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"is_active":{"type":"boolean","title":"Is Active"},"project_count":{"type":"integer","title":"Project Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","is_active","project_count","created_at"],"title":"StandaloneAccountSummary","description":"Row in the paginated accounts list. Includes the project count\nso the UI can show 'N projects' without an extra round-trip — a\nstandalone with 0 projects is a configuration smell worth surfacing."},"StandalonePlaybookListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/StandalonePlaybookSummary"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"StandalonePlaybookListResponse"},"StandalonePlaybookModelUpdate":{"properties":{"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Per-playbook-version model. Free-text — `provider/model_id`, optional `[reasoning=...]` suffix, or an A/B test split using `model_a:NN,model_b:MM` notation where percentages MUST sum to 100. Pass `null` to clear and fall back to the account default (then env). The panel does NOT expose an account-level setter today."}},"type":"object","title":"StandalonePlaybookModelUpdate"},"StandalonePlaybookSummary":{"properties":{"id":{"type":"string","title":"Id"},"base_id":{"type":"string","title":"Base Id"},"project_id":{"type":"string","title":"Project Id"},"project_name":{"type":"string","title":"Project Name"},"name":{"type":"string","title":"Name"},"version_number":{"type":"integer","title":"Version Number"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"effective_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective Model"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","base_id","project_id","project_name","name","version_number","model","effective_model","updated_at"],"title":"StandalonePlaybookSummary","description":"One playbook (= one 'assistant' in the UI). Includes project_name\nso the FE can group/render without joining client-side."},"StandaloneProjectSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"StandaloneProjectSummary","description":"One project under a standalone account. There's typically one\nper account but the API doesn't assume cardinality."},"StartConversationRequest":{"properties":{"task_id":{"type":"string","title":"Task Id","description":"The task this conversation exists to do, by id, from this assistant's catalog.","examples":["tsk_7f3ab2c19d04"]},"address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Address","description":"Who to reach and how — OPAQUE to Studio Chat and forwarded to the channel's adapter verbatim. Its shape is the deployed adapter's contract, not ours, which is what lets a new channel ship without a backend release.\n\nIntercom — the conversation id is an OUTPUT of sending, so what you pass is the person:\n  {\"channel\": \"intercom\", \"contact_id\": \"5f3c...\", \"admin_id\": \"8291043\"}\n\nWhatsApp (Bird / 360dialog / …) — the id is known in advance (it IS the contact), but outside the 24h service window the first message must be an approved template, so the template and its variables travel here and the assistant does NOT write the opener (use opening='channel'):\n  {\"channel\": \"whatsapp\", \"phone\": \"+5491122334455\", \"template_id\": \"cobranza_recordatorio_v3\", \"template_variables\": {\"1\": \"Karina\", \"2\": \"$14.320\"}}\n\nRequired unless deliver=false.","examples":[{"admin_id":"8291043","channel":"intercom","contact_id":"5f3c1a9e2b4d"}]},"channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id","description":"The channel that opens the conversation: the id of a channel registered on this account (Channels in the dashboard). Studio Chat asks that channel's adapter to open it — POST {base_url}/adapter/v1/conversations/start with the platform bearer, like a follow-up — and stamps the conversation with the channel, so follow-ups and task nudges come back through the same adapter. Its manifest must declare the `conversation_start` capability and route an inbox to this assistant; otherwise the start is refused with a 400 before anything is written. Replaces the assistant's `proactive_webhook_url`, which is no longer read. Required unless deliver=false.","examples":["7e98e5c1-a705-4156-9f59-abe6141f4b67"]},"transport":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/StartTransport"},{"type":"null"}],"title":"Transport","description":"HOW that channel reaches the person, when its platform has more than one way. Intercom can open the conversation in the Messenger (`inapp`), where it waits until they open the app, as an email (`email`), which lands in their inbox and needs a subject, or on WhatsApp (`whatsapp`) with an approved template. The vocabulary is the platform's, not ours: the channel's manifest lists what its adapter can open (`transports`), and asking for one it does not declare is refused with a 400 before the assistant spends a turn writing an opener nobody could deliver.\n\nA string (`\"inapp\"`) or an object (`{\"type\": \"whatsapp\", \"template\": {...}}`): the object carries what that transport needs — today, the approved template that opens it. The string is the short form of `{\"type\": ...}`.\n\nLeave it out for the channel's own default, which is what every start did before this field existed — on Intercom, `inapp`.","examples":["email",{"template":{"language":"es","name":"b2b_form_deal"},"type":"whatsapp"}]},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id","description":"Supply it when you already know the channel's id (WhatsApp: the contact). Leave it out for channels where the id only exists after the first message (Intercom): the adapter answers with it and we adopt it, so the Studio Chat id is always the channel's id."},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"The context of the OPENING turn, and the adapter's own note about how to reach this conversation — the same thing `context` is on /chat: the channel's view of the person, read by `{{ context: }}` pills and API tools on that one turn and forwarded to the adapter with the start. Not persisted: later turns carry whatever the channel sends. The task's own parameters go in `inputs`, never here."},"inputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Inputs","description":"What this task gets to work with in THIS conversation — the part of the job that differs per person (the questions a provider asked, the amount owed). A free-form JSON object, yours to shape. Stored on the task run for as long as the task lives and shown to the assistant inside its task block on every turn (one `key: value` line per top-level key), so the task text can read a value with `{{ input: preguntas }}` or simply say 'las preguntas del input'. Studio Chat's, not the channel's: never sent to the adapter, never mixed into `context`.","examples":[{"preguntas":["¿A qué actividad te dedicás?","¿De quién recibís los fondos?"]}]},"user":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/UserRef"},{"type":"null"}],"title":"User","description":"Who we are reaching out to — same field, same set-once rule as on /chat. Worth sending here: a proactive start already knows the person (it is what `address` names), so binding at creation means the opening turn can already read `{{ user: id }}` instead of waiting for their first reply. Without it, the conversation is bound to whoever the channel's adapter reports it reached (its `user` in the start answer), when it reports one.","examples":["6543f2a1b9c"]},"organization":{"anyOf":[{"type":"string"},{"$ref":"#/components/schemas/OrganizationRef"},{"type":"null"}],"title":"Organization","description":"Which organization the person we are reaching out to belongs to — same field, same set-once rule as on /chat. Binding at creation means the opening turn can already read `{{ organization: id }}` and look up the organization's history.","examples":["acme-42"]},"template_set_id":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}],"title":"Template Set Id","description":"Open with one of the assistant's template sets (an approved WhatsApp template) instead of a message the assistant writes. The set must allow `proactive_start` and the account needs the template_sets flag. Contact variables are read from `context`, model variables from `inputs`. With `channel_id` (a bridge) the structured template goes to the adapter as `address.template` and the start runs as opening='channel'. Without it, on a native Rumo account, Studio Chat sends it through Rumo itself: into `conversation_id` (a Rumo conversation id), or to `address.phone` with /direct_messages/send_by_template (asynchronous: the answer's conversation_id is `direct:<tracking id>` and no task is assigned until the customer replies).","examples":["reengage_visita"]},"opening":{"type":"string","enum":["assistant","channel"],"title":"Opening","description":"Who writes the first message. 'assistant' (default): we run the task's first turn and the channel delivers the text we produce. 'channel': the adapter opens with what the address specifies — a WhatsApp template — and reports what it sent; we record it as an operator outbound and the assistant picks the task up on the customer's reply. A `transport.template` implies 'channel': there is no need to send both.","default":"assistant"},"deliver":{"type":"boolean","title":"Deliver","description":"False generates the opening message and assigns the task without contacting any channel — a dry run for checking what the assistant would say. Needs no channel_id; requires conversation_id, since without a channel nobody can mint one. Not available with opening='channel' or a `transport.template`, where the channel writes the opener.","default":true}},"type":"object","required":["task_id"],"title":"StartConversationRequest","description":"Open a conversation the customer did not start, to run a task in it.\n\nEvery other conversation exists because someone wrote to us. This one exists\nbecause the task does, which means two things have to happen that never\nhappen anywhere else: the channel has to CREATE a thread, and the assistant\nhas to write into it first.\n\nStudio Chat does neither. It generates the opening line and hands it to the\nadapter of the channel named in ``channel_id``, which owns the platform —\nsame rule as follow-ups, and the reason ``address`` below is never\ninterpreted here."},"StartConversationResponse":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"The channel's id, which is also the Studio Chat id — pass it to /chat from here on."},"task":{"anyOf":[{"$ref":"#/components/schemas/TaskEvaluation"},{"type":"null"}],"description":"The task now running on it."},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"The opening message. Written by the assistant, or reported by the bridge when a template opened it."},"delivered":{"type":"boolean","title":"Delivered","description":"False on a deliver=false dry run."},"adopted":{"type":"boolean","title":"Adopted","description":"True when the id came back from the bridge rather than from the caller.","default":false},"transport":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transport","description":"How the channel actually opened it, as its adapter reports it — the requested `transport` when the adapter stays quiet, and None on a dry run or a channel with only one way of reaching people.","examples":["email"]}},"type":"object","required":["conversation_id","delivered"],"title":"StartConversationResponse","description":"The conversation that now exists, and what was said into it."},"StartTemplate":{"properties":{"name":{"type":"string","maxLength":512,"minLength":1,"title":"Name","description":"The template's name on the platform, exactly as it was approved.","examples":["b2b_form_deal"]},"language":{"anyOf":[{"type":"string","maxLength":20,"minLength":1},{"type":"null"}],"title":"Language","description":"The template's language code (`es`, `es_AR`, `en_US`). Left out, the platform picks — Intercom tries the contact's language, then the workspace's.","examples":["es"]},"variables":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Variables","description":"The values for the template's placeholders. A list fills the body in order (`[\"Ana\", \"Acme\"]` → {{1}}, {{2}}); a mapping names the position, `\"body.1\"` (or just `\"1\"`) for the body and `\"header.1\"` for the header.","examples":[["Ana"],{"body.1":"Ana","header.1":"Acme"}]}},"additionalProperties":false,"type":"object","required":["name"],"title":"StartTemplate","description":"The approved message template that opens a task's conversation (a WhatsApp template).\n\nChosen by whoever starts the task, on every start — a task never declares one,\nso the same task can go out with a different template per campaign, country or\nlanguage. It travels inside the transport it belongs to (``StartTransport``):\nwhether a channel needs one is the channel's call, per transport — its\nmanifest declares ``templates`` (``{\"whatsapp\": \"required\"}``)."},"StartTransport":{"properties":{"type":{"type":"string","maxLength":40,"minLength":1,"title":"Type","description":"The platform's name for this way of reaching people, as the channel's manifest lists it.","examples":["whatsapp"]},"template":{"anyOf":[{"$ref":"#/components/schemas/StartTemplate"},{"type":"null"}],"description":"The approved template that opens the conversation on this transport. Optional in the API — the CHANNEL decides whether this transport requires one: its manifest declares `templates` per transport (`{\"whatsapp\": \"required\"}` on Intercom, where outside the 24h window nothing else can write first; nothing on an unofficial WhatsApp connection, where the assistant can). Missing where required → 422 `template_required`; sent where the manifest lists none → 400 `template_not_accepted`; an adapter that declares no `templates` is not second-guessed. Both are checked before the task takes its slot.\n\nWith a template the template opens the conversation (`opening` becomes 'channel'): the assistant writes nothing, the adapter reports the text it sent, and the assistant takes the task up on the person's reply — told that the conversation was opened by this template, fixed text it did not write. Without one the assistant writes the opener.","examples":[{"language":"es","name":"b2b_form_deal","variables":["Ana"]}]}},"additionalProperties":false,"type":"object","required":["type"],"title":"StartTransport","description":"How the channel reaches the person, with what that way of reaching needs.\n\nThe object form of ``StartConversationRequest.transport``. The template lives\nhere because it depends on the transport: WhatsApp on Intercom cannot open\nwithout one, in-app and email never take one. The plain string\n(``\"transport\": \"inapp\"``) stays the short form of ``{\"type\": \"inapp\"}``."},"StatusBucket":{"properties":{"bucket_start":{"type":"string","format":"date-time","title":"Bucket Start"},"total":{"type":"integer","title":"Total"},"by_client":{"additionalProperties":{"$ref":"#/components/schemas/ClientWindowMetrics"},"type":"object","title":"By Client"}},"type":"object","required":["bucket_start","total","by_client"],"title":"StatusBucket"},"StatusHealth":{"properties":{"backend":{"type":"boolean","title":"Backend","description":"True if this endpoint responded at all (always True when the panel sees this)."},"database":{"type":"boolean","title":"Database","description":"True if a `SELECT 1` ping succeeded."},"readiness":{"type":"boolean","title":"Readiness","description":"Mirrors /readiness — True when backend + DB are both ok."},"version":{"type":"string","title":"Version","description":"Backend version string (matches /readiness)."},"last_activity_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Activity At","description":"Most recent ChatConversation.created_at within the 48h scan window. Null when there's been no activity in 48h — a useful 'is anything happening?' signal."},"minutes_since_activity":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Minutes Since Activity","description":"Convenience: minutes elapsed since `last_activity_at`. Null when that's null."}},"type":"object","required":["backend","database","readiness","version"],"title":"StatusHealth","description":"Lightweight health snapshot — same data /readiness exposes, plus\na database ping and the most recent activity timestamp. Bundled\ninto /superadmin/status so the panel doesn't need a second\nround-trip on every refresh."},"StatusResponse":{"properties":{"now":{"type":"string","format":"date-time","title":"Now"},"health":{"$ref":"#/components/schemas/StatusHealth"},"last_15m":{"$ref":"#/components/schemas/StatusWindowBlock-Output"},"last_1h":{"$ref":"#/components/schemas/StatusWindowBlock-Output"},"last_24h":{"$ref":"#/components/schemas/StatusWindowBlock-Output"},"timeline_1h":{"items":{"$ref":"#/components/schemas/StatusBucket"},"type":"array","title":"Timeline 1H","description":"12 buckets of 5 minutes each, covering the last 60 minutes."}},"type":"object","required":["now","health","last_15m","last_1h","last_24h","timeline_1h"],"title":"StatusResponse"},"StatusWindowBlock-Input":{"properties":{"current":{"$ref":"#/components/schemas/StatusWindowMetrics"},"previous":{"$ref":"#/components/schemas/StatusWindowMetrics"},"total_pct_diff":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Pct Diff","description":"(current_total - previous_total) / previous_total * 100, null when previous=0."},"by_client_diff":{"additionalProperties":{"$ref":"#/components/schemas/StatusWindowDiff"},"type":"object","title":"By Client Diff"}},"type":"object","required":["current","previous","by_client_diff"],"title":"StatusWindowBlock","description":"One window of the KPI strip — current values, the same window\nfrom one period earlier, and the diffs between them."},"StatusWindowBlock-Output":{"properties":{"current":{"$ref":"#/components/schemas/StatusWindowMetrics"},"previous":{"$ref":"#/components/schemas/StatusWindowMetrics"},"total_pct_diff":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Pct Diff","description":"(current_total - previous_total) / previous_total * 100, null when previous=0."},"by_client_diff":{"additionalProperties":{"$ref":"#/components/schemas/StatusWindowDiff"},"type":"object","title":"By Client Diff"}},"type":"object","required":["current","previous","by_client_diff"],"title":"StatusWindowBlock","description":"One window of the KPI strip — current values, the same window\nfrom one period earlier, and the diffs between them."},"StatusWindowDiff":{"properties":{"total_pct_diff":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Pct Diff"},"deflection_pp_diff":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Deflection Pp Diff"}},"type":"object","required":["total_pct_diff","deflection_pp_diff"],"title":"StatusWindowDiff","description":"Per-client diffs comparing this window to the previous one of\nthe same length. `total_pct_diff` is relative %; `deflection_pp_diff`\nis absolute percentage points (75% → 80% reads as +5pp, not +6.7%)\nbecause operators reason about deflection rate in absolute terms."},"StatusWindowMetrics":{"properties":{"total_conversations":{"type":"integer","title":"Total Conversations"},"by_client":{"additionalProperties":{"$ref":"#/components/schemas/ClientWindowMetrics"},"type":"object","title":"By Client","description":"Per-priced-client breakdown. Keys mirror RESOLVED_CONVERSATION_PRICING_CENTS, so adding a client in that dict surfaces a new bucket here automatically."}},"type":"object","required":["total_conversations","by_client"],"title":"StatusWindowMetrics","description":"Stats for one time window. Latency is intentionally not included\nhere today — surfacing it as a single number across all clients was\nmisleading and we removed it from the panel until per-client\nlatency makes it back in."},"SuggestionContent":{"properties":{"text":{"type":"string","title":"Text","description":"Suggested response text"},"confidence":{"$ref":"#/components/schemas/ConfidenceLevel","description":"Confidence level (HIGH, MEDIUM, or LOW)"}},"type":"object","required":["text","confidence"],"title":"SuggestionContent","description":"Content of a suggestion (text and confidence only)."},"SuggestionItem":{"properties":{"title":{"type":"string","title":"Title"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"action":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Action"},"short_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Title"},"exclude_channels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Exclude Channels"}},"additionalProperties":false,"type":"object","required":["title"],"title":"SuggestionItem","description":"One suggestion chip above the composer."},"SuggestionLanguage":{"type":"string","enum":["en","es","pt"],"title":"SuggestionLanguage","description":"Supported languages for suggestions."},"SuggestionPlaybook":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the suggestion assistant"},"content":{"type":"string","title":"Content","description":"Free-text instructions for generating suggestions"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Global reference conversation examples"},"kb_ids":{"items":{"type":"string"},"type":"array","title":"Kb Ids","description":"Knowledge base IDs available to this assistant"},"api_tools":{"items":{"type":"string"},"type":"array","title":"Api Tools","description":"API tool IDs available to this assistant"},"enrichment_tool_ids":{"items":{"type":"string"},"type":"array","title":"Enrichment Tool Ids","description":"Subset of api_tools auto-run at conversation start (enrichment). Their results are pre-loaded into the system prompt before the LLM's first turn."},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Model override for this suggestion playbook. Accepts the full model string (e.g. 'openrouter/openai/gpt-5.4', 'openrouter/openai/gpt-5.4-mini[reasoning=medium]'). When null, the system falls back to the account / env default. Experiment-routing syntax (model_a:50,model_b:50) is supported on the chat-playbook table, not on suggestions yet."},"id":{"type":"string","title":"Id","description":"Unique ID for this specific version"},"base_id":{"type":"string","title":"Base Id","description":"Common ID shared across versions"},"project_id":{"type":"string","title":"Project Id","description":"Project this playbook belongs to"},"version_number":{"type":"integer","title":"Version Number","description":"Version number","default":1},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Whether this version is soft-deleted","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When this version was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When this version was last updated"},"first_version_created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Version Created At","description":"When version 1 was created (for display purposes)"}},"type":"object","required":["name","content","id","base_id","project_id","created_at","updated_at"],"title":"SuggestionPlaybook","description":"Full suggestion playbook model.\n\nEach suggestion playbook version has a unique id.\nAll versions share a base_id."},"SuggestionPlaybookCreate":{"properties":{"name":{"type":"string","title":"Name","description":"Name of the suggestion assistant"},"content":{"type":"string","title":"Content","description":"Free-text instructions for generating suggestions"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Global reference conversation examples"},"kb_ids":{"items":{"type":"string"},"type":"array","title":"Kb Ids","description":"Knowledge base IDs available to this assistant"},"api_tools":{"items":{"type":"string"},"type":"array","title":"Api Tools","description":"API tool IDs available to this assistant"},"enrichment_tool_ids":{"items":{"type":"string"},"type":"array","title":"Enrichment Tool Ids","description":"Subset of api_tools auto-run at conversation start (enrichment). Their results are pre-loaded into the system prompt before the LLM's first turn."},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Model override for this suggestion playbook. Accepts the full model string (e.g. 'openrouter/openai/gpt-5.4', 'openrouter/openai/gpt-5.4-mini[reasoning=medium]'). When null, the system falls back to the account / env default. Experiment-routing syntax (model_a:50,model_b:50) is supported on the chat-playbook table, not on suggestions yet."}},"type":"object","required":["name","content"],"title":"SuggestionPlaybookCreate","description":"Model for creating a new suggestion playbook."},"SuggestionPlaybookUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Updated name"},"content":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content","description":"Updated instructions"},"examples":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Examples","description":"Updated reference examples"},"kb_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Kb Ids","description":"Updated knowledge base IDs"},"api_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Api Tools","description":"Updated API tool IDs"},"enrichment_tool_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Enrichment Tool Ids","description":"Updated enrichment tool IDs"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Updated model override. Pass explicit null to clear the override and fall back to the account / env default. Omit the key to keep the current value (PATCH semantics — only present keys are applied)."}},"type":"object","title":"SuggestionPlaybookUpdate","description":"Model for updating a suggestion playbook (creates a new version)."},"SuperadminApprovalItem":{"properties":{"id":{"type":"string","title":"Id"},"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"request_method":{"type":"string","title":"Request Method"},"request_path":{"type":"string","title":"Request Path"},"request_query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Query"},"request_body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Body"},"description":{"type":"string","title":"Description"},"change_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Change Description"},"status":{"type":"string","title":"Status"},"submitted_by_user_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Submitted By User Id"},"submitted_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Submitted By Name"},"reviewed_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewed By Name"},"reviewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reviewed At"},"execution_status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Execution Status Code"},"execution_result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Execution Result"},"executed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Executed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"activation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Activation"}},"type":"object","required":["id","account_id","account_name","project_id","request_method","request_path","request_query","request_body","description","change_description","status","submitted_by_user_id","submitted_by_name","reviewed_by_name","reviewed_at","execution_status_code","execution_result","executed_at","created_at","updated_at"],"title":"SuperadminApprovalItem"},"SuperadminApprovalListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SuperadminApprovalItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"pending_total":{"type":"integer","title":"Pending Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","pending_total","limit","offset"],"title":"SuperadminApprovalListResponse"},"SuperadminConversationResponse":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id","description":"The user this conversation belongs to. Non-null means the chatlog can offer this person's other conversations — filter the list endpoint by the same value."},"external_organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Organization Id","description":"The organization this conversation belongs to. Non-null means the chatlog can offer the organization's other conversations — filter the list endpoint by the same value."},"inbox_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbox Id"},"inbox_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbox Name"},"playbook_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Id"},"playbook_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Name"},"playbook_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Playbook Version"},"playbook_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Playbook Ids","description":"All playbook IDs that participated (null for pre-migration)"},"playbooks_info":{"items":{"$ref":"#/components/schemas/PlaybookInfo"},"type":"array","title":"Playbooks Info","description":"Resolved info for all playbooks that participated"},"message_count":{"type":"integer","title":"Message Count","default":0},"first_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Message At"},"last_message_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Message At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"has_handoff":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Handoff"},"has_error":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Error"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"skills":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Skills"},"avg_response_latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Response Latency Ms"},"sentiment_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Label"},"sentiment_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment Reason"},"resources_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resources Label"},"resources_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resources Reason"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"winback_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Winback Sent At"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"},"csat":{"anyOf":[{"$ref":"#/components/schemas/ConversationCSATInfo"},{"type":"null"}]},"messages":{"items":{"$ref":"#/components/schemas/ConversationDetailMessage-Output"},"type":"array","title":"Messages"},"citations":{"anyOf":[{"items":{"$ref":"#/components/schemas/CitationRef"},"type":"array"},{"type":"null"}],"title":"Citations"},"project_id":{"type":"string","title":"Project Id"}},"type":"object","required":["conversation_id","project_id"],"title":"SuperadminConversationResponse","description":"Activity-shaped conversation detail + the owning project id.\n\nThe FE reuses the customer ConversationDetail component, which needs\n``project_id`` for its child props; the customer endpoint carries it in\nthe URL, the superadmin one resolves it during the cross-project search."},"SuperadminPlaybookDetail":{"properties":{"playbook":{"$ref":"#/components/schemas/Playbook"},"skills":{"items":{"$ref":"#/components/schemas/Skill-Output"},"type":"array","title":"Skills"},"knowledge_bases":{"items":{"$ref":"#/components/schemas/SlimRef"},"type":"array","title":"Knowledge Bases"},"tools":{"items":{"$ref":"#/components/schemas/SlimRef"},"type":"array","title":"Tools"}},"type":"object","required":["playbook","skills","knowledge_bases","tools"],"title":"SuperadminPlaybookDetail","description":"Read-only playbook payload for the superadmin viewer: the version's\ncontent + skills, plus slim KB/tool references so instruction macros\n({{ kb(id) }} / {{ tool(id) }}) render as named pills."},"SupportCase":{"properties":{"id":{"type":"string","title":"Id"},"case_number":{"type":"string","title":"Case Number"},"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"},"customer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Email"},"category":{"$ref":"#/components/schemas/CaseCategory"},"reason":{"type":"string","title":"Reason"},"status":{"$ref":"#/components/schemas/CaseStatus"},"resolution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution"},"opened_at":{"type":"string","format":"date-time","title":"Opened At"}},"type":"object","required":["id","case_number","category","reason","status","opened_at"],"title":"SupportCase"},"TagAddedAssertion":{"properties":{"type":{"type":"string","const":"tag_added","title":"Type","default":"tag_added"},"tag":{"type":"string","title":"Tag","description":"Expected tag name"}},"type":"object","required":["tag"],"title":"TagAddedAssertion","description":"Assert that a ``label`` event added the given tag.\n\nThe agent's canonical event type is still ``label`` (see\n``app/agent/response.py``); this assertion uses the user-facing term\n\"tag\" for consistency with the rest of the eval surface."},"TagAnalyticsMetrics":{"properties":{"tag":{"type":"string","title":"Tag","description":"Tag name"},"total_conversations":{"type":"integer","title":"Total Conversations","description":"Total conversations with this tag"},"conversations_with_handoff":{"type":"integer","title":"Conversations With Handoff","description":"Conversations with handoff that have this tag"},"deflection_rate":{"type":"number","title":"Deflection Rate","description":"Percentage of conversations resolved without handoff (0-100)"}},"type":"object","required":["tag","total_conversations","conversations_with_handoff","deflection_rate"],"title":"TagAnalyticsMetrics","description":"Analytics metrics for a specific tag."},"TagCostBreakdown":{"properties":{"playbook_cost_usd":{"type":"number","title":"Playbook Cost Usd","description":"Playbook-agent LLM cost (ChatMessage.cost_usd sum)","default":0.0},"postprocessing_cost_usd":{"type":"number","title":"Postprocessing Cost Usd","description":"Conversation-metrics / scoring LLM cost (ConversationMetrics.cost_usd sum)","default":0.0},"eval_cost_usd":{"type":"number","title":"Eval Cost Usd","description":"Eval-only overhead cost (EvalRun.eval_overhead_cost_usd sum) — simulator + LLM-judge OpenRouter spend. Populated for account-level and per-playbook rows; 0 on dimensions where eval cost is not well-defined (tags, models, individual conversations).","default":0.0},"total_cost_usd":{"type":"number","title":"Total Cost Usd","description":"playbook_cost_usd + postprocessing_cost_usd + eval_cost_usd","default":0.0},"tag":{"type":"string","title":"Tag"},"total_input_tokens":{"type":"integer","title":"Total Input Tokens"},"total_output_tokens":{"type":"integer","title":"Total Output Tokens"},"total_messages":{"type":"integer","title":"Total Messages"},"total_conversations":{"type":"integer","title":"Total Conversations"},"avg_cost_per_conversation":{"type":"number","title":"Avg Cost Per Conversation"}},"type":"object","required":["tag","total_input_tokens","total_output_tokens","total_messages","total_conversations","avg_cost_per_conversation"],"title":"TagCostBreakdown"},"TagGroup-Input":{"properties":{"type":{"type":"string","const":"group","title":"Type","default":"group"},"op":{"type":"string","enum":["and","or"],"title":"Op"},"children":{"items":{"oneOf":[{"$ref":"#/components/schemas/TagLeaf"},{"$ref":"#/components/schemas/TagGroup-Input"}],"discriminator":{"propertyName":"type","mapping":{"group":"#/components/schemas/TagGroup-Input","tag":"#/components/schemas/TagLeaf"}}},"type":"array","title":"Children"}},"type":"object","required":["op"],"title":"TagGroup"},"TagGroup-Output":{"properties":{"type":{"type":"string","const":"group","title":"Type","default":"group"},"op":{"type":"string","enum":["and","or"],"title":"Op"},"children":{"items":{"oneOf":[{"$ref":"#/components/schemas/TagLeaf"},{"$ref":"#/components/schemas/TagGroup-Output"}],"discriminator":{"propertyName":"type","mapping":{"group":"#/components/schemas/TagGroup-Output","tag":"#/components/schemas/TagLeaf"}}},"type":"array","title":"Children"}},"type":"object","required":["op"],"title":"TagGroup"},"TagLeaf":{"properties":{"type":{"type":"string","const":"tag","title":"Type","default":"tag"},"value":{"type":"string","maxLength":200,"minLength":1,"title":"Value"},"negate":{"type":"boolean","title":"Negate","default":false}},"type":"object","required":["value"],"title":"TagLeaf"},"TaskEvaluation":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"The task this read is about. Stamped by the server, not by the model."},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Human label of that task. Stamped by the server."},"status":{"type":"string","enum":["in_progress","done","failed"],"title":"Status","description":"in_progress = still being pursued · done = finished · failed = a give-up condition fired"},"reason":{"type":"string","title":"Reason","description":"One sentence on why it is in that state.","default":""}},"type":"object","required":["status"],"title":"TaskEvaluation","description":"The assistant's per-turn read on how its task is going.\n\nEmitted by the LLM as part of the structured output whenever the playbook\nhas an enabled task. It rides inside the stored response JSON, so it\nis persisted with the assistant turn for free and replayed to the model in\nthe history — the assistant always sees its own previous read."},"TaskRunOpenAge":{"properties":{"lt_1d":{"type":"integer","title":"Lt 1D"},"d1_3":{"type":"integer","title":"D1 3"},"d3_7":{"type":"integer","title":"D3 7"},"gt_7d":{"type":"integer","title":"Gt 7D"}},"type":"object","required":["lt_1d","d1_3","d3_7","gt_7d"],"title":"TaskRunOpenAge","description":"Every run still in progress, by how long ago it was assigned."},"TaskRunStatsBucket":{"properties":{"start":{"type":"string","title":"Start","description":"Bucket start as a naive local wall clock in the requested timezone, ISO without offset."},"assigned":{"type":"integer","title":"Assigned"},"done":{"type":"integer","title":"Done"},"failed":{"type":"integer","title":"Failed"},"in_progress":{"type":"integer","title":"In Progress"},"closed":{"type":"integer","title":"Closed","description":"Runs whose closed_at falls in this bucket, whenever they were assigned."}},"type":"object","required":["start","assigned","done","failed","in_progress","closed"],"title":"TaskRunStatsBucket","description":"One bar of the task log's activity chart."},"TaskRunStatsByTask":{"properties":{"task_id":{"type":"string","title":"Task Id"},"task_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Name"},"total":{"type":"integer","title":"Total"},"done":{"type":"integer","title":"Done"},"failed":{"type":"integer","title":"Failed"},"in_progress":{"type":"integer","title":"In Progress"}},"type":"object","required":["task_id","total","done","failed","in_progress"],"title":"TaskRunStatsByTask"},"TaskRunStatsResponse":{"properties":{"total":{"type":"integer","title":"Total"},"done":{"type":"integer","title":"Done"},"failed":{"type":"integer","title":"Failed"},"in_progress":{"type":"integer","title":"In Progress"},"previous_total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Previous Total","description":"Runs assigned in the same-length window right before this one; a window with no end runs to now; null when there is no start."},"median_close_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Median Close Seconds"},"p90_close_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P90 Close Seconds"},"buckets":{"items":{"$ref":"#/components/schemas/TaskRunStatsBucket"},"type":"array","title":"Buckets"},"open_age":{"$ref":"#/components/schemas/TaskRunOpenAge","description":"The whole open backlog now, regardless of the window."},"by_task":{"items":{"$ref":"#/components/schemas/TaskRunStatsByTask"},"type":"array","title":"By Task"},"tasks":{"items":{"$ref":"#/components/schemas/TaskRunStatsTask"},"type":"array","title":"Tasks","description":"Every task this project ever ran, for the task picker."}},"type":"object","required":["total","done","failed","in_progress","buckets","open_age","by_task","tasks"],"title":"TaskRunStatsResponse","description":"The task log's summary: runs assigned in a window, by current status."},"TaskRunStatsTask":{"properties":{"task_id":{"type":"string","title":"Task Id"},"task_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Name"}},"type":"object","required":["task_id"],"title":"TaskRunStatsTask"},"TaskRunSummary":{"properties":{"id":{"type":"integer","title":"Id"},"conversation_id":{"type":"string","title":"Conversation Id"},"playbook_base_id":{"type":"string","title":"Playbook Base Id"},"playbook_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Playbook Version"},"playbook_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Name"},"task_id":{"type":"string","title":"Task Id"},"task_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Name"},"status":{"type":"string","enum":["in_progress","done","failed"],"title":"Status"},"last_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Reason"},"assigned_at":{"type":"string","format":"date-time","title":"Assigned At"},"closed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Closed At"},"assigned_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned By"},"inputs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Inputs","description":"What this run was assigned with — the task's per-conversation parameters (the questions asked, the amount owed). Null when the assignment carried none."},"nudge_count":{"type":"integer","title":"Nudge Count","description":"Follow-ups the cron sent on this run after the conversation went quiet.","default":0},"last_evaluated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Evaluated At","description":"When the follow-up cron last considered this run — set even when it decided not to write."}},"type":"object","required":["id","conversation_id","playbook_base_id","task_id","status","assigned_at"],"title":"TaskRunSummary","description":"One run of a task on a conversation, as the task log reads it."},"TaskRunsResponse":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/TaskRunSummary"},"type":"array","title":"Runs"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["runs","total","limit","offset"],"title":"TaskRunsResponse","description":"A page of task runs, plus how many matched the filters."},"TemplateEventData":{"properties":{"set_id":{"type":"string","title":"Set Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"inbox_id":{"type":"integer","title":"Inbox Id"},"template_name":{"type":"string","title":"Template Name"},"language":{"type":"string","title":"Language"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"template_params":{"additionalProperties":true,"type":"object","title":"Template Params","description":"Rumo template_params: {name, language, category?, processed_params}"},"ref":{"type":"string","title":"Ref","description":"ts:<set id>"},"use":{"type":"string","title":"Use","description":"Which allowed use this send is: conversation, reengage, followup...","default":"conversation"},"missing_variables":{"items":{"type":"string"},"type":"array","title":"Missing Variables","description":"Variables without a value: the template can't be sent, the text goes"},"fallback_text":{"type":"string","title":"Fallback Text","description":"Text to send when the template can't go (any Rumo 4xx)","default":""},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text","description":"Same as fallback_text, for a caller that renders text only"}},"additionalProperties":false,"type":"object","required":["set_id","inbox_id","template_name","language","template_params","ref"],"title":"TemplateEventData","description":"A WhatsApp template from a template set (app/rumo_sets.py), ready for Rumo's template path."},"TemplateFlowButton":{"properties":{"index":{"type":"integer","maximum":9.0,"minimum":0.0,"title":"Index","description":"The button's position in the template.","default":0},"flow_set_id":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},{"type":"null"}],"title":"Flow Set Id"},"prefill":{"additionalProperties":{"type":"string"},"type":"object","title":"Prefill"}},"additionalProperties":false,"type":"object","title":"TemplateFlowButton","description":"The template's FLOW button: which flow set it opens (its prefill)."},"TemplateSet":{"properties":{"id":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","title":"Id","examples":["reengage_visita"]},"label":{"type":"string","maxLength":60,"minLength":1,"title":"Label"},"inbox_id":{"type":"integer","exclusiveMinimum":0.0,"title":"Inbox Id"},"template_name":{"type":"string","pattern":"^[a-z0-9_]{1,512}$","title":"Template Name"},"language":{"type":"string","pattern":"^[a-z]{2,3}(_[A-Za-z]{2,4})?$","title":"Language","examples":["es_AR"]},"category":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}],"title":"Category","description":"Copied from Rumo, for display only."},"variables":{"additionalProperties":{"$ref":"#/components/schemas/TemplateVariable"},"type":"object","title":"Variables","description":"Keyed body.1, header.1 (or a named param, body.nombre)."},"flow_button":{"anyOf":[{"$ref":"#/components/schemas/TemplateFlowButton"},{"type":"null"}]},"allowed_uses":{"items":{"type":"string","enum":["reengage","proactive_start","followup","conversation"]},"type":"array","title":"Allowed Uses"},"when_to_use":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"When To Use"},"fallback_text":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Fallback Text","description":"Text sent where the template can't go."}},"additionalProperties":false,"type":"object","required":["id","label","inbox_id","template_name","language"],"title":"TemplateSet","description":"An approved WhatsApp template the assistant may send by id (``{{ template: id }}``).\n\n``allowed_uses`` is the operator's cost control: ``reengage`` (the model,\noutside the window), ``proactive_start`` (Tasks API), ``followup``\n(follow-up rules outside the window) and ``conversation`` (inside the\nwindow, during a turn)."},"TemplateVariable":{"properties":{"source":{"type":"string","enum":["contact","model","static"],"title":"Source"},"path":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}(\\.[A-Za-z0-9_]{1,40})?$"},{"type":"null"}],"title":"Path","description":"contact: name, email, phone_number, or custom_attributes.<key>."},"param":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{0,29}$"},{"type":"null"}],"title":"Param","description":"model: the param's name."},"value":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Value","description":"static: the fixed text."},"fallback":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Fallback","description":"Used when a contact value is empty."}},"additionalProperties":false,"type":"object","required":["source"],"title":"TemplateVariable","description":"Where one template variable's value comes from."},"TextAssertion":{"properties":{"type":{"type":"string","const":"text","title":"Type","default":"text"},"criteria":{"type":"string","title":"Criteria","description":"The criteria to evaluate (e.g., 'El asistente menciona su nombre')"},"category":{"anyOf":[{"type":"string","enum":["content","restriction","knows"]},{"type":"null"}],"title":"Category","description":"Optional judge category with specialized semantics: 'content' (the output must say/do X — passed carries the satisfying quote), 'restriction' (the output must NOT say/do X — negation/refusal exempt, failed carries the offending quote), or 'knows' (the assistant must possess a datum by the end, obtained actively or passively — evidence from any turn, fails only if the datum never appears). Omit for the generic judge. When set, ``criteria`` holds the predicate in the infinitive (e.g. 'mencionar el plazo', 'usar emojis', 'el número de operación'), rendered as 'El asistente debe / no debe / debe conocer {criteria}' in the UI. Legacy 'required'/'prohibited' normalize to 'content'/'restriction'."}},"type":"object","required":["criteria"],"title":"TextAssertion","description":"Free-form criteria evaluated by an LLM judge over the assistant text.\n\nThis is the original assertion shape. Default ``type`` keeps legacy rows\ndeserializable.\n\n``category`` opts the criterion into a specialized judge with tighter,\npre-agreed semantics (see ``_CATEGORY_JUDGES`` in app/evals/evaluator.py).\nTwo axes: what the assistant OUTPUTS vs what it KNOWS.\n\n- ``content``      — the assistant's output must SAY/DO X (informative or\n  action). Paraphrase counts; a passed verdict carries the satisfying\n  quote from an assistant message. UI: \"El asistente debe {criteria}\".\n- ``restriction``  — the assistant's output must NOT say/do X. Only an\n  actual affirmation violates it (negating/refusing X is fine; internal\n  [actions:] never count); a failed verdict carries the offending quote.\n  UI: \"El asistente no debe {criteria}\".\n- ``knows``        — the assistant must POSSESS a datum by the end,\n  obtained actively (asked) OR passively (the user volunteered it,\n  even in reply to a different question). Evidence may come from ANY\n  turn; it fails only if the datum never appears (the assistant acted\n  without it). UI: \"El asistente debe conocer {criteria}\".\n\n``None`` keeps the generic judge prompt (legacy behavior). Legacy values\n``required``/``prohibited`` normalize to ``content``/``restriction``."},"TextKnowledgeBaseCreate":{"properties":{"title":{"type":"string","title":"Title","description":"Title of the knowledge base"},"instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instructions","description":"Optional markdown-formatted instructions for LLM when using this KB"},"metadata_fields":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Metadata Fields","description":"Optional list of additional metadata field names to extract from retrieved chunks"},"content":{"type":"string","title":"Content","description":"Raw text content for RAG"},"kb_type":{"$ref":"#/components/schemas/KnowledgeBaseType","description":"Knowledge base type (always TEXT)","default":"text"}},"type":"object","required":["title","content"],"title":"TextKnowledgeBaseCreate","description":"Model for creating a TEXT knowledge base."},"TimeBucket":{"properties":{"playbook_cost_usd":{"type":"number","title":"Playbook Cost Usd","description":"Playbook-agent LLM cost (ChatMessage.cost_usd sum)","default":0.0},"postprocessing_cost_usd":{"type":"number","title":"Postprocessing Cost Usd","description":"Conversation-metrics / scoring LLM cost (ConversationMetrics.cost_usd sum)","default":0.0},"eval_cost_usd":{"type":"number","title":"Eval Cost Usd","description":"Eval-only overhead cost (EvalRun.eval_overhead_cost_usd sum) — simulator + LLM-judge OpenRouter spend. Populated for account-level and per-playbook rows; 0 on dimensions where eval cost is not well-defined (tags, models, individual conversations).","default":0.0},"total_cost_usd":{"type":"number","title":"Total Cost Usd","description":"playbook_cost_usd + postprocessing_cost_usd + eval_cost_usd","default":0.0},"timestamp":{"type":"string","title":"Timestamp"},"total_input_tokens":{"type":"integer","title":"Total Input Tokens"},"total_output_tokens":{"type":"integer","title":"Total Output Tokens"},"total_messages":{"type":"integer","title":"Total Messages"},"total_conversations":{"type":"integer","title":"Total Conversations"},"total_llm_requests":{"type":"integer","title":"Total Llm Requests"}},"type":"object","required":["timestamp","total_input_tokens","total_output_tokens","total_messages","total_conversations","total_llm_requests"],"title":"TimeBucket"},"TimeSlot":{"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","title":"Start","description":"Start time in HH:MM format (24-hour)"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","title":"End","description":"End time in HH:MM format (24-hour)"}},"type":"object","required":["start","end"],"title":"TimeSlot","description":"A single time slot representing a period of availability."},"ToolActionAssistantParam":{"properties":{"key":{"type":"string","title":"Key","description":"Input key in the tool's schema"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Human-readable label"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"What the assistant fills in"}},"type":"object","required":["key"],"title":"ToolActionAssistantParam","description":"An input the assistant always fills at runtime — part of the action, never configurable."},"ToolActionParamField":{"properties":{"key":{"type":"string","title":"Key","description":"Field key"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Human-readable label"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"Field type, e.g. text / select"},"required":{"type":"boolean","title":"Required","description":"Whether the field is required to configure","default":false},"llm_decideable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Llm Decideable","description":"Whether the field can be left for the assistant to fill at runtime"},"metadata_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata Source","description":"Metadata source to fetch dynamic options/children, if any"},"options_depend_on":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Options Depend On","description":"Key of a sibling field that scopes this field's options: fetch the metadata source passing that field's value as a query param ({<key>: <value>})"},"dynamic_children":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Dynamic Children","description":"Descriptor for child fields resolved from a parent value"},"options":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Options","description":"Static select options, if any"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Operator-facing hint for the field"},"literal_only":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Literal Only","description":"Text fields only: value is always a fixed literal (no context templates)"},"default_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Mode","description":"Initial mode in the config UI when unset: agent / specify / empty"},"hintable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hintable","description":"Static params only: 'assistant decides' supports an operator hint (__param_hints__ meta)"},"access_check":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Access Check","description":"Descriptor for a connectivity pre-check the config UI must pass before using this field's value (e.g. Google Sheets service-account access): {'metadata_source': <metadata type>}"},"identity":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Identity","description":"The value decides whose data the action reads or changes (e.g. the owner of a booking). Take it from the context: left to the assistant, the end user can impersonate someone else."}},"type":"object","required":["key"],"title":"ToolActionParamField","description":"A single configurable field of a tool action (from the toolkit's TOOL_PARAMS descriptor)."},"ToolActionSchema":{"properties":{"tool_slug":{"type":"string","title":"Tool Slug","description":"Tool action slug, e.g. INTERCOM_TICKETS_CREATE_TICKET"},"params":{"items":{"$ref":"#/components/schemas/ToolActionParamField"},"type":"array","title":"Params","description":"Configurable fields for this action"},"assistant_params":{"items":{"$ref":"#/components/schemas/ToolActionAssistantParam"},"type":"array","title":"Assistant Params","description":"Inputs the assistant always fills at runtime (not configurable), e.g. a booking's chosen slot."},"metadata_sources":{"items":{"type":"string"},"type":"array","title":"Metadata Sources","description":"Metadata types this toolkit exposes (fetch via the metadata endpoint) to populate options."},"side_effects":{"type":"boolean","title":"Side Effects","description":"True when running the action changes something in the service (sends, creates, closes, edits). False only for actions the toolkit declares read-only.","default":true}},"type":"object","required":["tool_slug"],"title":"ToolActionSchema","description":"The configurable schema of a single tool action within a toolkit."},"ToolCall":{"properties":{"id":{"type":"string","title":"Id","description":"Unique identifier for this tool call"},"name":{"type":"string","title":"Name","description":"Name of the tool/function called"},"arguments":{"type":"string","title":"Arguments","description":"JSON string of arguments passed to the tool"},"result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result","description":"Result returned by the tool (if available)"},"tool_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Type","description":"Type of tool: 'kb_search', 'list_agents', 'list_teams', 'list_kbs', or 'custom'"},"enhanced_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Enhanced Params","description":"Enhanced parameters for display (e.g., KB names instead of IDs)"},"is_mocked":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Mocked","description":"Whether this call used a QA/eval mock. Null means this legacy response did not record mock provenance."}},"type":"object","required":["id","name","arguments"],"title":"ToolCall","description":"A tool/function call made by the assistant."},"ToolCallSequenceAssertion":{"properties":{"type":{"type":"string","const":"tool_call_sequence","title":"Type","default":"tool_call_sequence"},"names":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Names","description":"Ordered tool names"},"strict":{"type":"boolean","title":"Strict","description":"If True, names must be contiguous in the trace","default":false}},"type":"object","required":["names"],"title":"ToolCallSequenceAssertion","description":"Assert that tool calls happened in the given order.\n\nWith ``strict=True`` the named tools must appear contiguously and in the\nexact order. With ``strict=False`` (default) the names must appear in\norder but other tool calls may interleave."},"ToolCallTrace":{"properties":{"tool_call_id":{"type":"string","title":"Tool Call Id","description":"Unique identifier for this tool call"},"tool_name":{"type":"string","title":"Tool Name","description":"Name of the tool that was invoked"},"arguments":{"additionalProperties":true,"type":"object","title":"Arguments","description":"Arguments passed to the tool"},"result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result","description":"Tool result as string (full, no truncation)"},"success":{"type":"boolean","title":"Success","description":"Whether the tool call succeeded","default":false},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms","description":"Execution time in milliseconds"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if the call failed"},"is_mocked":{"type":"boolean","title":"Is Mocked","description":"True if the result came from an eval-time tool mock","default":false}},"additionalProperties":false,"type":"object","required":["tool_call_id","tool_name"],"title":"ToolCallTrace","description":"Serializable trace of a single tool call captured during agent execution.\n\nMirrors the internal ToolCallInfo dataclass (app/agent/pydantic_agent.py)\nbut as a Pydantic model so it can round-trip through JSON storage and the\neval result API without truncation."},"ToolCalledAssertion":{"properties":{"type":{"type":"string","const":"tool_called","title":"Type","default":"tool_called"},"name":{"type":"string","title":"Name","description":"Tool name that must be invoked"},"args_match":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Args Match","description":"Optional subset-match against the recorded arguments dict"},"min_count":{"type":"integer","minimum":1.0,"title":"Min Count","description":"Minimum number of matching invocations","default":1}},"type":"object","required":["name"],"title":"ToolCalledAssertion","description":"Assert that a named tool was invoked at least ``min_count`` times.\n\n``args_match`` does a subset match against the recorded ``arguments`` dict\n(every key/value in ``args_match`` must be present in the call)."},"ToolConfigAttribute":{"properties":{"key":{"type":"string","title":"Key","description":"Attribute key (normalized)"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","description":"Human-readable label"},"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type","description":"Attribute/value type"},"required":{"type":"boolean","title":"Required","description":"Whether the target service requires this attribute","default":false},"mode":{"type":"string","title":"Mode","description":"How it is configured: 'assistant_decides' | 'preconfigured' | 'empty'"},"value":{"anyOf":[{},{"type":"null"}],"title":"Value","description":"Pre-configured value, when mode == 'preconfigured'"},"options":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Options","description":"Valid options, when applicable"},"condition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Condition","description":"Conditional dependency ({parent_key, value}) if the attribute is conditional"},"problem":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Problem","description":"Set when the attribute is misconfigured (e.g. required but left empty), else null."}},"type":"object","required":["key","mode"],"title":"ToolConfigAttribute","description":"Effective, per-attribute view of how a tool configuration is set up."},"ToolConfigAuditEntry":{"properties":{"id":{"type":"string","title":"Id","description":"Configuration UUID"},"short_name":{"type":"string","title":"Short Name","description":"LLM-friendly short name"},"display_name":{"type":"string","title":"Display Name","description":"Human-readable display name"},"tool_slug":{"type":"string","title":"Tool Slug","description":"Tool action slug"},"toolkit_slug":{"type":"string","title":"Toolkit Slug","description":"Toolkit slug"},"in_use":{"type":"boolean","title":"In Use","description":"Whether the config is referenced in active/latest instructions"},"issues":{"items":{"type":"string"},"type":"array","title":"Issues","description":"Configuration problems detected"}},"type":"object","required":["id","short_name","display_name","tool_slug","toolkit_slug","in_use"],"title":"ToolConfigAuditEntry","description":"One misconfigured tool configuration surfaced by the audit endpoint."},"ToolConfigAuditResponse":{"properties":{"total_configs":{"type":"integer","title":"Total Configs","description":"Total tool configurations scanned"},"misconfigured":{"items":{"$ref":"#/components/schemas/ToolConfigAuditEntry"},"type":"array","title":"Misconfigured","description":"Configs with detected problems (most relevant: in-use first)"},"skipped":{"items":{"type":"string"},"type":"array","title":"Skipped","description":"Config IDs skipped because live metadata was unavailable"}},"type":"object","required":["total_configs"],"title":"ToolConfigAuditResponse","description":"Result of auditing every tool configuration in a project."},"ToolConfigEffectiveSchema":{"properties":{"id":{"type":"string","title":"Id","description":"Configuration UUID"},"short_name":{"type":"string","title":"Short Name","description":"LLM-friendly short name"},"tool_slug":{"type":"string","title":"Tool Slug","description":"Tool action slug"},"toolkit_slug":{"type":"string","title":"Toolkit Slug","description":"Toolkit slug"},"attributes":{"items":{"$ref":"#/components/schemas/ToolConfigAttribute"},"type":"array","title":"Attributes","description":"Per-attribute effective view"},"issues":{"items":{"type":"string"},"type":"array","title":"Issues","description":"Human-readable configuration problems detected for this config"},"metadata_available":{"type":"boolean","title":"Metadata Available","description":"False when live service metadata could not be fetched (issues may be incomplete).","default":true}},"type":"object","required":["id","short_name","tool_slug","toolkit_slug"],"title":"ToolConfigEffectiveSchema","description":"Resolved schema for one tool configuration: config merged with live service metadata."},"ToolConfigurationCreateRequest":{"properties":{"tool_slug":{"type":"string","title":"Tool Slug","description":"Tool slug, e.g. INTERCOM_TICKETS_CREATE_TICKET"},"toolkit_connection_id":{"type":"string","title":"Toolkit Connection Id","description":"ID of the toolkit connection this config belongs to"},"display_name":{"type":"string","title":"Display Name","description":"Human-readable display name, e.g. Create Ticket"},"config":{"additionalProperties":true,"type":"object","title":"Config","description":"Configuration JSON with params and optional dynamic_schema"}},"type":"object","required":["tool_slug","toolkit_connection_id","display_name","config"],"title":"ToolConfigurationCreateRequest","description":"Request to create a tool configuration."},"ToolConfigurationResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Configuration UUID"},"short_name":{"type":"string","title":"Short Name","description":"LLM-friendly short name, e.g. create_ticket_a1b2c"},"display_name":{"type":"string","title":"Display Name","description":"Human-readable display name"},"tool_slug":{"type":"string","title":"Tool Slug","description":"Tool slug"},"toolkit_connection_id":{"type":"string","title":"Toolkit Connection Id","description":"ID of the toolkit connection"},"toolkit_slug":{"type":"string","title":"Toolkit Slug","description":"Toolkit slug (derived from the connection)"},"config":{"additionalProperties":true,"type":"object","title":"Config","description":"Configuration JSON"},"in_use":{"type":"boolean","title":"In Use","description":"True when this config's short_name macro is referenced in the active or latest version of any playbook (instructions or skills) in the project. In-use configs require human approval to update or delete.","default":false},"usages":{"items":{"$ref":"#/components/schemas/ToolConfigurationUsage"},"type":"array","title":"Usages","description":"Every place the macro is referenced (empty when not in use)."}},"type":"object","required":["id","short_name","display_name","tool_slug","toolkit_connection_id","toolkit_slug","config"],"title":"ToolConfigurationResponse","description":"Response representing a tool configuration."},"ToolConfigurationUpdateRequest":{"properties":{"config":{"additionalProperties":true,"type":"object","title":"Config","description":"Updated configuration JSON"}},"type":"object","required":["config"],"title":"ToolConfigurationUpdateRequest","description":"Request to update a tool configuration."},"ToolConfigurationUsage":{"properties":{"playbook_base_id":{"type":"string","title":"Playbook Base Id","description":"Base ID of the playbook referencing the macro"},"playbook_name":{"type":"string","title":"Playbook Name","description":"Human-readable playbook name"},"location":{"type":"string","title":"Location","description":"Where the macro appears: 'instructions' or 'skill:<name>'"},"version":{"type":"string","title":"Version","description":"Which version references it: 'active' and/or 'latest'"}},"type":"object","required":["playbook_base_id","playbook_name","location","version"],"title":"ToolConfigurationUsage","description":"Where a tool-configuration macro ({{ custom_tool: short_name }}) is referenced."},"ToolMockMatchKind":{"type":"string","enum":["any","call_ordinal","args_match"],"title":"ToolMockMatchKind"},"ToolMockSpec":{"properties":{"match_kind":{"$ref":"#/components/schemas/ToolMockMatchKind","description":"Match condition type. ``any`` fires on every call.","default":"any"},"call_ordinal":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Call Ordinal","description":"Required when match_kind=call_ordinal. 1-indexed."},"match_args":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Match Args","description":"Required when match_kind=args_match. Subset filter; missing key = wildcard."},"return_value":{"anyOf":[{},{"type":"null"}],"title":"Return Value","description":"Literal return value for matching calls"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message; raised as RuntimeError"}},"type":"object","title":"ToolMockSpec","description":"One mock rule for one (tool, match) pair.\n\nEach rule sets exactly one match condition (``match_kind``) and exactly\none payload (``return_value`` xor ``error``). Rows live in a per-tool\nordered list; the runner walks top-to-bottom and the first match wins."},"ToolNotCalledAssertion":{"properties":{"type":{"type":"string","const":"tool_not_called","title":"Type","default":"tool_not_called"},"name":{"type":"string","title":"Name","description":"Tool name that must not appear in the trace"},"args_match":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Args Match","description":"Optional subset-match against the recorded arguments dict; when set, only matching calls cause the assertion to fail."}},"type":"object","required":["name"],"title":"ToolNotCalledAssertion","description":"Assert that a named tool was NEVER invoked during the conversation.\n\nWith ``args_match`` set, the assertion is narrowed to \"must never be\ncalled WITH those arguments\" — same subset semantics as\n:class:`ToolCalledAssertion`. Calls that don't match the arg shape are\nignored. Useful for \"the agent must not call ``send_email`` with\n``to=customer@…``\" style negative tests."},"ToolParameter":{"properties":{"name":{"type":"string","title":"Name","description":"Parameter name (extracted from URL template)"},"description":{"type":"string","title":"Description","description":"What this parameter represents"}},"type":"object","required":["name","description"],"title":"ToolParameter","description":"Parameter definition for an API tool."},"ToolSequenceOpcode":{"properties":{"op":{"type":"string","enum":["equal","insert","delete","replace"],"title":"Op"},"a_names":{"items":{"type":"string"},"type":"array","title":"A Names"},"b_names":{"items":{"type":"string"},"type":"array","title":"B Names"}},"type":"object","required":["op"],"title":"ToolSequenceOpcode","description":"One ``difflib.SequenceMatcher.get_opcodes()`` segment of the\nflattened tool-name sequence per case (across all assistant turns)."},"ToolkitActionTestRequest":{"properties":{"config_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Config Id","description":"Tool configuration (pill) to run."},"short_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Name","description":"The pill's short_name, as in {{ custom_tool: ... }}."},"tool_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Slug","description":"A bare action (e.g. CLOUDBEDS_CHECK_AVAILABILITY), run with no pinned params."},"arguments":{"additionalProperties":true,"type":"object","title":"Arguments","description":"What the model would send."},"params":{"additionalProperties":true,"type":"object","title":"Params","description":"Overrides of the pinned params, same shape as config.params. A value replaces the pinned one for this run only; null unpins it, so the model (`arguments`) can fill it."},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id","description":"The conversation the run pretends to be in (what context-bound actions act on)."},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context","description":"The request context: what {{deps.*}} templates and context lookups resolve against."},"external_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External User Id","description":"The identified person of the conversation."},"attachments":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Attachments","description":"This turn's attachments ({type, url|data, media_type, filename})."}},"type":"object","title":"ToolkitActionTestRequest","description":"Run one toolkit action outside a conversation, with every input the caller's to set.\n\nName exactly one of ``config_id``, ``short_name`` (a configured pill) or\n``tool_slug`` (the bare action, nothing pinned)."},"ToolkitActionsResponse":{"properties":{"toolkit_slug":{"type":"string","title":"Toolkit Slug","description":"Toolkit identifier"},"is_connected":{"type":"boolean","title":"Is Connected","description":"True when connected — actions are only usable once this is true."},"connected_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected Account Id","description":"Active connection ID, or null."},"actions":{"items":{"$ref":"#/components/schemas/ToolActionSchema"},"type":"array","title":"Actions","description":"Configurable actions."}},"type":"object","required":["toolkit_slug","is_connected"],"title":"ToolkitActionsResponse","description":"A toolkit's actions plus whether the project is connected to it."},"ToolkitAnalyticsResponse":{"properties":{"total_calls":{"type":"integer","title":"Total Calls"},"successful_calls":{"type":"integer","title":"Successful Calls"},"failed_calls":{"type":"integer","title":"Failed Calls"},"avg_duration_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Duration Ms"},"by_action":{"items":{"$ref":"#/components/schemas/ToolkitByAction"},"type":"array","title":"By Action"},"by_param":{"items":{"$ref":"#/components/schemas/ToolkitParamValue"},"type":"array","title":"By Param"},"time_series":{"items":{"$ref":"#/components/schemas/ToolkitTimeSeriesPoint"},"type":"array","title":"Time Series"},"recent":{"items":{"$ref":"#/components/schemas/ToolkitRecentItem"},"type":"array","title":"Recent"}},"type":"object","required":["total_calls","successful_calls","failed_calls"],"title":"ToolkitAnalyticsResponse"},"ToolkitByAction":{"properties":{"action_name":{"type":"string","title":"Action Name"},"count":{"type":"integer","title":"Count"},"success_count":{"type":"integer","title":"Success Count"}},"type":"object","required":["action_name","count","success_count"],"title":"ToolkitByAction"},"ToolkitParamValue":{"properties":{"value":{"type":"string","title":"Value"},"count":{"type":"integer","title":"Count"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["value","count"],"title":"ToolkitParamValue"},"ToolkitRecentItem":{"properties":{"id":{"type":"string","title":"Id"},"toolkit_slug":{"type":"string","title":"Toolkit Slug"},"action_name":{"type":"string","title":"Action Name"},"input_params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Params"},"output_result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Output Result"},"success":{"type":"boolean","title":"Success"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"}},"type":"object","required":["id","toolkit_slug","action_name","success","created_at"],"title":"ToolkitRecentItem"},"ToolkitTimeSeriesPoint":{"properties":{"date":{"type":"string","title":"Date"},"count":{"type":"integer","title":"Count"},"success_count":{"type":"integer","title":"Success Count"}},"type":"object","required":["date","count","success_count"],"title":"ToolkitTimeSeriesPoint"},"TreePreviewNode-Input":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"children":{"anyOf":[{"items":{"$ref":"#/components/schemas/TreePreviewNode-Input"},"type":"array"},{"type":"null"}],"title":"Children"},"truncated":{"type":"boolean","title":"Truncated","default":false}},"type":"object","required":["name","type"],"title":"TreePreviewNode","description":"A node in the folder tree preview."},"TreePreviewNode-Output":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"children":{"anyOf":[{"items":{"$ref":"#/components/schemas/TreePreviewNode-Output"},"type":"array"},{"type":"null"}],"title":"Children"},"truncated":{"type":"boolean","title":"Truncated","default":false}},"type":"object","required":["name","type"],"title":"TreePreviewNode","description":"A node in the folder tree preview."},"TrendingTopic":{"properties":{"name":{"type":"string","title":"Name","description":"Short topic name (2-4 words)"},"description":{"type":"string","title":"Description","description":"Brief description of what customers are asking about"},"insight":{"type":"string","title":"Insight","description":"Detailed analysis with patterns and recommendations","default":""},"example_question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Example Question","description":"Example user question for this topic"},"conversation_count":{"type":"integer","title":"Conversation Count","description":"Number of conversations in this bucket","default":0},"percentage":{"type":"number","title":"Percentage","description":"Percentage of total conversations","default":0},"sentiment":{"type":"string","title":"Sentiment","description":"Dominant sentiment: positive, neutral, or negative","default":"neutral"},"sentiment_breakdown":{"$ref":"#/components/schemas/SentimentBreakdown","description":"Breakdown of sentiment counts"},"sentiment_percentage":{"type":"number","title":"Sentiment Percentage","description":"Percentage of dominant sentiment","default":0},"handoff_count":{"type":"integer","title":"Handoff Count","description":"Number of conversations with handoff","default":0},"handoff_rate":{"type":"number","title":"Handoff Rate","description":"Percentage of conversations with handoff","default":0},"conversation_ids":{"items":{"type":"string"},"type":"array","title":"Conversation Ids","description":"IDs of conversations in this topic bucket"},"example_conversations":{"items":{"$ref":"#/components/schemas/ExampleConversation"},"type":"array","title":"Example Conversations","description":"Up to 4 example conversations with summaries"}},"type":"object","required":["name","description"],"title":"TrendingTopic","description":"A trending topic identified from conversation summaries with classification stats."},"TrendingTopicsAnalysesListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TrendingTopicsAnalysisInfo"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"TrendingTopicsAnalysesListResponse"},"TrendingTopicsAnalysisInfo":{"properties":{"id":{"type":"string","title":"Id","description":"Analysis UUID"},"analysis_date":{"type":"string","title":"Analysis Date","description":"Date of analysis (YYYY-MM-DD)"},"topics":{"items":{"$ref":"#/components/schemas/TrendingTopic"},"type":"array","title":"Topics","description":"Trending topics"},"total_conversations":{"type":"integer","title":"Total Conversations","description":"Total conversations in the period"},"conversations_analyzed":{"type":"integer","title":"Conversations Analyzed","description":"Conversations with summaries that were analyzed"},"created_at":{"type":"string","title":"Created At","description":"When the analysis was created (ISO format)"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date","description":"Start of analysis window (ISO format)"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date","description":"End of analysis window (ISO format)"},"time_window_days":{"type":"integer","title":"Time Window Days","description":"Time window in days","default":7},"playbook_base_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Playbook Base Ids","description":"Playbook base IDs used for filtering"}},"type":"object","required":["id","analysis_date","total_conversations","conversations_analyzed","created_at"],"title":"TrendingTopicsAnalysisInfo","description":"Completed analysis information."},"TrendingTopicsGenerateRequest":{"properties":{"playbook_base_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Playbook Base Ids","description":"Filter by playbook base IDs"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Filter by tags"},"time_window_days":{"anyOf":[{"type":"integer","maximum":90.0,"minimum":1.0},{"type":"null"}],"title":"Time Window Days","description":"Time window in days (default 7)"}},"type":"object","title":"TrendingTopicsGenerateRequest","description":"Request body for generating trending topics analysis."},"TrendingTopicsGenerateResponse":{"properties":{"job_id":{"type":"string","title":"Job Id","description":"Job UUID to poll for progress"},"status":{"type":"string","title":"Status","description":"Job status (pending)"}},"type":"object","required":["job_id","status"],"title":"TrendingTopicsGenerateResponse","description":"Response for generate endpoint."},"TrendingTopicsJobInfo":{"properties":{"id":{"type":"string","title":"Id","description":"Job UUID"},"progress":{"type":"integer","title":"Progress","description":"Progress percentage (0-100)"},"step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Step","description":"Current step: fetching_data, identifying_topics, classifying, etc."},"progress_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Progress Message","description":"Human-readable progress message"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At","description":"When the job started (ISO format)"}},"type":"object","required":["id","progress"],"title":"TrendingTopicsJobInfo","description":"Running job information for status polling."},"TrendingTopicsJobStatusResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Job UUID"},"status":{"type":"string","title":"Status","description":"Job status: pending, running, completed, failed"},"progress":{"type":"integer","title":"Progress","description":"Progress percentage (0-100)"},"step":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Step","description":"Current processing step"},"progress_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Progress Message","description":"Human-readable progress message"},"analysis_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Analysis Id","description":"Completed analysis ID (if status=completed)"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Error message (if status=failed)"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At","description":"Job start time (ISO format)"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At","description":"Job completion time (ISO format)"}},"type":"object","required":["id","status","progress"],"title":"TrendingTopicsJobStatusResponse","description":"Response for job status polling endpoint."},"TrendingTopicsResponse":{"properties":{"topics":{"items":{"$ref":"#/components/schemas/TrendingTopic"},"type":"array","title":"Topics","description":"Up to 5 trending topics from conversations"},"total_conversations":{"type":"integer","title":"Total Conversations","description":"Total conversations analyzed"},"start_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date","description":"Start date of analysis period (ISO format)"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date","description":"End date of analysis period (ISO format)"}},"type":"object","required":["total_conversations"],"title":"TrendingTopicsResponse","description":"Trending topics analysis for a project."},"TrendingTopicsStatusResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Status: completed, running, pending, failed, or not_found"},"can_regenerate":{"type":"boolean","title":"Can Regenerate","description":"Whether regeneration is allowed (false if completed today)","default":true},"analysis":{"anyOf":[{"$ref":"#/components/schemas/TrendingTopicsAnalysisInfo"},{"type":"null"}],"description":"Completed analysis (if status=completed)"},"job":{"anyOf":[{"$ref":"#/components/schemas/TrendingTopicsJobInfo"},{"type":"null"}],"description":"Running job info (if status=running/pending)"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Error message (if status=failed)"}},"type":"object","required":["status"],"title":"TrendingTopicsStatusResponse","description":"Response for trending topics status check endpoint.\n\nReturns one of three states:\n- status=\"completed\": analysis exists (analysis field populated)\n- status=\"running\" or \"pending\": job in progress (job field populated)\n- status=\"not_found\": no analysis or job exists"},"TriggerRunRequest":{"properties":{"time_window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Time Window Days"}},"type":"object","title":"TriggerRunRequest","description":"Optional body for manual run triggers."},"TriggeredToolEntry":{"properties":{"tool_id":{"type":"string","title":"Tool Id"},"tool_name":{"type":"string","title":"Tool Name"},"error_count":{"type":"integer","title":"Error Count"},"threshold":{"type":"integer","title":"Threshold"},"window_minutes":{"type":"integer","title":"Window Minutes"},"source":{"type":"string","enum":["override","default"],"title":"Source"}},"type":"object","required":["tool_id","tool_name","error_count","threshold","window_minutes","source"],"title":"TriggeredToolEntry"},"TwoFactorDisableRequest":{"properties":{"password":{"type":"string","minLength":1,"title":"Password","description":"Current password"},"totp_code":{"type":"string","maxLength":10,"minLength":6,"title":"Totp Code","description":"6-digit TOTP code"}},"type":"object","required":["password","totp_code"],"title":"TwoFactorDisableRequest","description":"POST /auth/2fa/disable request body — requires BOTH factors."},"TwoFactorSetupRequest":{"properties":{"password":{"type":"string","minLength":1,"title":"Password","description":"Current password"}},"type":"object","required":["password"],"title":"TwoFactorSetupRequest","description":"POST /auth/2fa/setup request body — password re-check before issuing a secret."},"TwoFactorSetupResponse":{"properties":{"secret_b32":{"type":"string","title":"Secret B32","description":"Base32 secret (manual-entry fallback)"},"otpauth_uri":{"type":"string","title":"Otpauth Uri","description":"otpauth:// URI to render as a QR code"}},"type":"object","required":["secret_b32","otpauth_uri"],"title":"TwoFactorSetupResponse","description":"POST /auth/2fa/setup response — everything the FE needs to render the QR."},"TwoFactorStatusResponse":{"properties":{"supported":{"type":"boolean","title":"Supported","description":"False for non-standalone sessions (kaption/embedded)"},"enabled":{"type":"boolean","title":"Enabled","description":"2FA is enrolled and required at login"},"pending":{"type":"boolean","title":"Pending","description":"Setup started (secret issued) but not yet verified"}},"type":"object","required":["supported","enabled","pending"],"title":"TwoFactorStatusResponse","description":"GET /auth/2fa response."},"TwoFactorVerifyRequest":{"properties":{"totp_code":{"type":"string","maxLength":10,"minLength":6,"title":"Totp Code","description":"6-digit TOTP code"}},"type":"object","required":["totp_code"],"title":"TwoFactorVerifyRequest","description":"POST /auth/2fa/verify request body."},"UpdateCreditRequest":{"properties":{"amount_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount Usd","description":"New amount (USD), non-zero. Omit to keep unchanged."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note","description":"New note. Omit to keep unchanged; pass null to clear."}},"type":"object","title":"UpdateCreditRequest"},"UpdateItemSelectionRequest":{"properties":{"item_ids":{"items":{"type":"string"},"type":"array","title":"Item Ids","description":"List of item IDs to update"},"is_selected":{"type":"boolean","title":"Is Selected","description":"New selection state for the items"}},"type":"object","required":["item_ids","is_selected"],"title":"UpdateItemSelectionRequest","description":"Request model for updating item selection."},"UpdateOperatorRequest":{"properties":{"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"password":{"anyOf":[{"type":"string","minLength":12},{"type":"null"}],"title":"Password"},"account_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Account Ids","description":"Replaces the whole set when present. Omit to leave the assignment alone."}},"type":"object","title":"UpdateOperatorRequest"},"UpdateSettingsRequest":{"properties":{"personality_tone":{"anyOf":[{"$ref":"#/components/schemas/PersonalityToneEnum"},{"type":"null"}],"description":"Default personality tone"}},"type":"object","title":"UpdateSettingsRequest","description":"Request to update project settings."},"UrlShortener":{"properties":{"name":{"type":"string","title":"Name","description":"User-friendly name for this shortener"},"url":{"type":"string","title":"Url","description":"API endpoint URL for shortening service"},"method":{"type":"string","title":"Method","description":"HTTP method: GET or POST"},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers","description":"Authentication headers"},"request_body_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Body Template","description":"JSON template with {{ url }} placeholder for POST requests"},"response_url_path":{"type":"string","title":"Response Url Path","description":"JSONPath to extract shortened URL from response (e.g., 'data.short_url')"},"timeout_ms":{"type":"integer","maximum":30000.0,"minimum":1000.0,"title":"Timeout Ms","description":"Request timeout in milliseconds","default":5000},"enabled":{"type":"boolean","title":"Enabled","description":"Whether this shortener is active","default":true},"id":{"type":"string","title":"Id","description":"Unique shortener ID"},"project_id":{"type":"string","title":"Project Id","description":"Project ID this shortener belongs to"},"is_deleted":{"type":"boolean","title":"Is Deleted","description":"Whether this shortener is soft-deleted","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When this shortener was created"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When this shortener was last updated"}},"type":"object","required":["name","url","method","response_url_path","id","project_id","created_at","updated_at"],"title":"UrlShortener","description":"Full URL shortener model with all fields."},"UrlShortenerCreate":{"properties":{"name":{"type":"string","title":"Name","description":"User-friendly name for this shortener"},"url":{"type":"string","title":"Url","description":"API endpoint URL for shortening service"},"method":{"type":"string","title":"Method","description":"HTTP method: GET or POST"},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers","description":"Authentication headers"},"request_body_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Body Template","description":"JSON template with {{ url }} placeholder for POST requests"},"response_url_path":{"type":"string","title":"Response Url Path","description":"JSONPath to extract shortened URL from response (e.g., 'data.short_url')"},"timeout_ms":{"type":"integer","maximum":30000.0,"minimum":1000.0,"title":"Timeout Ms","description":"Request timeout in milliseconds","default":5000},"enabled":{"type":"boolean","title":"Enabled","description":"Whether this shortener is active","default":true}},"type":"object","required":["name","url","method","response_url_path"],"title":"UrlShortenerCreate","description":"Model for creating a new URL shortener."},"UrlShortenerEffective":{"properties":{"configured":{"type":"boolean","title":"Configured","description":"Whether an enabled shortener (custom or native) is available"},"is_native":{"type":"boolean","title":"Is Native","description":"Whether the effective shortener is the Studio Chat native default"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Display name of the effective shortener, if any"}},"type":"object","required":["configured","is_native"],"title":"UrlShortenerEffective","description":"The shortener effectively in use for a project (custom row or native default).\n\nUsed by the UI to decide whether URL shortening can be enabled, without exposing any\nauth headers/secrets. ``is_native`` means the built-in Studio Chat (stdcht.io) default."},"UrlShortenerTestConfigRequest":{"properties":{"test_url":{"type":"string","title":"Test Url","description":"URL to shorten for testing"},"url":{"type":"string","title":"Url","description":"API endpoint URL"},"method":{"type":"string","enum":["GET","POST"],"title":"Method","description":"HTTP method"},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers","description":"Request headers"},"request_body_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Body Template","description":"Request body template (POST only)"},"response_url_path":{"type":"string","title":"Response Url Path","description":"JSONPath to extract shortened URL from response"},"timeout_ms":{"type":"integer","maximum":30000.0,"minimum":1000.0,"title":"Timeout Ms","description":"Request timeout in milliseconds","default":5000}},"type":"object","required":["test_url","url","method","response_url_path"],"title":"UrlShortenerTestConfigRequest","description":"Request for testing URL shortener with inline configuration (no saved shortener needed)."},"UrlShortenerTestRequest":{"properties":{"test_url":{"type":"string","title":"Test Url","description":"URL to shorten for testing"}},"type":"object","required":["test_url"],"title":"UrlShortenerTestRequest","description":"Request for testing URL shortener configuration."},"UrlShortenerTestResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the test succeeded"},"original_url":{"type":"string","title":"Original Url","description":"The original URL that was shortened"},"shortened_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shortened Url","description":"The shortened URL (if successful)"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message (if failed)"},"response_time_ms":{"type":"integer","title":"Response Time Ms","description":"Response time in milliseconds"},"raw_response":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Raw Response","description":"Raw API response for debugging"}},"type":"object","required":["success","original_url","response_time_ms"],"title":"UrlShortenerTestResponse","description":"Response from URL shortener test."},"UrlShortenerUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Updated name"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","description":"Updated API endpoint URL"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method","description":"Updated HTTP method"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Headers","description":"Updated headers"},"request_body_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Body Template","description":"Updated request body template"},"response_url_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Url Path","description":"Updated response URL path"},"timeout_ms":{"anyOf":[{"type":"integer","maximum":30000.0,"minimum":1000.0},{"type":"null"}],"title":"Timeout Ms","description":"Updated timeout"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","description":"Updated enabled status"}},"type":"object","title":"UrlShortenerUpdate","description":"Model for updating a URL shortener."},"UserActivityResponse":{"properties":{"username":{"type":"string","title":"Username","description":"Login name; for an invited user, their email"},"is_admin":{"type":"boolean","title":"Is Admin"},"is_active":{"type":"boolean","title":"Is Active"},"is_studiochat_operator":{"type":"boolean","title":"Is Studiochat Operator","description":"Our own seat in the account (a StudioChat operator's email), not the customer"},"created_at":{"type":"string","title":"Created At","description":"ISO 8601, UTC"},"last_login":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Login","description":"Last password sign-in, ISO 8601 UTC. Null = never signed in"},"last_seen_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Seen At","description":"Last request with their own session, ISO 8601 UTC, accurate to ~5 min. Null = not seen since tracking started (2026-10)"}},"type":"object","required":["username","is_admin","is_active","is_studiochat_operator","created_at"],"title":"UserActivityResponse"},"UserCreateRequest":{"properties":{"username":{"type":"string","format":"email","title":"Username","description":"Email address (unique within account)"},"is_admin":{"type":"boolean","title":"Is Admin","description":"Whether user is admin","default":false}},"type":"object","required":["username"],"title":"UserCreateRequest","description":"Request body for creating a new user."},"UserCreateResponse":{"properties":{"user":{"$ref":"#/components/schemas/app__routers__users__UserResponse"},"temporary_password":{"type":"string","title":"Temporary Password","description":"Temporary password (shown only once)"}},"type":"object","required":["user","temporary_password"],"title":"UserCreateResponse","description":"Response for user creation (includes temporary password)."},"UserRef":{"properties":{"id":{"type":"string","title":"Id","description":"The caller's stable identifier for this user (their contact id, account id, …).","examples":["6543f2a1b9c"]}},"type":"object","required":["id"],"title":"UserRef","description":"Who the human on the other side is, as the calling channel knows them.\n\nObject form of ``PlaybookChatRequest.user``. Carries only the id today —\nthe object exists so identity can grow later (display name, an anonymous id\nto upgrade from) without turning the string form into a breaking change."},"UserUpdateRequest":{"properties":{"is_admin":{"type":"boolean","title":"Is Admin","description":"Whether user should be admin"}},"type":"object","required":["is_admin"],"title":"UserUpdateRequest","description":"Request body for updating a user."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VoiceNumberChangeRequest":{"properties":{"assistant_base_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assistant Base Id"},"friendly_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Friendly Name"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"outbound_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Outbound Enabled"},"demo_mode":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Demo Mode"}},"type":"object","title":"VoiceNumberChangeRequest"},"VoiceNumberDetail":{"properties":{"id":{"type":"string","title":"Id"},"number":{"type":"string","title":"Number","description":"E.164, e.g. +541148999155"},"friendly_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Friendly Name"},"provider":{"type":"string","title":"Provider","description":"The carrier the number lives on (twilio)"},"enabled":{"type":"boolean","title":"Enabled"},"outbound_enabled":{"type":"boolean","title":"Outbound Enabled","description":"Whether the assistant may place calls from it"},"demo_mode":{"type":"boolean","title":"Demo Mode","description":"A demo line: recorded intro and outro, a one-minute conversation","default":false},"assistant_base_id":{"type":"string","title":"Assistant Base Id"},"assistant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assistant Name","description":"The assistant that answers it; null when it is gone"},"stats":{"additionalProperties":true,"type":"object","title":"Stats","description":"days, calls, inbound, outbound, answered, avg_duration_seconds, last_call_at"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"voice_enabled":{"type":"boolean","title":"Voice Enabled"},"recent_calls":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Recent Calls","description":"The last calls, newest first"}},"type":"object","required":["id","number","provider","enabled","outbound_enabled","assistant_base_id","stats","voice_enabled"],"title":"VoiceNumberDetail","description":"One number for its page: the row, the account's flag, and its last calls."},"VoiceNumberOut":{"properties":{"id":{"type":"string","title":"Id"},"number":{"type":"string","title":"Number","description":"E.164, e.g. +541148999155"},"friendly_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Friendly Name"},"provider":{"type":"string","title":"Provider","description":"The carrier the number lives on (twilio)"},"enabled":{"type":"boolean","title":"Enabled"},"outbound_enabled":{"type":"boolean","title":"Outbound Enabled","description":"Whether the assistant may place calls from it"},"demo_mode":{"type":"boolean","title":"Demo Mode","description":"A demo line: recorded intro and outro, a one-minute conversation","default":false},"assistant_base_id":{"type":"string","title":"Assistant Base Id"},"assistant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assistant Name","description":"The assistant that answers it; null when it is gone"},"stats":{"additionalProperties":true,"type":"object","title":"Stats","description":"days, calls, inbound, outbound, answered, avg_duration_seconds, last_call_at"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","number","provider","enabled","outbound_enabled","assistant_base_id","stats"],"title":"VoiceNumberOut","description":"A phone number as a channel of the account: who answers it, and the last days' calls."},"VoiceNumberPatchRequest":{"properties":{"assistant_base_id":{"type":"string","title":"Assistant Base Id","description":"The assistant that answers the number from now on. Calls in progress keep theirs; a call already placed is answered by the assistant it was placed for."}},"type":"object","required":["assistant_base_id"],"title":"VoiceNumberPatchRequest"},"VoiceNumberRegisterRequest":{"properties":{"number":{"type":"string","title":"Number","description":"The number, E.164 or as dialled (+54 11 4899-9155)"},"assistant_base_id":{"type":"string","title":"Assistant Base Id","description":"The assistant that answers it: a base_id of this account"},"friendly_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Friendly Name","description":"How the account sees it ('Ventas')"},"outbound_enabled":{"type":"boolean","title":"Outbound Enabled","description":"Whether the assistant may place calls from it","default":false},"demo_mode":{"type":"boolean","title":"Demo Mode","description":"A demo line: recorded intro and outro, a one-minute conversation","default":false}},"type":"object","required":["number","assistant_base_id"],"title":"VoiceNumberRegisterRequest","description":"'This Twilio number goes to this assistant of this account.'"},"VoiceNumberRegistered":{"properties":{"id":{"type":"string","title":"Id"},"number":{"type":"string","title":"Number","description":"E.164, e.g. +541148999155"},"friendly_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Friendly Name"},"provider":{"type":"string","title":"Provider","description":"The carrier the number lives on (twilio)"},"enabled":{"type":"boolean","title":"Enabled"},"outbound_enabled":{"type":"boolean","title":"Outbound Enabled","description":"Whether the assistant may place calls from it"},"demo_mode":{"type":"boolean","title":"Demo Mode","description":"A demo line: recorded intro and outro, a one-minute conversation","default":false},"assistant_base_id":{"type":"string","title":"Assistant Base Id"},"assistant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assistant Name","description":"The assistant that answers it; null when it is gone"},"stats":{"additionalProperties":true,"type":"object","title":"Stats","description":"days, calls, inbound, outbound, answered, avg_duration_seconds, last_call_at"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"twilio":{"additionalProperties":true,"type":"object","title":"Twilio","description":"Whether the number's webhooks on Twilio now point at us, or why not"}},"type":"object","required":["id","number","provider","enabled","outbound_enabled","assistant_base_id","stats","twilio"],"title":"VoiceNumberRegistered"},"VoiceNumbersResponse":{"properties":{"numbers":{"items":{"$ref":"#/components/schemas/VoiceNumberOut"},"type":"array","title":"Numbers"},"voice_enabled":{"type":"boolean","title":"Voice Enabled","description":"The account's `voice` flag. Off, a call to any of these numbers hears 'unavailable'."}},"type":"object","required":["numbers","voice_enabled"],"title":"VoiceNumbersResponse"},"VoiceSessionRequest":{"properties":{"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id","description":"Reuse the preview's conversation so the call continues the same chat"}},"type":"object","title":"VoiceSessionRequest"},"VoiceSessionResponse":{"properties":{"ws_path":{"type":"string","title":"Ws Path","description":"The WebSocket to open on this API, with its one-minute ticket"},"conversation_id":{"type":"string","title":"Conversation Id","description":"Studio Chat conversation id the call is stored under"}},"type":"object","required":["ws_path","conversation_id"],"title":"VoiceSessionResponse"},"VoiceToolCallsResponse":{"properties":{"tool_calls":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tool Calls"},"max_index":{"type":"integer","title":"Max Index"}},"type":"object","required":["tool_calls","max_index"],"title":"VoiceToolCallsResponse"},"WatchCheckRecord":{"properties":{"id":{"type":"string","title":"Id"},"check_number":{"type":"integer","title":"Check Number"},"status":{"type":"string","title":"Status","description":"in_progress | completed (the runner's verdict) | error (it could not run)"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"What it found — or, on error, what went wrong"},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"},"tool_calls":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Tool Calls","description":"[{id, name, arguments, result, success, duration_ms}]"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"started_at":{"type":"string","format":"date-time","title":"Started At"}},"type":"object","required":["id","check_number","status","started_at"],"title":"WatchCheckRecord","description":"One run of a watch's check, whole. Cost and tokens are in llm_usage."},"WatchParameter":{"properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$","title":"Name","description":"snake_case identifier, e.g. 'transaction_id'. Becomes the tool's parameter name.","examples":["transaction_id"]},"description":{"type":"string","title":"Description","description":"What the value is and where the assistant gets it — read by the model.","default":"","examples":["The transaction id the person gave, without spaces"]}},"type":"object","required":["name"],"title":"WatchParameter","description":"One value the assistant must supply when it schedules the watch.\n\nThe runner cannot see the conversation, so everything a check needs that\nvaries per conversation (a transaction id, an email) is declared here and\nbecomes a REQUIRED argument of the watch's tool. The description is what\nthe model reads to know what to ask the person for."},"WebhookSecretResponse":{"properties":{"secret":{"type":"string","title":"Secret","description":"The webhook secret (shown only once, copy it now!)"},"message":{"type":"string","title":"Message","description":"Warning message for the user","default":"This secret will not be shown again. Copy it now and store it securely."}},"type":"object","required":["secret"],"title":"WebhookSecretResponse","description":"Response when generating a webhook secret. The secret is shown only once."},"WeeklySchedule-Input":{"properties":{"sunday":{"$ref":"#/components/schemas/DaySchedule","description":"Sunday schedule"},"monday":{"$ref":"#/components/schemas/DaySchedule","description":"Monday schedule"},"tuesday":{"$ref":"#/components/schemas/DaySchedule","description":"Tuesday schedule"},"wednesday":{"$ref":"#/components/schemas/DaySchedule","description":"Wednesday schedule"},"thursday":{"$ref":"#/components/schemas/DaySchedule","description":"Thursday schedule"},"friday":{"$ref":"#/components/schemas/DaySchedule","description":"Friday schedule"},"saturday":{"$ref":"#/components/schemas/DaySchedule","description":"Saturday schedule"}},"type":"object","title":"WeeklySchedule","description":"Weekly schedule defining availability for each day."},"WeeklySchedule-Output":{"properties":{"sunday":{"$ref":"#/components/schemas/DaySchedule","description":"Sunday schedule"},"monday":{"$ref":"#/components/schemas/DaySchedule","description":"Monday schedule"},"tuesday":{"$ref":"#/components/schemas/DaySchedule","description":"Tuesday schedule"},"wednesday":{"$ref":"#/components/schemas/DaySchedule","description":"Wednesday schedule"},"thursday":{"$ref":"#/components/schemas/DaySchedule","description":"Thursday schedule"},"friday":{"$ref":"#/components/schemas/DaySchedule","description":"Friday schedule"},"saturday":{"$ref":"#/components/schemas/DaySchedule","description":"Saturday schedule"}},"type":"object","title":"WeeklySchedule","description":"Weekly schedule defining availability for each day."},"WinbackRule-Input":{"properties":{"id":{"type":"string","title":"Id","description":"Stable id; keep it when editing a rule"},"name":{"type":"string","maxLength":120,"title":"Name","description":"The follow-up's name, in kebab-case like a skill's or a watch's: lowercase letters, digits and hyphens. Whatever is sent is normalized (`Cierre cordial` → `cierre-cordial`), never rejected. It labels the rail, the transcript and the cron log. Blank = unnamed, and the rule still runs.","default":""},"enabled":{"type":"boolean","title":"Enabled","description":"A disabled rule owns nothing: its conversations fall through to the next","default":true},"include_tags":{"items":{"type":"string"},"type":"array","title":"Include Tags","description":"OR logic: any match makes the conversation eligible. EMPTY means every conversation, not none."},"exclude_tags":{"items":{"type":"string"},"type":"array","title":"Exclude Tags","description":"Any match blocks the rule for this conversation. Wins over include_tags."},"enable_condition":{"anyOf":[{"$ref":"#/components/schemas/SkillConditionGroup-Input","description":"The segment's logical definition over context"},{"type":"null"}],"description":"A condition on the conversation context — the same AST as a skill's enable_condition (app/agent/skill_conditions.py), with the same fail-closed semantics — that must ALSO pass, on top of the tags, for this rule to own the conversation. Evaluated against the latest context the channel stored on the conversation (its newest user message that carries one). A missing path fails every clause except not_exists. Null = no condition."},"schedule":{"items":{"$ref":"#/components/schemas/WinbackScheduleStep"},"type":"array","title":"Schedule","description":"Ordered follow-ups, cumulative from the last real message. At least one step."},"send_mode":{"type":"string","enum":["always","llm"],"title":"Send Mode","description":"always = every conversation the tags let through gets the nudge; llm = a judge decides per conversation (on send_criteria, or the built-in rule when null).","default":"llm"},"send_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Send Criteria","description":"The judge's rule, in the operator's own words — REPLACES the built-in criteria, which skip conversations that look resolved. Only read in send_mode=llm. Null = built-in."},"message_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Instructions","description":"Brief for the message: what the nudge is for, tone, what to push. Layered on the conversation context; the customer's language and 'contextual, not a broadcast' stay fixed. Null = built-in generic 'did you need more help?'."},"tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag","description":"Tag the bridge puts on the conversation when it delivers this rule's nudge, also written on the Studio Chat conversation. Null = the bridge's own default."},"respect_followup_hours":{"type":"boolean","title":"Respect Followup Hours","description":"Whether this follow-up waits for the account's follow-up hours. True (default): a step that comes due outside them goes out when they open again, and the steps after it count from that send. False: its steps run at any hour — for a follow-up that only closes a ticket or calls an API, where nobody is being messaged.","default":true},"task_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Task Id","description":"The task this follow-up belongs to (the task's stable id, `tsk_…`). Set: the rule runs ONLY in conversations pursuing that task, and a task may have several, checked in list order like any rule. Null: a generic follow-up, which never runs in a conversation pursuing a task — that conversation is its task's follow-ups' or nobody's."}},"additionalProperties":false,"type":"object","title":"WinbackRule","description":"One winback campaign: who gets nudged, when, on what condition, saying what.\n\nAn assistant holds an ordered list of these. The first rule whose tag\nfilter matches a quiet conversation owns it — the others ignore it, so a\nconversation runs exactly one schedule and the step count stays honest.\nThe conversation is stamped with the rule's id on the first delivered\nnudge (``ChatConversation.winback_rule_id``), which pins the rest of the\nschedule to that rule even if its tags move afterwards.\n\n``send_mode`` is the gate between the tag filter and the message:\n``always`` sends to every conversation the filter lets through (no judge,\nno LLM spend on one); ``llm`` runs the judge, on ``send_criteria`` when\nthe operator wrote one and on the built-in criteria otherwise — and the\nbuilt-in judge holds back on anything that looks resolved.\n\n``task_id`` splits the list in scopes that never meet: a conversation\npursuing a task is matched only against that task's rules, any other\nconversation only against the rules with no task. Within a scope the\nfirst-match order above holds unchanged.\n\n``enable_condition`` is a second filter next to the tags: a skill-style\ncondition on the conversation's context (``source_channel in [slack,\nchat_widget]``). A rule owns a conversation only when its tags AND its\ncondition pass; see ``services.winback.resolve_winback_rule``."},"WinbackRule-Output":{"properties":{"id":{"type":"string","title":"Id","description":"Stable id; keep it when editing a rule"},"name":{"type":"string","maxLength":120,"title":"Name","description":"The follow-up's name, in kebab-case like a skill's or a watch's: lowercase letters, digits and hyphens. Whatever is sent is normalized (`Cierre cordial` → `cierre-cordial`), never rejected. It labels the rail, the transcript and the cron log. Blank = unnamed, and the rule still runs.","default":""},"enabled":{"type":"boolean","title":"Enabled","description":"A disabled rule owns nothing: its conversations fall through to the next","default":true},"include_tags":{"items":{"type":"string"},"type":"array","title":"Include Tags","description":"OR logic: any match makes the conversation eligible. EMPTY means every conversation, not none."},"exclude_tags":{"items":{"type":"string"},"type":"array","title":"Exclude Tags","description":"Any match blocks the rule for this conversation. Wins over include_tags."},"enable_condition":{"anyOf":[{"$ref":"#/components/schemas/SkillConditionGroup-Output","description":"The segment's logical definition over context"},{"type":"null"}],"description":"A condition on the conversation context — the same AST as a skill's enable_condition (app/agent/skill_conditions.py), with the same fail-closed semantics — that must ALSO pass, on top of the tags, for this rule to own the conversation. Evaluated against the latest context the channel stored on the conversation (its newest user message that carries one). A missing path fails every clause except not_exists. Null = no condition."},"schedule":{"items":{"$ref":"#/components/schemas/WinbackScheduleStep"},"type":"array","title":"Schedule","description":"Ordered follow-ups, cumulative from the last real message. At least one step."},"send_mode":{"type":"string","enum":["always","llm"],"title":"Send Mode","description":"always = every conversation the tags let through gets the nudge; llm = a judge decides per conversation (on send_criteria, or the built-in rule when null).","default":"llm"},"send_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Send Criteria","description":"The judge's rule, in the operator's own words — REPLACES the built-in criteria, which skip conversations that look resolved. Only read in send_mode=llm. Null = built-in."},"message_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Instructions","description":"Brief for the message: what the nudge is for, tone, what to push. Layered on the conversation context; the customer's language and 'contextual, not a broadcast' stay fixed. Null = built-in generic 'did you need more help?'."},"tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tag","description":"Tag the bridge puts on the conversation when it delivers this rule's nudge, also written on the Studio Chat conversation. Null = the bridge's own default."},"respect_followup_hours":{"type":"boolean","title":"Respect Followup Hours","description":"Whether this follow-up waits for the account's follow-up hours. True (default): a step that comes due outside them goes out when they open again, and the steps after it count from that send. False: its steps run at any hour — for a follow-up that only closes a ticket or calls an API, where nobody is being messaged.","default":true},"task_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Task Id","description":"The task this follow-up belongs to (the task's stable id, `tsk_…`). Set: the rule runs ONLY in conversations pursuing that task, and a task may have several, checked in list order like any rule. Null: a generic follow-up, which never runs in a conversation pursuing a task — that conversation is its task's follow-ups' or nobody's."}},"additionalProperties":false,"type":"object","title":"WinbackRule","description":"One winback campaign: who gets nudged, when, on what condition, saying what.\n\nAn assistant holds an ordered list of these. The first rule whose tag\nfilter matches a quiet conversation owns it — the others ignore it, so a\nconversation runs exactly one schedule and the step count stays honest.\nThe conversation is stamped with the rule's id on the first delivered\nnudge (``ChatConversation.winback_rule_id``), which pins the rest of the\nschedule to that rule even if its tags move afterwards.\n\n``send_mode`` is the gate between the tag filter and the message:\n``always`` sends to every conversation the filter lets through (no judge,\nno LLM spend on one); ``llm`` runs the judge, on ``send_criteria`` when\nthe operator wrote one and on the built-in criteria otherwise — and the\nbuilt-in judge holds back on anything that looks resolved.\n\n``task_id`` splits the list in scopes that never meet: a conversation\npursuing a task is matched only against that task's rules, any other\nconversation only against the rules with no task. Within a scope the\nfirst-match order above holds unchanged.\n\n``enable_condition`` is a second filter next to the tags: a skill-style\ncondition on the conversation's context (``source_channel in [slack,\nchat_widget]``). A rule owns a conversation only when its tags AND its\ncondition pass; see ``services.winback.resolve_winback_rule``."},"WinbackScheduleStep":{"properties":{"delay_minutes":{"type":"integer","minimum":1.0,"title":"Delay Minutes","description":"Minutes after the conversation's last REAL message (cumulative from that anchor, not chained off the previous winback): [30, 120, 1380] fires at 30m, 2h and 23h."},"instructions":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Instructions","description":"What to do at this step, in the operator's words, with the same pills as the assistant's instructions ({{ tool() }}, {{ custom_tool: }}, {{ kb() }}, …). When set, the step is not a generated message any more: the platform injects a follow-up event carrying this text and the assistant takes a real turn on it, with its tools — it may write to the person, close the ticket, call an API, or do nothing visible. Null = the step sends a message written from the rule's message_instructions, as before."}},"additionalProperties":false,"type":"object","required":["delay_minutes"],"title":"WinbackScheduleStep","description":"One follow-up in a rule's schedule."},"WinbackTriggerRequest":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id","description":"The preview conversation to follow up on","examples":["conv_123456"]},"attempt":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Attempt","description":"Which attempt of the follow-up to run, 1-based. Omitted: the next one of the conversation's current silence — attempt 1 on a conversation nothing followed up yet, attempt 2 after that, and attempt 1 again once the person has written back."}},"type":"object","required":["conversation_id"],"title":"WinbackTriggerRequest","description":"Request to run one attempt of a follow-up on a preview conversation."},"WinbackTriggerResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether the attempt ran"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"What the person would have been sent. Null with success=true means the attempt ran and said nothing — a valid outcome for an attempt with its own instructions."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Why it did not run, when success is False"},"rule_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Id","description":"The follow-up rule that owns this conversation"},"rule_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Name","description":"That rule's name"},"attempt":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Attempt","description":"The attempt that ran, 1-based"},"total_attempts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Attempts","description":"How many attempts the rule's schedule has"},"ran_as_turn":{"type":"boolean","title":"Ran As Turn","description":"True when the attempt carries its own instructions and ran as a turn of the assistant (it may have called tools); false when it was a message written from the rule's message_instructions.","default":false},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCall"},"type":"array","title":"Tool Calls","description":"The tools the turn called, with their results (ran_as_turn only)"},"explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Explanation","description":"The assistant's own account of the turn (ran_as_turn only)"},"labels":{"items":{"type":"string"},"type":"array","title":"Labels","description":"The labels the turn applied (ran_as_turn only). In production they reach the ticket like a live turn's: with the message, or on their own when the attempt says nothing (channels that declare followup_labels). A preview sends nothing anywhere."}},"type":"object","required":["success"],"title":"WinbackTriggerResponse","description":"What one attempt of a follow-up did on a preview conversation."},"XAccountAppRequest":{"properties":{"client_id":{"type":"string","maxLength":255,"minLength":1,"title":"Client Id","description":"OAuth 2.0 Client ID"},"client_secret":{"type":"string","maxLength":512,"minLength":1,"title":"Client Secret","description":"OAuth 2.0 Client Secret"},"bearer_token":{"type":"string","maxLength":2048,"minLength":1,"title":"Bearer Token","description":"App-only Bearer Token"}},"type":"object","required":["client_id","client_secret","bearer_token"],"title":"XAccountAppRequest","description":"The customer's X developer app (console.x.com → the app → Keys and tokens)."},"XAccountAssistantRef":{"properties":{"base_id":{"type":"string","title":"Base Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["base_id"],"title":"XAccountAssistantRef"},"XAccountCheckItem":{"properties":{"ok":{"type":"boolean","title":"Ok"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"}},"type":"object","required":["ok"],"title":"XAccountCheckItem"},"XAccountCheckResponse":{"properties":{"token":{"$ref":"#/components/schemas/XAccountCheckItem"},"webhook":{"$ref":"#/components/schemas/XAccountCheckItem"},"subscriptions":{"$ref":"#/components/schemas/XAccountCheckItem"},"xchat":{"$ref":"#/components/schemas/XAccountCheckItem"},"account":{"$ref":"#/components/schemas/XAccountOut"}},"type":"object","required":["token","webhook","subscriptions","xchat","account"],"title":"XAccountCheckResponse","description":"A live look at the connection, repairing what it can (re-validates the webhook, recreates subscriptions)."},"XAccountCreateRequest":{"properties":{"playbook_base_id":{"type":"string","title":"Playbook Base Id","description":"The assistant that answers the X account's DMs"}},"type":"object","required":["playbook_base_id"],"title":"XAccountCreateRequest"},"XAccountDetail":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","enum":["pending","active","disabled"],"title":"Status"},"playbook_base_id":{"type":"string","title":"Playbook Base Id"},"assistant":{"anyOf":[{"$ref":"#/components/schemas/XAccountAssistantRef"},{"type":"null"}],"description":"The assistant that answers; null when it is gone"},"app_configured":{"type":"boolean","title":"App Configured","description":"The X app's client id, client secret and bearer token are stored"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id","description":"The X app's OAuth 2.0 client id (not a secret)"},"x_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X User Id"},"x_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X Username"},"x_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X Name"},"connected":{"type":"boolean","title":"Connected","description":"The X account's user tokens are stored"},"xchat_ready":{"type":"boolean","title":"Xchat Ready","description":"The account's XChat keys are stored: encrypted DMs can be answered"},"xchat_key_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xchat Key Version"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error","description":"Why the account needs attention, null when fine: token_revoked (connect again), app_credentials_invalid (paste the X app's credentials again), xchat_key_stale (enter the XChat passcode again), webhook_invalid, subscriptions_missing"},"last_error_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Error At"},"webhook_url":{"type":"string","title":"Webhook Url","description":"Where X delivers this account's events (registered automatically)"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"connected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Connected At"},"stats":{"$ref":"#/components/schemas/XAccountStats"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes","description":"OAuth 2.0 scopes the channel needs (X grants them from the app's Read, write and DMs permission)"},"recent_conversations":{"items":{"$ref":"#/components/schemas/XRecentConversation"},"type":"array","title":"Recent Conversations"}},"type":"object","required":["id","status","playbook_base_id","app_configured","connected","xchat_ready","webhook_url","stats","scopes"],"title":"XAccountDetail"},"XAccountOut":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","enum":["pending","active","disabled"],"title":"Status"},"playbook_base_id":{"type":"string","title":"Playbook Base Id"},"assistant":{"anyOf":[{"$ref":"#/components/schemas/XAccountAssistantRef"},{"type":"null"}],"description":"The assistant that answers; null when it is gone"},"app_configured":{"type":"boolean","title":"App Configured","description":"The X app's client id, client secret and bearer token are stored"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id","description":"The X app's OAuth 2.0 client id (not a secret)"},"x_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X User Id"},"x_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X Username"},"x_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X Name"},"connected":{"type":"boolean","title":"Connected","description":"The X account's user tokens are stored"},"xchat_ready":{"type":"boolean","title":"Xchat Ready","description":"The account's XChat keys are stored: encrypted DMs can be answered"},"xchat_key_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Xchat Key Version"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error","description":"Why the account needs attention, null when fine: token_revoked (connect again), app_credentials_invalid (paste the X app's credentials again), xchat_key_stale (enter the XChat passcode again), webhook_invalid, subscriptions_missing"},"last_error_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Error At"},"webhook_url":{"type":"string","title":"Webhook Url","description":"Where X delivers this account's events (registered automatically)"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"connected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Connected At"},"stats":{"$ref":"#/components/schemas/XAccountStats"}},"type":"object","required":["id","status","playbook_base_id","app_configured","connected","xchat_ready","webhook_url","stats"],"title":"XAccountOut","description":"A brand's X account as a channel of the account. Never carries a token, secret or key."},"XAccountPatchRequest":{"properties":{"playbook_base_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Playbook Base Id"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled","description":"false → disabled; true → active when connected, else pending"}},"type":"object","title":"XAccountPatchRequest"},"XAccountStats":{"properties":{"conversations_7d":{"type":"integer","title":"Conversations 7D","default":0},"messages_7d":{"type":"integer","title":"Messages 7D","default":0}},"type":"object","title":"XAccountStats"},"XAccountTokenExchangeRequest":{"properties":{"access_token":{"type":"string","maxLength":512,"minLength":1,"title":"Access Token"},"access_token_secret":{"type":"string","maxLength":512,"minLength":1,"title":"Access Token Secret"}},"type":"object","required":["access_token","access_token_secret"],"title":"XAccountTokenExchangeRequest","description":"The X account's OAuth 1.0a Access Token and Secret, generated in X's console (Read, write and DMs)."},"XAccountUnlockRequest":{"properties":{"passcode":{"type":"string","maxLength":64,"minLength":4,"title":"Passcode"}},"type":"object","required":["passcode"],"title":"XAccountUnlockRequest","description":"The X account's XChat passcode: used once to recover its encryption keys, never stored."},"XAccountsResponse":{"properties":{"accounts":{"items":{"$ref":"#/components/schemas/XAccountOut"},"type":"array","title":"Accounts"}},"type":"object","required":["accounts"],"title":"XAccountsResponse"},"XRecentConversation":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"x_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X User Id"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"message_count":{"type":"integer","title":"Message Count","default":0},"deep_link":{"type":"string","title":"Deep Link"}},"type":"object","required":["conversation_id","deep_link"],"title":"XRecentConversation"},"app__models__TimeSeriesPoint":{"properties":{"timestamp":{"type":"string","title":"Timestamp","description":"ISO timestamp for this time bucket"},"total_conversations":{"type":"integer","title":"Total Conversations","description":"Total conversations in this bucket"},"conversations_with_handoff":{"type":"integer","title":"Conversations With Handoff","description":"Conversations with handoff in this bucket"},"avg_response_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Response Latency Ms","description":"Average response latency in milliseconds for this bucket"},"min_response_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Response Latency Ms","description":"Minimum response latency in milliseconds for this bucket"},"max_response_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Response Latency Ms","description":"Maximum response latency in milliseconds for this bucket"},"p99_response_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P99 Response Latency Ms","description":"99th percentile response latency in milliseconds for this bucket"}},"type":"object","required":["timestamp","total_conversations","conversations_with_handoff"],"title":"TimeSeriesPoint","description":"A single data point in the time series."},"app__routers__account_management__UserResponse":{"properties":{"id":{"type":"integer","title":"Id","description":"User ID"},"username":{"type":"string","title":"Username","description":"Username"},"is_admin":{"type":"boolean","title":"Is Admin","description":"Whether the user is an admin"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the user is active"},"created_at":{"type":"string","title":"Created At","description":"ISO 8601 creation timestamp"}},"type":"object","required":["id","username","is_admin","is_active","created_at"],"title":"UserResponse"},"app__routers__admin__balances__AccountBalanceDetail":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"is_credit_tracked":{"type":"boolean","title":"Is Credit Tracked"},"total_credited_usd":{"type":"number","title":"Total Credited Usd"},"total_billed_usd":{"type":"number","title":"Total Billed Usd"},"metered_billed_usd":{"type":"number","title":"Metered Billed Usd","default":0.0},"minimum_shortfall_usd":{"type":"number","title":"Minimum Shortfall Usd","default":0.0},"monthly_minimum_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Monthly Minimum Usd"},"minimum_starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Minimum Starts On"},"minimum_adjustments":{"items":{"$ref":"#/components/schemas/MinimumAdjustment"},"type":"array","title":"Minimum Adjustments"},"balance_usd":{"type":"number","title":"Balance Usd"},"price_cents_per_conversation":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Cents Per Conversation"},"price_basis":{"type":"string","title":"Price Basis","default":"resolved"},"billed_conversations":{"type":"integer","title":"Billed Conversations","default":0},"has_rate":{"type":"boolean","title":"Has Rate","default":false},"refill_count":{"type":"integer","title":"Refill Count","default":0},"last_refill_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refill At"},"credits":{"items":{"$ref":"#/components/schemas/app__routers__admin__balances__CreditEntry"},"type":"array","title":"Credits"}},"type":"object","required":["account_id","is_credit_tracked","total_credited_usd","total_billed_usd","balance_usd"],"title":"AccountBalanceDetail"},"app__routers__admin__balances__BalancesResponse":{"properties":{"accounts":{"items":{"$ref":"#/components/schemas/AccountBalance"},"type":"array","title":"Accounts"}},"type":"object","title":"BalancesResponse"},"app__routers__admin__balances__CreditEntry":{"properties":{"id":{"type":"string","title":"Id"},"amount_usd":{"type":"number","title":"Amount Usd"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","amount_usd","created_at"],"title":"CreditEntry"},"app__routers__admin__payments__UpdatePaymentRequest":{"properties":{"amount_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount Usd","description":"New amount (non-zero). Omit to keep unchanged."},"is_credit":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Credit","description":"Toggle whether this feeds the Balance. Omit to keep unchanged."},"paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid At","description":"New effective date. Omit to keep unchanged."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note","description":"New note. Omit to keep unchanged; pass null to clear."}},"type":"object","title":"UpdatePaymentRequest"},"app__routers__intercom__ArticlePreview":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"state":{"type":"string","title":"State"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["id","title","state"],"title":"ArticlePreview","description":"Preview of an Intercom article."},"app__routers__intercom__CollectionPreview-Input":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"articles":{"items":{"$ref":"#/components/schemas/app__routers__intercom__ArticlePreview"},"type":"array","title":"Articles"},"children":{"items":{"$ref":"#/components/schemas/app__routers__intercom__CollectionPreview-Input"},"type":"array","title":"Children","default":[]}},"type":"object","required":["id","name","articles"],"title":"CollectionPreview","description":"Preview of an Intercom collection with its articles and nested children."},"app__routers__intercom__CollectionPreview-Output":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"articles":{"items":{"$ref":"#/components/schemas/app__routers__intercom__ArticlePreview"},"type":"array","title":"Articles"},"children":{"items":{"$ref":"#/components/schemas/app__routers__intercom__CollectionPreview-Output"},"type":"array","title":"Children","default":[]}},"type":"object","required":["id","name","articles"],"title":"CollectionPreview","description":"Preview of an Intercom collection with its articles and nested children."},"app__routers__pylon__ArticlePreview":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"state":{"type":"string","title":"State"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["id","title","state"],"title":"ArticlePreview","description":"Preview of a Pylon article."},"app__routers__pylon__CollectionPreview-Input":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"articles":{"items":{"$ref":"#/components/schemas/app__routers__pylon__ArticlePreview"},"type":"array","title":"Articles"},"children":{"items":{"$ref":"#/components/schemas/app__routers__pylon__CollectionPreview-Input"},"type":"array","title":"Children","default":[]}},"type":"object","required":["id","name","articles"],"title":"CollectionPreview","description":"Preview of a Pylon collection with articles and nested children."},"app__routers__pylon__CollectionPreview-Output":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"articles":{"items":{"$ref":"#/components/schemas/app__routers__pylon__ArticlePreview"},"type":"array","title":"Articles"},"children":{"items":{"$ref":"#/components/schemas/app__routers__pylon__CollectionPreview-Output"},"type":"array","title":"Children","default":[]}},"type":"object","required":["id","name","articles"],"title":"CollectionPreview","description":"Preview of a Pylon collection with articles and nested children."},"app__routers__resource_analytics__TimeSeriesPoint":{"properties":{"date":{"type":"string","title":"Date"},"count":{"type":"integer","title":"Count"},"success_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Success Count"}},"type":"object","required":["date","count"],"title":"TimeSeriesPoint"},"app__routers__sandbox_keys__SandboxKeyResponse":{"properties":{"project_id":{"type":"string","title":"Project Id","description":"Project ID"},"api_token":{"type":"string","title":"Api Token","description":"Raw sandbox API key (sbs_ prefix)"}},"type":"object","required":["project_id","api_token"],"title":"SandboxKeyResponse","description":"Response model for sandbox API key."},"app__routers__superadmin__AccountBalanceDetail":{"properties":{"account_id":{"type":"string","title":"Account Id"},"account_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Name"},"is_credit_tracked":{"type":"boolean","title":"Is Credit Tracked","description":"True when the account has >=1 ledger entry (prepaid). False = post-paid, no balance."},"total_credited_usd":{"type":"number","title":"Total Credited Usd","description":"Sum of all refills (ledger amount_usd)."},"total_billed_usd":{"type":"number","title":"Total Billed Usd","description":"Full drawdown over all time: metered_billed_usd + minimum_shortfall_usd."},"metered_billed_usd":{"type":"number","title":"Metered Billed Usd","description":"Metered part of the drawdown: billed conversations × the account's rate, over all time.","default":0.0},"minimum_shortfall_usd":{"type":"number","title":"Minimum Shortfall Usd","description":"Charged on top for closed months whose usage came in under the account's contractual monthly minimum. 0 when the account has no minimum, or cleared it every month.","default":0.0},"monthly_minimum_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Monthly Minimum Usd","description":"The account's full-month contractual minimum in USD, or null when it has none."},"minimum_starts_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Minimum Starts On","description":"Day the minimum started applying (partial months are prorated by days)."},"minimum_adjustments":{"items":{"$ref":"#/components/schemas/MinimumAdjustmentModel"},"type":"array","title":"Minimum Adjustments","description":"One row per closed month the minimum covered, newest first (shortfall 0 when it was cleared)."},"balance_usd":{"type":"number","title":"Balance Usd","description":"total_credited_usd − total_billed_usd."},"non_billable_conversations":{"type":"integer","title":"Non Billable Conversations","description":"Conversations marked non-billable at reconciliation. Already excluded from the drawdown; this is how many.","default":0},"price_cents_per_conversation":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price Cents Per Conversation","description":"The account's billed rate in cents, or null when no rate is configured."},"price_basis":{"type":"string","title":"Price Basis","description":"'resolved' (per deflected) or 'conversation' (per total).","default":"resolved"},"billed_conversations":{"type":"integer","title":"Billed Conversations","description":"Conversations counted toward the drawdown.","default":0},"has_rate":{"type":"boolean","title":"Has Rate","description":"False when the account is funded but has no configured rate (drawdown is 0 until one exists)."},"refill_count":{"type":"integer","title":"Refill Count"},"last_refill_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Refill At"},"burn_usd_per_day":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Burn Usd Per Day","description":"Drawdown over the trailing 30 days / 30. Null when the account has no configured rate; 0 when it had no traffic in the window."},"runway_days":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Runway Days","description":"balance_usd / burn_usd_per_day — days of credit left at the recent rate. 0 when the balance is already spent. Null when it cannot be projected (no rate, or burn is 0)."},"projected_zero_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Projected Zero At","description":"When the balance hits zero at the recent rate. Null whenever runway_days is null or 0."},"credits":{"items":{"$ref":"#/components/schemas/app__routers__admin__balances__CreditEntry"},"type":"array","title":"Credits","description":"Ledger entries, newest first."}},"type":"object","required":["account_id","is_credit_tracked","total_credited_usd","total_billed_usd","balance_usd","has_rate","refill_count"],"title":"AccountBalanceDetail"},"app__routers__superadmin__BalancesResponse":{"properties":{"accounts":{"items":{"$ref":"#/components/schemas/AccountBalanceSummary"},"type":"array","title":"Accounts","description":"Funded accounts only, lowest balance first."}},"type":"object","title":"BalancesResponse"},"app__routers__superadmin__UpdatePaymentRequest":{"properties":{"amount_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount Usd","description":"New amount (non-zero). Omit to leave unchanged."},"is_credit":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Credit","description":"Toggle whether this payment feeds the Balance. Omit to leave unchanged."},"paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid At","description":"New date. Omit to leave unchanged."},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note","description":"New note. Sent only when set_note is true."},"set_note":{"type":"boolean","title":"Set Note","description":"When true, the note is replaced (pass null to clear it).","default":false}},"type":"object","title":"UpdatePaymentRequest"},"app__routers__supersami__SandboxKeyResponse":{"properties":{"project_id":{"type":"string","title":"Project Id"},"api_token":{"type":"string","title":"Api Token"}},"type":"object","required":["project_id","api_token"],"title":"SandboxKeyResponse"},"app__routers__users__UserResponse":{"properties":{"id":{"type":"integer","title":"Id"},"username":{"type":"string","title":"Username"},"is_admin":{"type":"boolean","title":"Is Admin"},"is_active":{"type":"boolean","title":"Is Active"},"totp_enabled":{"type":"boolean","title":"Totp Enabled","default":false},"last_login":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","username","is_admin","is_active","last_login","created_at"],"title":"UserResponse","description":"User response model (without sensitive data)."}}}}