{"openapi":"3.1.0","info":{"title":"Vecres WeCom Archive","version":"0.1.0"},"paths":{"/admin/login":{"get":{"summary":"Admin Login Page","description":"Login page. Redirects to /dashboard if already authenticated.\n\nRenders password form when AUTH_MODE=password; WeCom button otherwise.\n\nAn `?error=` query param always takes priority over the already-\nauthenticated redirect: a failed OAuth callback redirects here with an\nerror code, and a stale-but-still-valid session cookie from a previous\nlogin must never silently swallow that error behind a bounce back to\nthe console — the failure needs to be visible, not indistinguishable\nfrom success.","operationId":"admin_login_page_admin_login_get","parameters":[{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/password/forgot":{"post":{"summary":"Password Forgot","description":"Request a password reset without revealing whether an account exists.","operationId":"password_forgot_api_auth_password_forgot_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ForgotBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/password/reset":{"post":{"summary":"Password Reset","description":"Consume a one-time token and set the account's new PBKDF2 password.","operationId":"password_reset_api_auth_password_reset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ResetBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/invite":{"post":{"summary":"Invite User","description":"Create a disabled pending account and deliver its invitation link.","operationId":"invite_user_api_admin_users_invite_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_InviteBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/invite-batch":{"post":{"summary":"Invite Users Batch","description":"Invite up to 20 users, reporting failures without aborting the batch.","operationId":"invite_users_batch_api_admin_users_invite_batch_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_InviteBatchBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/accept":{"post":{"summary":"Accept Invite","description":"Activate a pending invited account after setting its password.","operationId":"accept_invite_api_admin_users_accept_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_AcceptBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/forgot-password":{"get":{"summary":"Forgot Password Page","operationId":"forgot_password_page_admin_forgot_password_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/reset-password":{"get":{"summary":"Reset Password Page","operationId":"reset_password_page_admin_reset_password_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api/auth/password/login":{"post":{"summary":"Password Login","description":"Temporary username/password login (RND-112).\n\nOnly active when AUTH_MODE=password; returns 404 in wecom mode.\nVerifies ADMIN_USERNAME and ADMIN_PASSWORD_HASH from environment.\nOn success: creates an AdminSession bound to the default tenant and sets\nan HttpOnly session cookie (same flags as WeCom OAuth sessions).\nOn failure: returns 401 with a sanitized error — no session is created.\nNever logs submitted password, stored hash, or session token.","operationId":"password_login_api_auth_password_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PasswordLoginBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/wecom/login":{"get":{"summary":"Wecom Login","description":"Redirect the browser to the WeCom OAuth authorization URL.","operationId":"wecom_login_api_auth_wecom_login_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/wecom/qr/login":{"get":{"summary":"Wecom Qr Login","description":"Redirect an iframe to WeCom's PC QR-login page (RND-321).","operationId":"wecom_qr_login_api_auth_wecom_qr_login_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/wecom/callback":{"get":{"summary":"Wecom Callback","description":"Handle the in-WeCom OAuth callback after one-time state validation.","operationId":"wecom_callback_api_auth_wecom_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/wecom/qr/callback":{"get":{"summary":"Wecom Qr Callback","description":"Handle the PC QR callback using the identical OAuth session flow.","operationId":"wecom_qr_callback_api_auth_wecom_qr_callback_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"state","in":"query","required":true,"schema":{"type":"string","title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/me":{"get":{"summary":"Auth Me","description":"Return current session metadata. Always returns HTTP 200.\n{\"authenticated\": false} when no valid session.\nNo secrets, tokens, or cookie values in the response.","operationId":"auth_me_api_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/me/preferences":{"put":{"summary":"Put Me Preferences","description":"Update only the authenticated user's UI preferences (fail-closed).","operationId":"put_me_preferences_api_auth_me_preferences_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/logout":{"post":{"summary":"Auth Logout","description":"Revoke the current session and clear the session cookie.","operationId":"auth_logout_api_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/branding":{"get":{"tags":["branding"],"summary":"Get Branding Status","description":"Show only current tenant state and feature eligibility, never a TXT value.","operationId":"get_branding_status_api_branding_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/branding/logo":{"put":{"tags":["branding"],"summary":"Upload Logo","operationId":"upload_logo_api_branding_logo_put","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["branding"],"summary":"Restore Default Logo","operationId":"restore_default_logo_api_branding_logo_delete","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/branding/favicon":{"put":{"tags":["branding"],"summary":"Upload Favicon","operationId":"upload_favicon_api_branding_favicon_put","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["branding"],"summary":"Restore Default Favicon","operationId":"restore_default_favicon_api_branding_favicon_delete","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/branding/domain":{"post":{"tags":["branding"],"summary":"Save Domain","description":"Start DNS ownership verification and return its raw value exactly once.","operationId":"save_domain_api_branding_domain_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainConfigureIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["branding"],"summary":"Remove Domain","operationId":"remove_domain_api_branding_domain_delete","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/branding/domain/verify":{"post":{"tags":["branding"],"summary":"Verify Domain","operationId":"verify_domain_api_branding_domain_verify_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/branding/domain/enable":{"post":{"tags":["branding"],"summary":"Activate Domain","operationId":"activate_domain_api_branding_domain_enable_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/branding/domain/disable":{"post":{"tags":["branding"],"summary":"Deactivate Domain","operationId":"deactivate_domain_api_branding_domain_disable_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/monitored-accounts":{"get":{"summary":"Get Monitored Accounts","description":"Return all WeCom archive seats (monitored accounts) for this tenant —\nboth the currently active seat and historical seats with archived\nrecords — sorted active-first, then by latest_message_time descending.\n\nSee _collect_staff_ids() and the module docstring for how seats are\nidentified in the absence of a formal seat-roster source.\n\nlatest_message_time (and therefore active/history ranking) is computed\nfrom _latest_own_participation_time() — each seat's own sender/recipient\nrows only, never the group-room-expanded set _fetch_messages_for_entity()\nreturns. conversation_count still uses the expanded set: that is a\nsession-viewing concern (how many threads to show under this seat), not\na classification concern (RND-132 QA fix — see _latest_own_participation_time\ndocstring for why these two must stay separate).\n\nQuery/aggregation logic lives in app.services.listing_service (RND-219).","operationId":"get_monitored_accounts_api_monitored_accounts_get","parameters":[{"name":"include_conversation_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to calculate the full conversation count for every monitored account. The review-console picker sets this false because it does not display counts.","default":true,"title":"Include Conversation Count"},"description":"Whether to calculate the full conversation count for every monitored account. The review-console picker sets this false because it does not display counts."},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MonitoredAccountOut"},"title":"Response Get Monitored Accounts Api Monitored Accounts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/contacts":{"get":{"summary":"Get Contacts","description":"Return all contacts (non-staff participants) observed in the tenant archive.\n\nQuery logic lives in app.services.listing_service (RND-219).","operationId":"get_contacts_api_contacts_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContactOut"},"title":"Response Get Contacts Api Contacts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conversations":{"get":{"summary":"Get Conversations","description":"Return conversations for a monitored account (mode=staff) or contact (mode=contact).\n\nSorted by last activity descending.\n\nQuery/aggregation logic lives in app.services.listing_service (RND-219).","operationId":"get_conversations_api_conversations_get","parameters":[{"name":"mode","in":"query","required":true,"schema":{"type":"string","description":"'staff' or 'contact'","title":"Mode"},"description":"'staff' or 'contact'"},{"name":"staff_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required when mode=staff","title":"Staff Id"},"description":"Required when mode=staff"},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required when mode=contact","title":"Contact Id"},"description":"Required when mode=contact"},{"name":"include_participant_metadata","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to return inferred participant metadata. The staff console's conversation-card list sets this false because it does not render it.","default":true,"title":"Include Participant Metadata"},"description":"Whether to return inferred participant metadata. The staff console's conversation-card list sets this false because it does not render it."},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ConversationOut"},"title":"Response Get Conversations Api Conversations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conversations/{conversation_id}/messages":{"get":{"summary":"Get Conversation Messages","description":"Return a page of the message timeline for a conversation, scoped to the\nsession tenant, always in ascending msgtime order (oldest first) so the\nUI can render it directly without re-sorting.\n\nAggregation, pagination, structured-field projection, revoke fold, and\nnested media enrichment all live in app.services.timeline_service\n(RND-220) -- this handler only validates/converts HTTP input and\ndispatches to resolve_timeline_page. See that function's docstring for\nthe full behavior contract (cursor shape, conversation_id formats,\nconversation_type policy).\n\nWEARCHIVE_LEGACY_TIMELINE (short-term rollback facade, RND-220): when\nthis environment variable is set (any truthy string), dispatches to\n_resolve_timeline_page_legacy -- a byte-identical pre-extraction\nsnapshot -- instead. Exists purely as an instant (env var + restart,\nno redeploy) rollback path if the new service path ever regresses in\nproduction; not intended to diverge from resolve_timeline_page and\nshould be removed by a future cleanup ticket once the new path has\nbeen stable.","operationId":"get_conversation_messages_api_conversations__conversation_id__messages_get","parameters":[{"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":"Max messages to return","default":20,"title":"Limit"},"description":"Max messages to return"},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Opaque pagination cursor from a previous response's pagination.next_before — pass it back verbatim to load the next older page. Do not construct this value manually: it is a compound msgtime:id token (see _decode_message_cursor).","title":"Before"},"description":"Opaque pagination cursor from a previous response's pagination.next_before — pass it back verbatim to load the next older page. Do not construct this value manually: it is a compound msgtime:id token (see _decode_message_cursor)."},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional entity context: 'staff' or 'contact'. Required to unambiguously resolve a conversation_id that collides between a direct pair and a group room -- without it, a genuine collision returns 400. Same semantics as GET /api/conversations.","title":"Mode"},"description":"Optional entity context: 'staff' or 'contact'. Required to unambiguously resolve a conversation_id that collides between a direct pair and a group room -- without it, a genuine collision returns 400. Same semantics as GET /api/conversations."},{"name":"staff_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required when mode=staff","title":"Staff Id"},"description":"Required when mode=staff"},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required when mode=contact","title":"Contact Id"},"description":"Required when mode=contact"},{"name":"conversation_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional, validated consistency check: 'direct' or 'group'. conversation_id shape plus entity context alone still determine which messages are resolved -- this value never changes that resolution. When supplied, it must be exactly 'direct' or 'group' (400 otherwise) and must match the actually-resolved bucket's type -- group if any resolved message has a real roomid, direct otherwise (400 on mismatch, e.g. a stale list row pointing at a bucket that has since become a group/direct collision resolved the other way for this entity). Also echoed back onto any media_url/media_access_url this response generates, so a client following those URLs carries the same context.","title":"Conversation Type"},"description":"Optional, validated consistency check: 'direct' or 'group'. conversation_id shape plus entity context alone still determine which messages are resolved -- this value never changes that resolution. When supplied, it must be exactly 'direct' or 'group' (400 otherwise) and must match the actually-resolved bucket's type -- group if any resolved message has a real roomid, direct otherwise (400 on mismatch, e.g. a stale list row pointing at a bucket that has since become a group/direct collision resolved the other way for this entity). Also echoed back onto any media_url/media_access_url this response generates, so a client following those URLs carries the same context."},{"name":"favorited_only","in":"query","required":false,"schema":{"type":"boolean","description":"Return only active message favorites in this conversation","default":false,"title":"Favorited Only"},"description":"Return only active message favorites in this conversation"},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationMessagesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conversations/{conversation_id}/detail":{"get":{"summary":"Get Conversation Detail","description":"Archive Console v2 (design import) -- conversation-level stats and\ninferred participants for the review console's 会话信息 panel. Additive:\ndoes not change GET /api/conversations or any other existing endpoint.\n\nReuses _resolve_conversation_message_ids (RND-240: an id-only mirror of\n_fetch_conversation_messages's exact tenant-scoped membership\nresolution -- see its docstring for why this endpoint can't just call\n_fetch_conversation_messages directly and still be fast) and\n_build_conversation_list (the exact staff/contact aggregation\nGET /api/conversations uses) — see app.conversation_membership /\napp.services.listing_service — instead of a parallel reimplementation.\n\n`participants` is explicitly an INFERENCE over archived messages (every\ndistinct sender/recipient observed among this conversation's resolved\nmessages), never a live WeCom room roster — this system has no such\nsync, and the frontend labels it accordingly (never presented as\nground truth). `decrypted_percent` is computed only from\nArchiveMessage.decrypt_status among those same resolved messages, via a\nSQL aggregate rather than materializing every row.\n\nRND-240: for a conversation with thousands of messages, the previous\nimplementation (`_fetch_conversation_messages` -> full ArchiveMessage\nORM rows, including the large raw_encrypted_payload/decrypted_payload/\nstructured_content JSONB columns nothing here ever reads) was the\ndominant cost of loading this panel. This resolves membership as bare\nids first (`_resolve_conversation_message_ids`), computes\n`decrypted_percent` with a COUNT aggregate, and only re-fetches\n`ArchiveMessage` rows through a `load_only` projection restricted to\nthe columns `_build_conversation_list` actually reads\n(id/sender/roomid/msgtime/content_text) to build `participants`.","operationId":"get_conversation_detail_api_conversations__conversation_id__detail_get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetailOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/display-name":{"put":{"summary":"Update Display Name","description":"Set or clear the console label for one room or one participant.\n\nRestricted to owner/admin because the label is what every reviewer reads\nnext to the raw id: this is a review-affecting configuration change, not a\nper-user display preference.","operationId":"update_display_name_api_admin_display_name_put","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisplayNameUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisplayNameUpdateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/media/{media_id}/download":{"get":{"summary":"Download Media Library File","description":"Download one tenant-owned media-library item and append its audit row.\n\nThis is deliberately a controlled byte proxy for both local and Qiniu\nstorage. It shares the existing media route's provider resolution and\nserving implementation rather than returning an object-storage URL.","operationId":"download_media_library_file_api_admin_media__media_id__download_get","parameters":[{"name":"media_id","in":"path","required":true,"schema":{"type":"integer","title":"Media Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conversations/{conversation_id}/messages/{msgid}/media":{"get":{"summary":"Get Message Media","description":"Serve an already-downloaded image message's file content (RND-144).\n\nmode/staff_id/contact_id/conversation_type (RND-158 Phase 2 QA round\n7, blocker 3): optional entity context, identical params/validation to\nGET .../messages, forwarded into resolve_authorized_media so a media\nrequest generated from an entity-scoped timeline resolves against the\nsame entity-scoped message set the timeline used -- see\nresolve_authorized_media's docstring for the collision/authorization\ncontract this establishes.\n\nKept unchanged by RND-187 for backward compatibility: local-backed rows\nstill only serve this way, and this is still a valid (if no longer the\nprimary) access path for Qiniu-backed rows too — see\nget_message_media_access for the RND-187 signed-URL descriptor route\nthe frontend now calls first for image messages.\n\nSee resolve_authorized_media's docstring for the full authorization-\nboundary rationale (RND-174/RND-156): the sequence completes in full\n*before* any storage provider is selected or called — the provider is\nnever part of the authorization boundary.\n\nThe provider used to serve this row is resolved from the row's own\nstorage_backend/storage_ref (RND-174 QA fix), never from the\ndeployment-wide MEDIA_STORAGE_PROVIDER default — so this route keeps\nworking correctly for both local- and Qiniu-backed rows in the same\ndeployment, regardless of which provider is currently configured for\nnew writes.\n\nResponse codes:\n  404  wrong tenant, wrong conversation, non-image message,\n       missing/pending/failed media_files row, unsafe/missing storage\n       reference, disallowed file extension, or a confirmed-missing\n       remote object.\n  503  the storage provider could not confirm the object's state\n       (network timeout, auth failure, bucket error, SDK failure) —\n       never reported as a plain 404 (RND-174 QA fix: an outage must\n       not look like missing media).\n  502  a storage operation otherwise failed against a provider that\n       did respond.\n  500  the row names a storage backend that is unset/unsupported/\n       misconfigured.\n\nNever includes sdkfileid, local_path, storage_ref, oss_key, or any raw\nprovider/SDK error detail in the response or in any log line.","operationId":"get_message_media_api_conversations__conversation_id__messages__msgid__media_get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"msgid","in":"path","required":true,"schema":{"type":"string","title":"Msgid"}},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional entity context: 'staff' or 'contact'. Same semantics as GET .../messages -- required to unambiguously authorize a message that only exists on one side of a direct/group collision. Without it, a genuinely ambiguous conversation_id returns 400, same as the timeline route.","title":"Mode"},"description":"Optional entity context: 'staff' or 'contact'. Same semantics as GET .../messages -- required to unambiguously authorize a message that only exists on one side of a direct/group collision. Without it, a genuinely ambiguous conversation_id returns 400, same as the timeline route."},{"name":"staff_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required when mode=staff","title":"Staff Id"},"description":"Required when mode=staff"},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required when mode=contact","title":"Contact Id"},"description":"Required when mode=contact"},{"name":"conversation_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional consistency check, 'direct' or 'group' -- same validation as GET .../messages. Never used to select or filter the message itself.","title":"Conversation Type"},"description":"Optional consistency check, 'direct' or 'group' -- same validation as GET .../messages. Never used to select or filter the message itself."},{"name":"variant","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RND-207/RND-258: 'thumb' serves a generated list thumbnail; 'play' serves a generated browser-playable voice derivative. Omitted voice requests use a generated playback variant when available; otherwise the original is served.","title":"Variant"},"description":"RND-207/RND-258: 'thumb' serves a generated list thumbnail; 'play' serves a generated browser-playable voice derivative. Omitted voice requests use a generated playback variant when available; otherwise the original is served."},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conversations/{conversation_id}/messages/{msgid}/media/access":{"get":{"summary":"Get Message Media Access","description":"Return a unified media access descriptor (RND-187) instead of proxying\nimage bytes. The frontend calls this first for every image message,\nthen loads the actual image from descriptor.url — it never needs to\nknow which storage_backend served it.\n\nmode/staff_id/contact_id/conversation_type (RND-158 Phase 2 QA round\n7, blocker 3): optional entity context, identical params/validation to\nGET .../messages, forwarded into resolve_authorized_media. Also\nechoed onto the returned proxy url (access_type=\"proxy\" / local\nbackend) so a client following it preserves the same context.\n\naccess_type=\"proxy\" (local-backed rows): url is the existing\nget_message_media route, unchanged. expires_at is None — the URL\ncarries no time-boxed credential of its own; the session cookie\nauthorizes each request to it, same as before RND-187.\n\naccess_type=\"signed_url\" (Qiniu-backed rows): url is a short-lived\nQiniu signed URL whose absolute expiry is snapped to a fixed window\n(compute_signed_url_deadline; MEDIA_SIGNED_URL_WINDOW_SECONDS, defaulting\nto MEDIA_SIGNED_URL_TTL_SECONDS = 900, bounded [60, 3600]) so the URL is\nbyte-identical for every request in that window and the browser reuses\nits HTTP cache (RND-207). Minted only after this route completes the\nexact same authorization sequence\nas get_message_media (resolve_authorized_media /\n_resolve_servable_backend_and_ref) *plus* an explicit check that the\nobject key's own \"tenants/{tenant_id}/\" prefix agrees with this row's\nauthenticated tenant_id (object_key_tenant_prefix_matches) — so a\ncorrupted/mistagged row can never mint a signed URL for a different\ntenant's object on the strength of the tenant_id column alone. The\nsigned URL itself is never logged or included in any exception.\n\nCache-Control: no-store on every response this endpoint can produce —\nsuccess or error, any status code, including a 401 raised by\nget_current_user() before this function body even runs. The header set\nbelow covers the success path (FastAPI copies headers mutated on an\ninjected Response parameter onto the final response for a returned\nPydantic model); MediaAccessNoStoreMiddleware (registered on the app in\nmain.py) independently guarantees the same header on every error path,\nsince an exception's Response is built fresh by FastAPI/Starlette and\nnever sees this function's local `response` mutation. Both mechanisms\ntarget the same header value, so keeping this line is redundant but\nharmless on the success path, not dead code.\n\nResponse codes: same 404/500/503 taxonomy and meaning as\nget_message_media (wrong tenant/conversation, non-image, missing row,\nunservable file, misconfigured backend, provider outage, object-key\ntenant-prefix mismatch). 502 additionally covers a confirmed signed-URL\ngeneration failure against a provider that did respond.","operationId":"get_message_media_access_api_conversations__conversation_id__messages__msgid__media_access_get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"msgid","in":"path","required":true,"schema":{"type":"string","title":"Msgid"}},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional entity context: 'staff' or 'contact'. Same semantics as GET .../messages -- required to unambiguously authorize a message that only exists on one side of a direct/group collision. Without it, a genuinely ambiguous conversation_id returns 400, same as the timeline route.","title":"Mode"},"description":"Optional entity context: 'staff' or 'contact'. Same semantics as GET .../messages -- required to unambiguously authorize a message that only exists on one side of a direct/group collision. Without it, a genuinely ambiguous conversation_id returns 400, same as the timeline route."},{"name":"staff_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required when mode=staff","title":"Staff Id"},"description":"Required when mode=staff"},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required when mode=contact","title":"Contact Id"},"description":"Required when mode=contact"},{"name":"conversation_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional consistency check, 'direct' or 'group' -- same validation as GET .../messages. Never used to select or filter the message itself.","title":"Conversation Type"},"description":"Optional consistency check, 'direct' or 'group' -- same validation as GET .../messages. Never used to select or filter the message itself."},{"name":"variant","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RND-207/RND-258: 'thumb' returns a list-thumbnail descriptor; 'play' returns a generated browser-playable voice descriptor. Omitted voice requests use playback when available; otherwise the original is returned.","title":"Variant"},"description":"RND-207/RND-258: 'thumb' returns a list-thumbnail descriptor; 'play' returns a generated browser-playable voice descriptor. Omitted voice requests use playback when available; otherwise the original is returned."},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAccessOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conversations/{conversation_id}/messages/{msgid}/nested-media/{item_path}":{"get":{"summary":"Get Nested Message Media","description":"Serve an already-downloaded nested mixed/chatrecord media item's file\ncontent (RND-200 QA fix) — the nested-item analogue of\nget_message_media, reusing every storage/content-type primitive it\nuses. Not a second implementation: only resolve_authorized_media is\ncalled with item_path set (which additionally validates item_path and\nresolves via sdkfileid instead of archive_message_id — see its\ndocstring); every step after that is identical to get_message_media,\nincluding the exact response-code taxonomy and the \"never log/return\nsdkfileid, local_path, storage_ref, oss_key\" guarantee.\n\nitem_path is untrusted URL input, strictly validated against a fixed\ngrammar (see app.services.media_access._validate_nested_media_path)\nbefore ever being used — never eval'd, never used as a filesystem\npath, never used to index an arbitrary object graph. A malformed path\nis rejected with 400; a well-formed path that does not resolve to a\nmedia-bearing node on THIS message is rejected with 404 — the same\n404 as \"wrong conversation\" or \"wrong tenant\", so a caller cannot\ndistinguish \"path doesn't exist\" from \"you can't see this message\" by\nresponse shape alone.","operationId":"get_nested_message_media_api_conversations__conversation_id__messages__msgid__nested_media__item_path__get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"msgid","in":"path","required":true,"schema":{"type":"string","title":"Msgid"}},{"name":"item_path","in":"path","required":true,"schema":{"type":"string","title":"Item Path"}},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RND-226: optional entity context: 'staff' or 'contact'. Same semantics as GET .../messages -- required to unambiguously authorize a nested media item on a message that only exists on one side of a direct/group conversation-id collision. Without it, a genuinely ambiguous conversation_id returns 400, same as the timeline route.","title":"Mode"},"description":"RND-226: optional entity context: 'staff' or 'contact'. Same semantics as GET .../messages -- required to unambiguously authorize a nested media item on a message that only exists on one side of a direct/group conversation-id collision. Without it, a genuinely ambiguous conversation_id returns 400, same as the timeline route."},{"name":"staff_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required when mode=staff","title":"Staff Id"},"description":"Required when mode=staff"},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required when mode=contact","title":"Contact Id"},"description":"Required when mode=contact"},{"name":"conversation_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RND-226: optional consistency check, 'direct' or 'group' -- same validation as GET .../messages. Never used to select or filter the message itself.","title":"Conversation Type"},"description":"RND-226: optional consistency check, 'direct' or 'group' -- same validation as GET .../messages. Never used to select or filter the message itself."},{"name":"variant","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RND-207/RND-258: 'thumb' serves a generated thumbnail; 'play' serves a generated browser-playable voice derivative. Omitted voice requests use playback when available.","title":"Variant"},"description":"RND-207/RND-258: 'thumb' serves a generated thumbnail; 'play' serves a generated browser-playable voice derivative. Omitted voice requests use playback when available."},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/conversations/{conversation_id}/messages/{msgid}/nested-media/{item_path}/access":{"get":{"summary":"Get Nested Message Media Access","description":"Return a public access descriptor for one nested mixed/chatrecord\nmedia item (RND-200 QA fix) — the nested-item analogue of\nget_message_media_access, reusing the exact same signed-URL/proxy\nbranching, TTL config, and object-key tenant-prefix check. Not a\nsecond storage-access implementation: only the authorization/lookup\nstep differs (resolve_authorized_media called with item_path set,\ninstead of None) — see its docstring for why resolution is keyed by\nsdkfileid rather than archive_message_id.\n\nReturns NestedMediaAccessOut, NOT MediaAccessOut (RND-200 QA\nsecurity fix, second round): MediaAccessOut.media_id exposes the\ninternal MediaFile primary key, which independent QA correctly\nrejected as a leak for the nested contract — the approved public\nhandle for nested media is (conversation_id, msgid, item_path) only,\nnever a database id. media_file.id is still used locally in this\nfunction (log lines only, never returned to a caller) for\noperator-facing diagnostics, exactly as before.\n\naccess_type=\"proxy\": url is get_nested_message_media (this same\nconversation_id/msgid/item_path), not the top-level get_message_media\nroute — a nested item's bytes are never served through the single-\nmedia parent route, since a mixed/chatrecord message can hold more\nthan one media item and the parent route has no way to disambiguate\nwhich one is meant.\n\nCache-Control: no-store on every response — see\nMediaAccessNoStoreMiddleware, whose path pattern covers this route\ntoo.","operationId":"get_nested_message_media_access_api_conversations__conversation_id__messages__msgid__nested_media__item_path__access_get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}},{"name":"msgid","in":"path","required":true,"schema":{"type":"string","title":"Msgid"}},{"name":"item_path","in":"path","required":true,"schema":{"type":"string","title":"Item Path"}},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RND-226: optional entity context: 'staff' or 'contact'. Same semantics as GET .../messages -- required to unambiguously authorize a nested media item on a message that only exists on one side of a direct/group conversation-id collision. Without it, a genuinely ambiguous conversation_id returns 400, same as the timeline route.","title":"Mode"},"description":"RND-226: optional entity context: 'staff' or 'contact'. Same semantics as GET .../messages -- required to unambiguously authorize a nested media item on a message that only exists on one side of a direct/group conversation-id collision. Without it, a genuinely ambiguous conversation_id returns 400, same as the timeline route."},{"name":"staff_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required when mode=staff","title":"Staff Id"},"description":"Required when mode=staff"},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Required when mode=contact","title":"Contact Id"},"description":"Required when mode=contact"},{"name":"conversation_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RND-226: optional consistency check, 'direct' or 'group' -- same validation as GET .../messages. Never used to select or filter the message itself.","title":"Conversation Type"},"description":"RND-226: optional consistency check, 'direct' or 'group' -- same validation as GET .../messages. Never used to select or filter the message itself."},{"name":"variant","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"RND-207/RND-258: 'thumb' returns a generated-thumbnail descriptor; 'play' returns a browser-playable voice descriptor. Omitted voice requests use playback when available.","title":"Variant"},"description":"RND-207/RND-258: 'thumb' returns a generated-thumbnail descriptor; 'play' returns a browser-playable voice descriptor. Omitted voice requests use playback when available."},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NestedMediaAccessOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/reachability-audit":{"get":{"summary":"Get Reachability Audit","description":"Audit reachability for this tenant's successfully-archived messages.\n\ntenant_id is taken only from the authenticated session, never from a\nrequest param — matching every other route in this codebase.","operationId":"get_reachability_audit_api_admin_reachability_audit_get","parameters":[{"name":"conversation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"}},{"name":"message_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Type"}},{"name":"msgtime_from","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Inclusive lower bound, epoch ms","title":"Msgtime From"},"description":"Inclusive lower bound, epoch ms"},{"name":"msgtime_to","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Inclusive upper bound, epoch ms","title":"Msgtime To"},"description":"Inclusive upper bound, epoch ms"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":1,"default":500,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"include_samples","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Samples"}},{"name":"sample_limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Sample Limit"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReachabilityAuditOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/reachability-checks/latest":{"get":{"summary":"Get Latest Reachability Check","operationId":"get_latest_reachability_check_api_admin_reachability_checks_latest_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReachabilityCheckSnapshotOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/reachability-checks":{"post":{"summary":"Start Reachability Check","description":"Create/reuse a DB-guarded run and return before scanner work begins.","operationId":"start_reachability_check_api_admin_reachability_checks_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReachabilityCheckStartIn"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReachabilityCheckSnapshotOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/reachability-findings":{"get":{"summary":"List Reachability Findings","operationId":"list_reachability_findings_api_admin_reachability_findings_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"active","title":"Status"}},{"name":"reason","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},{"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":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReachabilityFindingListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dashboard":{"get":{"summary":"Get Dashboard","description":"Return dashboard aggregates scoped exclusively to the authenticated tenant.","operationId":"get_dashboard_api_admin_dashboard_get","parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Range"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search/contacts":{"get":{"summary":"Search Contacts","description":"Search contacts by display name or WeCom user ID.\nTenant-scoped: only returns contacts belonging to the authenticated tenant.\nName matches are ranked before userid matches.\nSearches both Contact.name/Contact.wecom_userid and AdminUser.name/wecom_user_id.","operationId":"search_contacts_api_search_contacts_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Search keyword for contact name or WeCom user ID","title":"Q"},"description":"Search keyword for contact name or WeCom user ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max rows to return (1–100)","default":20,"title":"Limit"},"description":"Max rows to return (1–100)"},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContactSearchResult"},"title":"Response Search Contacts Api Search Contacts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/search/messages":{"get":{"summary":"Search Messages","description":"Search archived messages by content and/or filter (RND-230).\nTenant-scoped: only returns messages belonging to the authenticated tenant.\n`q` is optional — with no keyword, at least one filter must be supplied\n(enforced below) so this never degrades into an unbounded table scan.\nWithout an explicit `msgtype` filter, only text messages are searched\n(v1 index scope, unchanged from before this change). Only messages that\nhave been successfully decrypted and are not revoked are ever returned.\nPagination uses cursor-based (msgtime:id) — same as conversation timeline.","operationId":"search_messages_api_search_messages_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Case-insensitive substring match on message content; optional when at least one filter is set","title":"Q"},"description":"Case-insensitive substring match on message content; optional when at least one filter is set"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max rows to return (1–100)","default":20,"title":"Limit"},"description":"Max rows to return (1–100)"},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cursor for pagination (msgtime:id format)","title":"Before"},"description":"Cursor for pagination (msgtime:id format)"},{"name":"date_range","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(1d|7d|30d|90d)$"},{"type":"null"}],"description":"Preset recency window","title":"Date Range"},"description":"Preset recency window"},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Lower bound on msgtime, ms epoch, inclusive","title":"Date From"},"description":"Lower bound on msgtime, ms epoch, inclusive"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Upper bound on msgtime, ms epoch, inclusive","title":"Date To"},"description":"Upper bound on msgtime, ms epoch, inclusive"},{"name":"user","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Contact-side participant userid(s); message must have one as sender or recipient","title":"User"},"description":"Contact-side participant userid(s); message must have one as sender or recipient"},{"name":"staff","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Staff-side participant userid(s); message must have one as sender or recipient","title":"Staff"},"description":"Staff-side participant userid(s); message must have one as sender or recipient"},{"name":"msgtype","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Message type(s); defaults to text-only when omitted","title":"Msgtype"},"description":"Message type(s); defaults to text-only when omitted"},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/sync-status":{"get":{"summary":"Get Sync Status","description":"Return only the authenticated tenant's archive-sync status.","operationId":"get_sync_status_api_admin_sync_status_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/sync-now":{"post":{"summary":"Sync Now","description":"Queue one real archive-worker run for the authenticated tenant.\n\nThe database status gives quick feedback for repeated clicks; the shared\nworker's ``flock`` remains the final concurrency guard across web,\nsystemd-timer, and event-triggered invocation paths.","operationId":"sync_now_api_admin_sync_now_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncNowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/audit-logs":{"get":{"summary":"List Audit Logs","operationId":"list_audit_logs_api_admin_audit_logs_get","parameters":[{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact match; comma-separated supports many values","title":"Action"},"description":"Exact match; comma-separated supports many values"},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated audit categories","title":"Category"},"description":"Comma-separated audit categories"},{"name":"include_system","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Set false to exclude system activity","title":"Include System"},"description":"Set false to exclude system activity"},{"name":"object_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object Type"}},{"name":"operator","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact admin_user_id; 'system' means admin_user_id IS NULL","title":"Operator"},"description":"Exact admin_user_id; 'system' means admin_user_id IS NULL"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ILIKE search of object_id / id / operator name / email","title":"Q"},"description":"ILIKE search of object_id / id / operator name / email"},{"name":"from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"created_at lower bound, ISO-8601","title":"From"},"description":"created_at lower bound, ISO-8601"},{"name":"to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"created_at upper bound, ISO-8601","title":"To"},"description":"created_at upper bound, ISO-8601"},{"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":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users":{"get":{"summary":"List Admin Users","description":"Return users belonging only to the authenticated user's tenant.","operationId":"list_admin_users_api_admin_users_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Per Page"}},{"name":"role","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(owner|admin|compliance|legal|readonlyaudit)$"},{"type":"null"}],"title":"Role"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(active|disabled)$"},{"type":"null"}],"title":"Status"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Q"}},{"name":"silent_days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Silent Days"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{user_id}":{"get":{"summary":"Get Admin User Detail","description":"Return one tenant-scoped console employee profile for the detail drawer.","operationId":"get_admin_user_detail_api_admin_users__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUserDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"summary":"Update User Status","description":"Enable or disable a user within the caller's tenant.","operationId":"update_user_status_api_admin_users__user_id__patch","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_StatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{user_id}/role":{"patch":{"summary":"Update User Role","description":"Change a tenant user's role, with an owner-only escalation boundary.","operationId":"update_user_role_api_admin_users__user_id__role_patch","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RoleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users/{user_id}/reset-password":{"post":{"summary":"Admin Reset Password","description":"Email a one-time password-reset link to an active tenant user.","operationId":"admin_reset_password_api_admin_users__user_id__reset_password_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/access-requests":{"get":{"summary":"List Access Requests","description":"Owner/admin only (AC-5) — ordinary roles cannot see requests, email\nhints, or identity information via this or any other endpoint.","operationId":"list_access_requests_api_admin_access_requests_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(pending|resolved)$"},{"type":"null"}],"title":"Status"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/access-requests/{request_id}/link":{"post":{"summary":"Link Access Request","description":"Bind a pending request to an explicitly chosen, existing account.\n\nNever triggered by an email or name match — the caller must name the\nexact target account id (AC-3). The owner-boundary check reuses\n_require_owner_authority unchanged: with no role/status change\nproposed, it reduces to exactly \"a non-owner actor cannot touch an\nowner-role target\", which is the correct rule here too — attaching a\nnew login path to an owner account is still an operation on that\naccount.","operationId":"link_access_request_api_admin_access_requests__request_id__link_post","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_LinkAccessRequestBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/access-requests/{request_id}/create-account":{"post":{"summary":"Create Account From Access Request","description":"Create a brand-new account from a pending request and bind it.\n\nThe requester never gets to choose their own role or status (AC-4) —\nboth are explicit choices made by the reviewing owner/admin, defaulted\nto nothing (role is required) so a client can't silently omit it and\nget an unintended default.","operationId":"create_account_from_access_request_api_admin_access_requests__request_id__create_account_post","parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_CreateAccountFromRequestBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/staff":{"get":{"summary":"List Internal Staff","description":"Return the tenant's internal staff with read-only message counts.","operationId":"list_internal_staff_api_admin_staff_get","parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Per Page"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Q"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffDirectoryPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/staff/{wecom_userid}/customers":{"get":{"summary":"List Staff Customers","description":"RND-374: the customers one internal staff member has interacted with.\n\nRead-only, tenant-scoped, sorted by last interaction; the staff\naccount's own status never hides the history (departed staff stay\nqueryable).","operationId":"list_staff_customers_api_admin_staff__wecom_userid__customers_get","parameters":[{"name":"wecom_userid","in":"path","required":true,"schema":{"type":"string","title":"Wecom Userid"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Per Page"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Q"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaffCustomersPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/avatars/{identity_type}/{avatar_id}":{"get":{"summary":"Get Contact Avatar","description":"Serve only cached avatar bytes after authentication and tenant scoping.\n\n``avatar_id`` is the database-local profile PK, not a WeCom identity or\nexternal URL. It is still fully tenant-scoped below; an ID from another\ntenant is indistinguishable from an absent image.","operationId":"get_contact_avatar_api_admin_avatars__identity_type___avatar_id__get","parameters":[{"name":"identity_type","in":"path","required":true,"schema":{"type":"string","title":"Identity Type"}},{"name":"avatar_id","in":"path","required":true,"schema":{"type":"integer","minimum":1,"title":"Avatar Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/settings/password":{"post":{"summary":"Change Password","description":"Verify the old password and set a new PBKDF2 password hash.","operationId":"change_password_api_admin_settings_password_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ChangePasswordBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/settings":{"get":{"summary":"Get Settings","description":"Return all registered settings without ever exposing secret plaintext.","operationId":"get_settings_api_admin_settings_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsGetOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Put Settings","description":"Atomically validate and persist a batch of deployment settings.","operationId":"put_settings_api_admin_settings_put","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsUpdateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/settings/export":{"get":{"summary":"Export Settings","description":"Export resolved settings as .env text without exposing secrets.","operationId":"export_settings_api_admin_settings_export_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/settings/bootstrap-status":{"get":{"summary":"Bootstrap Status","description":"Publicly report whether first-run bootstrap is still required.","operationId":"bootstrap_status_api_admin_settings_bootstrap_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Bootstrap Status Api Admin Settings Bootstrap Status Get"}}}}}}},"/api/admin/settings/bootstrap":{"post":{"summary":"Bootstrap Settings","description":"Perform the one-time, public initialization before any session exists.","operationId":"bootstrap_settings_api_admin_settings_bootstrap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_BootstrapBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Bootstrap Settings Api Admin Settings Bootstrap Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/settings/test-connection":{"post":{"summary":"Test Connection","description":"Test the selected saved integration without returning configuration values.","operationId":"test_connection_api_admin_settings_test_connection_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ConnectionTestBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Test Connection Api Admin Settings Test Connection Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/media":{"get":{"summary":"List Media","description":"List media belonging to the authenticated tenant only.","operationId":"list_media_api_admin_media_get","parameters":[{"name":"file_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated: image,file,voice,video","title":"File Type"},"description":"Comma-separated: image,file,voice,video"},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Return only the last N days by media creation time","title":"Days"},"description":"Return only the last N days by media creation time"},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"ISO8601 lower bound","title":"Since"},"description":"ISO8601 lower bound"},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"ISO8601 upper bound","title":"Until"},"description":"ISO8601 upper bound"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional file-name/content search","title":"Q"},"description":"Optional file-name/content search"},{"name":"favorited_only","in":"query","required":false,"schema":{"type":"boolean","description":"Return only active media favorites","default":false,"title":"Favorited Only"},"description":"Return only active media favorites"},{"name":"sort","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"newest|oldest|size_desc","default":"newest","title":"Sort"},"description":"newest|oldest|size_desc"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":24,"title":"Limit"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaLibraryPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/external-contacts":{"get":{"summary":"List External Contacts","description":"Return tenant-isolated identities for RND-341 and legacy list consumers.","operationId":"list_external_contacts_api_admin_external_contacts_get","parameters":[{"name":"company","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"}},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tags"}},{"name":"owner_wecom_userid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Wecom Userid"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Match employee remark, current nickname, or nickname history","title":"Q"},"description":"Match employee remark, current nickname, or nickname history"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":24,"title":"Limit"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalContactListPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/external-contacts/{external_userid}":{"get":{"summary":"Get External Contact Detail","description":"Return one tenant-scoped identity, employee remarks, history, and sessions.","operationId":"get_external_contact_detail_api_admin_external_contacts__external_userid__get","parameters":[{"name":"external_userid","in":"path","required":true,"schema":{"type":"string","title":"External Userid"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalContactDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/wecom/archive/events":{"get":{"summary":"Wecom Callback Get","description":"WeCom URL verification callback (encrypted / safe mode).\n\nCalled by WeCom when configuring the event server URL.\nDecrypts the echostr and returns the plaintext message.","operationId":"wecom_callback_get_api_wecom_archive_events_get","parameters":[{"name":"msg_signature","in":"query","required":true,"schema":{"type":"string","title":"Msg Signature"}},{"name":"timestamp","in":"query","required":true,"schema":{"type":"string","title":"Timestamp"}},{"name":"nonce","in":"query","required":true,"schema":{"type":"string","title":"Nonce"}},{"name":"echostr","in":"query","required":true,"schema":{"type":"string","title":"Echostr"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Wecom Callback Post","description":"WeCom event callback — verify/decrypt the request, then queue work.\n\nRND-107 keeps the acknowledgement independent from worker completion;\nRND-170 additionally queues one bounded targeted profile refresh for an\nexternal-contact change event.  The plaintext outer ToUserName narrows\nthe stored per-tenant credential candidates before decryption.","operationId":"wecom_callback_post_api_wecom_archive_events_post","parameters":[{"name":"msg_signature","in":"query","required":true,"schema":{"type":"string","title":"Msg Signature"}},{"name":"timestamp","in":"query","required":true,"schema":{"type":"string","title":"Timestamp"}},{"name":"nonce","in":"query","required":true,"schema":{"type":"string","title":"Nonce"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users":{"get":{"summary":"Admin Users Page","description":"User and console-seat management page. Requires a valid session.","operationId":"admin_users_page_admin_users_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/staff":{"get":{"summary":"Admin Staff Page","description":"Internal-staff directory page. Requires a valid session.","operationId":"admin_staff_page_admin_staff_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/audit-logs":{"get":{"summary":"Admin Audit Logs Page","description":"Render the authenticated shell; the browser fetches the paginated API.","operationId":"admin_audit_logs_page_admin_audit_logs_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/media":{"get":{"summary":"Admin Media Page","description":"Render the authenticated media library; data loads from its API.","operationId":"admin_media_page_admin_media_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/favorites":{"get":{"summary":"Admin Favorites Page","description":"Render the authenticated favorites library; data loads from its API.","operationId":"admin_favorites_page_admin_favorites_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/recycle-bin":{"get":{"summary":"Recycle Bin Page","description":"Render the tenant recycle bin; data loads from its API.","operationId":"recycle_bin_page_admin_recycle_bin_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/cleanup":{"get":{"summary":"Cleanup Page","description":"Render the bulk message-cleanup page; data loads from its API.","operationId":"cleanup_page_admin_cleanup_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/contacts":{"get":{"summary":"Admin Contacts Page","description":"Render the authenticated external contacts list page.","operationId":"admin_contacts_page_admin_contacts_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/conversations":{"get":{"summary":"Admin Conversations","description":"Conversation review console. Requires valid session.","operationId":"admin_conversations_admin_conversations_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/settings":{"get":{"summary":"Admin Settings Page","description":"Settings page (RND-302). Requires valid session.","operationId":"admin_settings_page_admin_settings_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/settings/init":{"get":{"summary":"Admin Settings Init","description":"Render the public first-run bootstrap shell until setup is complete.","operationId":"admin_settings_init_admin_settings_init_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/search":{"get":{"summary":"Admin Search Page","description":"Standalone search-results page (RND-229). Requires valid session.","operationId":"admin_search_page_admin_search_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/analytics":{"get":{"summary":"Admin Analytics","description":"Compatibility entry for the merged usage analytics page.","operationId":"admin_analytics_admin_analytics_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/exports":{"get":{"summary":"Admin Exports Page","description":"Owner data-portability page; APIs enforce the owner role.","operationId":"admin_exports_page_admin_exports_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/dashboard":{"get":{"summary":"Dashboard Page","description":"Formal tenant archive overview. Requires a valid session.","operationId":"dashboard_page_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/admin/diagnostics/reachability":{"get":{"summary":"Admin Diagnostics Reachability","description":"Archive health page backed by persistent reachability-check snapshots.","operationId":"admin_diagnostics_reachability_admin_diagnostics_reachability_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api/admin/usage":{"get":{"summary":"Get Usage Analytics","description":"Return aggregates only; tenant_id is obtained solely from the session.","operationId":"get_usage_analytics_api_admin_usage_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","enum":[7,30,90],"default":30,"title":"Days"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageAnalyticsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/messages":{"get":{"summary":"Admin Messages","operationId":"admin_messages_admin_messages_get","parameters":[{"name":"sender","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/messages/{msgid}":{"get":{"summary":"Admin Message Detail","operationId":"admin_message_detail_admin_messages__msgid__get","parameters":[{"name":"msgid","in":"path","required":true,"schema":{"type":"string","title":"Msgid"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/messages":{"get":{"summary":"Get Messages","operationId":"get_messages_api_messages_get","parameters":[{"name":"sender","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact sender user ID","title":"Sender"},"description":"Exact sender user ID"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Case-insensitive substring match on content_text","title":"Q"},"description":"Case-insensitive substring match on content_text"},{"name":"msgtype","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact message type (text, image, …)","title":"Msgtype"},"description":"Exact message type (text, image, …)"},{"name":"roomid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exact room ID; omit for 1:1 messages","title":"Roomid"},"description":"Exact room ID; omit for 1:1 messages"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max rows to return (1–100)","default":20,"title":"Limit"},"description":"Max rows to return (1–100)"},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MessageOut"},"title":"Response Get Messages Api Messages Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/messages/{msgid}":{"get":{"summary":"Get Message","operationId":"get_message_api_messages__msgid__get","parameters":[{"name":"msgid","in":"path","required":true,"schema":{"type":"string","title":"Msgid"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageDetailOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/v1/archive/groups/{room_id}/messages":{"get":{"tags":["MCP archive"],"summary":"Get Mcp Group Messages","operationId":"get_mcp_group_messages_api_internal_v1_archive_groups__room_id__messages_get","security":[{"McpGroupBearer":[]}],"parameters":[{"name":"room_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"title":"Room Id"}},{"name":"start_at","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"Start At"}},{"name":"end_at","in":"query","required":true,"schema":{"type":"string","format":"date-time","title":"End At"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Cursor"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpGroupMessagesPage"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/messages/deletion-status":{"get":{"tags":["message-deletion"],"summary":"Deletion Status","description":"Return whether the current tenant/role may delete archived messages.\n\nAny authenticated admin may read this so the console can hide/disable\nthe delete surface without a failing mutation call. ``can_delete`` is\nrole-gated (Owner/Admin); ``deletion_locked`` reflects the tenant's\ncompliance/legal hold, which fails every deletion closed (RND-362).","operationId":"deletion_status_api_admin_messages_deletion_status_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletionStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/messages/delete":{"post":{"tags":["message-deletion"],"summary":"Delete Messages","operationId":"delete_messages_api_admin_messages_delete_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageDeleteIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageDeleteOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/messages/recycle-bin":{"get":{"tags":["message-deletion"],"summary":"Recycle Bin","operationId":"recycle_bin_api_admin_messages_recycle_bin_get","parameters":[{"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":"msgtype","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by message type","title":"Msgtype"},"description":"Filter by message type"},{"name":"roomid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by conversation room id","title":"Roomid"},"description":"Filter by conversation room id"},{"name":"deleted_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by deleting admin user id","title":"Deleted By"},"description":"Filter by deleting admin user id"},{"name":"batch_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by cleanup task / delete batch id","title":"Batch Id"},"description":"Filter by cleanup task / delete batch id"},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO8601 lower bound on deleted_at","title":"Since"},"description":"ISO8601 lower bound on deleted_at"},{"name":"until","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO8601 upper bound on deleted_at","title":"Until"},"description":"ISO8601 upper bound on deleted_at"},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecycleBinOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/messages/recycle-bin/metrics":{"get":{"tags":["message-deletion"],"summary":"Recycle Bin Metrics Endpoint","operationId":"recycle_bin_metrics_endpoint_api_admin_messages_recycle_bin_metrics_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurgeMetricsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/messages/restore":{"post":{"tags":["message-deletion"],"summary":"Restore Deleted Messages","operationId":"restore_deleted_messages_api_admin_messages_restore_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageDeleteIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageDeleteOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/messages/purge":{"post":{"tags":["message-deletion"],"summary":"Purge Deleted Messages","description":"Irreversible permanent deletion of recycle-bin messages.\n\nRequires explicit confirmation and fails closed on the tenant\ncompliance hold. Media objects are only removed after the storage\nprovider confirms deletion; a failure keeps a retryable state instead\nof pretending the database was fully cleaned (RND-364).","operationId":"purge_deleted_messages_api_admin_messages_purge_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurgeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurgeOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/messages/cleanup/preview":{"post":{"tags":["message-deletion"],"summary":"Cleanup Preview","operationId":"cleanup_preview_api_admin_messages_cleanup_preview_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CleanupPreviewIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CleanupPreviewOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/messages/cleanup/tasks":{"post":{"tags":["message-deletion"],"summary":"Create Cleanup","operationId":"create_cleanup_api_admin_messages_cleanup_tasks_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CleanupTaskCreateIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CleanupTaskOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["message-deletion"],"summary":"List Cleanup Tasks","operationId":"list_cleanup_tasks_api_admin_messages_cleanup_tasks_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CleanupTaskListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/messages/cleanup/tasks/{task_id}":{"get":{"tags":["message-deletion"],"summary":"Get Cleanup","operationId":"get_cleanup_api_admin_messages_cleanup_tasks__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CleanupTaskOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/messages/cleanup/tasks/{task_id}/cancel":{"post":{"tags":["message-deletion"],"summary":"Cancel Cleanup","operationId":"cancel_cleanup_api_admin_messages_cleanup_tasks__task_id__cancel_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CleanupTaskOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/favorites":{"post":{"tags":["favorites"],"summary":"Add Favorite","operationId":"add_favorite_api_favorites_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteMutationIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteMutationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["favorites"],"summary":"Get Favorites","operationId":"get_favorites_api_favorites_get","parameters":[{"name":"object_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(message|media)$"},{"type":"null"}],"title":"Object Type"}},{"name":"media_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(image|video|voice|file)$"},{"type":"null"}],"title":"Media Type"}},{"name":"conversation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}],"title":"Conversation Id"}},{"name":"staff_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}],"title":"Staff Filter"}},{"name":"contact_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}],"title":"Contact Filter"}},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(staff|contact)$"},{"type":"null"}],"title":"Mode"}},{"name":"staff_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}],"title":"Staff Id"}},{"name":"contact_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}],"title":"Contact Id"}},{"name":"favorited_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":36},{"type":"null"}],"title":"Favorited By"}},{"name":"favorited_by_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}],"title":"Favorited By Name"}},{"name":"favorited_since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Favorited Since"}},{"name":"favorited_until","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Favorited Until"}},{"name":"message_since_ms","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Message Since Ms"}},{"name":"message_until_ms","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"title":"Message Until Ms"}},{"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":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoritePageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/favorites/batch":{"post":{"tags":["favorites"],"summary":"Mutate Favorite Batch","operationId":"mutate_favorite_batch_api_favorites_batch_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteBatchIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteMutationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/favorites/{object_type}/{object_id}":{"delete":{"tags":["favorites"],"summary":"Remove Favorite","operationId":"remove_favorite_api_favorites__object_type___object_id__delete","parameters":[{"name":"object_type","in":"path","required":true,"schema":{"type":"string","title":"Object Type"}},{"name":"object_id","in":"path","required":true,"schema":{"type":"string","title":"Object Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteMutationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/favorites/status":{"post":{"tags":["favorites"],"summary":"Favorite Status","operationId":"favorite_status_api_favorites_status_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteStatusIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/export/approve":{"post":{"tags":["export-approval"],"summary":"Approve Export","description":"Reconfirm the caller's password and issue a bound approval token.","operationId":"approve_export_api_admin_export_approve_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportApprovalRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/export/execute":{"post":{"tags":["export-approval"],"summary":"Execute Export","description":"Enforce the gate only; file generation belongs to C2-1.","operationId":"execute_export_api_admin_export_execute_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportExecuteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/export/record":{"post":{"tags":["export-audit"],"summary":"Record Export","description":"Record an export execution after consuming an approval when available.","operationId":"record_export_api_admin_export_record_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportRecordRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/exports/quota":{"get":{"tags":["exports"],"summary":"Get Export Quota","operationId":"get_export_quota_api_admin_exports_quota_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/exports/text":{"post":{"tags":["exports"],"summary":"Export Text","operationId":"export_text_api_admin_exports_text_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextExportRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/exports/media":{"post":{"tags":["exports"],"summary":"Request Media Export","operationId":"request_media_export_api_admin_exports_media_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaExportRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/exports/jobs":{"get":{"tags":["exports"],"summary":"List Export Jobs","operationId":"list_export_jobs_api_admin_exports_jobs_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/exports/jobs/{job_id}":{"get":{"tags":["exports"],"summary":"Get Export Job","operationId":"get_export_job_api_admin_exports_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/exports/jobs/{job_id}/download":{"get":{"tags":["exports"],"summary":"Download Export Job","operationId":"download_export_job_api_admin_exports_jobs__job_id__download_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/retention-config":{"get":{"summary":"Get Retention Config","description":"Return the authenticated tenant's policy, including its unconfigured state.","operationId":"get_retention_config_api_admin_retention_config_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Put Retention Config","description":"Create or update the policy unless this tenant has permanently locked it.","operationId":"put_retention_config_api_admin_retention_config_put","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/status":{"get":{"summary":"Get Onboarding Status","description":"Return whether the authenticated tenant has not completed onboarding.","operationId":"get_onboarding_status_api_onboarding_status_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/onboarding/complete":{"post":{"summary":"Complete Onboarding","description":"Mark onboarding complete once; subsequent calls preserve its timestamp.","operationId":"complete_onboarding_api_onboarding_complete_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingCompleteOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/product-analytics/events":{"post":{"tags":["product-analytics"],"summary":"Collect Product Analytics Event","description":"Best-effort browser collection with server-derived tenant identity.","operationId":"collect_product_analytics_event_api_product_analytics_events_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductAnalyticsEventIn"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductAnalyticsEventAcceptedOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/provisioning":{"get":{"summary":"Provisioning Waiting","operationId":"provisioning_waiting_admin_provisioning_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/provisioning/settings":{"get":{"summary":"Provisioning Settings","operationId":"provisioning_settings_admin_provisioning_settings_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/provisioning/status":{"get":{"summary":"Provisioning Status","description":"Onboarding status: lifecycle + the persisted activation-check state\nmachine (RND-388).  ``activate`` appears in allowed_actions only when the\ngates already passed and the tenant is waiting for promotion.","operationId":"provisioning_status_api_provisioning_status_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Provisioning Status Api Provisioning Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/provisioning/config":{"get":{"summary":"Get Provisioning Config","description":"Masked, tenant-scoped snapshot of the archive configuration.","operationId":"get_provisioning_config_api_provisioning_config_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Provisioning Config Api Provisioning Config Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Put Provisioning Config","description":"Persist wizard fields; blank values never overwrite existing secrets.","operationId":"put_provisioning_config_api_provisioning_config_put","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningConfigUpdateIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Put Provisioning Config Api Provisioning Config Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/provisioning/config/test":{"post":{"summary":"Test Provisioning Config","description":"Run local credential checks and a real WeCom connectivity probe.","operationId":"test_provisioning_config_api_provisioning_config_test_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Test Provisioning Config Api Provisioning Config Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/support":{"get":{"summary":"Support Page","operationId":"support_page_admin_support_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/api/ai/support/status":{"get":{"summary":"Support Status","operationId":"support_status_api_ai_support_status_get","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiSupportStatusOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/support/sessions":{"post":{"summary":"Create Session","operationId":"create_session_api_ai_support_sessions_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiChatSessionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/support/sessions/{chat_session_id}":{"delete":{"summary":"Delete Session","description":"User-initiated retention control (RND-357 AC: \"对话历史的...删除入口\n...必须明确\"). Deletes the session's own messages; the audit trail in\nai_query_audit_logs is retained separately under RND-359's retention\npolicy, matching how other audit logs in this codebase outlive the\nrecord they audit.","operationId":"delete_session_api_ai_support_sessions__chat_session_id__delete","parameters":[{"name":"chat_session_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Session Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/support/sessions/{chat_session_id}/messages":{"post":{"summary":"Send Message","operationId":"send_message_api_ai_support_sessions__chat_session_id__messages_post","parameters":[{"name":"chat_session_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Session Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/support/messages/{message_id}/feedback":{"post":{"summary":"Submit Feedback","operationId":"submit_feedback_api_ai_support_messages__message_id__feedback_post","parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"integer","title":"Message Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Submit Feedback Api Ai Support Messages  Message Id  Feedback Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/support/sessions/{chat_session_id}/handoff/preview":{"post":{"summary":"Preview Handoff","operationId":"preview_handoff_api_ai_support_sessions__chat_session_id__handoff_preview_post","parameters":[{"name":"chat_session_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Session Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffPreviewOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/support/sessions/{chat_session_id}/handoff":{"post":{"summary":"Submit Handoff","description":"The summary submitted here is exactly what the user previewed and\nwas free to edit — never regenerated server-side after the fact.","operationId":"submit_handoff_api_ai_support_sessions__chat_session_id__handoff_post","parameters":[{"name":"chat_session_id","in":"path","required":true,"schema":{"type":"string","title":"Chat Session Id"}},{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffSubmitIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai/support/feedback":{"post":{"summary":"Submit User Feedback","description":"RND-161 (T6): proactive feedback, independent of any AI conversation\n— this endpoint never requires an existing chat session.","operationId":"submit_user_feedback_api_ai_support_feedback_post","parameters":[{"name":"session_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserFeedbackIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserFeedbackOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health/live":{"get":{"summary":"Health Live","description":"Liveness only: the process can respond to HTTP at all. Does not\ntouch the database — a DB outage must not make this fail, or\norchestration tooling would kill/restart a process that isn't the\nactual problem. Use /health/ready (or /health, see below) to gate\ndeploys and load-balancer readiness.","operationId":"health_live_health_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/ready":{"get":{"summary":"Health Ready","operationId":"health_ready_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","description":"Kept as an alias for /health/ready (not liveness) for backward\ncompatibility: every existing caller (scripts/deploy_server.sh's\npublic check, external uptime monitoring) already treats this path\nas \"is the service actually usable\", and downgrading it to a\nliveness-only check would silently reintroduce the schema-drift gap\nthis endpoint exists to close.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"ActivityItem":{"properties":{"id":{"type":"string","title":"Id"},"badge":{"type":"string","title":"Badge"},"actor":{"type":"string","title":"Actor"},"description":{"type":"string","title":"Description"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"},"ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip"},"time":{"type":"string","title":"Time"}},"type":"object","required":["id","badge","actor","description","time"],"title":"ActivityItem"},"AdminUserDetail":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"wecom_user_id":{"type":"string","title":"Wecom User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"avatar_status":{"type":"string","title":"Avatar Status","default":"missing"},"role":{"type":"string","enum":["owner","admin","compliance","legal","readonlyaudit"],"title":"Role"},"status":{"type":"string","enum":["active","disabled"],"title":"Status"},"last_active_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Active At"},"msg_count_30d":{"type":"integer","title":"Msg Count 30D","default":0},"last_login_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Login At"}},"type":"object","required":["id","wecom_user_id","role","status"],"title":"AdminUserDetail"},"AdminUserListItem":{"properties":{"id":{"type":"string","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"wecom_user_id":{"type":"string","title":"Wecom User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"avatar_status":{"type":"string","title":"Avatar Status","default":"missing"},"role":{"type":"string","enum":["owner","admin","compliance","legal","readonlyaudit"],"title":"Role"},"status":{"type":"string","enum":["active","disabled"],"title":"Status"},"last_active_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Active At"},"msg_count_30d":{"type":"integer","title":"Msg Count 30D","default":0}},"type":"object","required":["id","wecom_user_id","role","status"],"title":"AdminUserListItem"},"AdminUserListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminUserListItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"}},"type":"object","required":["items","total","page","per_page"],"title":"AdminUserListOut"},"AiChatSessionOut":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","created_at"],"title":"AiChatSessionOut"},"AiSupportStatusOut":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"AiSupportStatusOut"},"AuditLogListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AuditLogOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["items","total","limit","offset","has_more"],"title":"AuditLogListOut"},"AuditLogOut":{"properties":{"id":{"type":"string","title":"Id"},"admin_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin User Id"},"actor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Name"},"action":{"type":"string","title":"Action"},"category":{"type":"string","title":"Category"},"object_type":{"type":"string","title":"Object Type"},"object_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Object Id"},"detail":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Detail"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","action","category","object_type","created_at"],"title":"AuditLogOut"},"BrandingStatusOut":{"properties":{"custom_branding_entitled":{"type":"boolean","title":"Custom Branding Entitled"},"custom_domain_entitled":{"type":"boolean","title":"Custom Domain Entitled"},"upgrade_required":{"type":"boolean","title":"Upgrade Required"},"upgrade_available":{"type":"boolean","title":"Upgrade Available"},"logo_configured":{"type":"boolean","title":"Logo Configured"},"favicon_configured":{"type":"boolean","title":"Favicon Configured"},"custom_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Domain"},"domain_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain State"},"domain_enabled":{"type":"boolean","title":"Domain Enabled"},"effective_domain_active":{"type":"boolean","title":"Effective Domain Active"},"verification_record_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verification Record Name"},"certificate_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Certificate Status"},"certificate_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Certificate Expires At"},"certificate_last_checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Certificate Last Checked At"},"domain_last_checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Domain Last Checked At"},"domain_failure_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain Failure Code"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["custom_branding_entitled","custom_domain_entitled","upgrade_required","upgrade_available","logo_configured","favicon_configured","custom_domain","domain_state","domain_enabled","effective_domain_active","verification_record_name","certificate_status","certificate_expires_at","certificate_last_checked_at","domain_last_checked_at","domain_failure_code","updated_at"],"title":"BrandingStatusOut"},"CleanupFilterIn":{"properties":{"date_from_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Date From Ms"},"date_to_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Date To Ms"},"older_than_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Older Than Days"},"roomid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Roomid"},"staff_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Staff Id"},"contact_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id"},"conversation_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Kind"},"msgtypes":{"items":{"type":"string"},"type":"array","title":"Msgtypes","default":[]},"has_media":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Media"},"media_min_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Media Min Bytes"},"media_max_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Media Max Bytes"},"include_favorited":{"type":"boolean","title":"Include Favorited","default":false}},"type":"object","title":"CleanupFilterIn"},"CleanupPreviewIn":{"properties":{"filter":{"$ref":"#/components/schemas/CleanupFilterIn"}},"type":"object","required":["filter"],"title":"CleanupPreviewIn"},"CleanupPreviewOut":{"properties":{"preview_version":{"type":"string","title":"Preview Version"},"matched":{"type":"integer","title":"Matched"},"conversation_count":{"type":"integer","title":"Conversation Count"},"contact_count":{"type":"integer","title":"Contact Count"},"staff_count":{"type":"integer","title":"Staff Count"},"msgtype_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Msgtype Counts"},"text_bytes_estimate":{"type":"integer","title":"Text Bytes Estimate"},"media_bytes":{"type":"integer","title":"Media Bytes"},"shared_media_bytes":{"type":"integer","title":"Shared Media Bytes"},"releasable_bytes":{"type":"integer","title":"Releasable Bytes"},"favorited_count":{"type":"integer","title":"Favorited Count"},"locked_count":{"type":"integer","title":"Locked Count"},"earliest_msgtime":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Earliest Msgtime"},"latest_msgtime":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latest Msgtime"},"summary":{"type":"string","title":"Summary"}},"type":"object","required":["preview_version","matched","conversation_count","contact_count","staff_count","msgtype_counts","text_bytes_estimate","media_bytes","shared_media_bytes","releasable_bytes","favorited_count","locked_count","earliest_msgtime","latest_msgtime","summary"],"title":"CleanupPreviewOut"},"CleanupTaskCreateIn":{"properties":{"filter":{"$ref":"#/components/schemas/CleanupFilterIn"},"preview_version":{"type":"string","title":"Preview Version"},"confirmation":{"type":"string","title":"Confirmation"}},"type":"object","required":["filter","preview_version","confirmation"],"title":"CleanupTaskCreateIn"},"CleanupTaskListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CleanupTaskOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"CleanupTaskListOut"},"CleanupTaskOut":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"filter_summary":{"type":"string","title":"Filter Summary"},"preview_version":{"type":"string","title":"Preview Version"},"preview_matched":{"type":"integer","title":"Preview Matched"},"total_matched":{"type":"integer","title":"Total Matched"},"succeeded":{"type":"integer","title":"Succeeded"},"skipped":{"type":"integer","title":"Skipped"},"failed":{"type":"integer","title":"Failed"},"locked":{"type":"integer","title":"Locked"},"moved_bytes":{"type":"integer","title":"Moved Bytes"},"releasable_bytes":{"type":"integer","title":"Releasable Bytes"},"failure_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Failure Summary"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Finished At"},"canceled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Canceled At"}},"type":"object","required":["id","status","filter_summary","preview_version","preview_matched","total_matched","succeeded","skipped","failed","locked","moved_bytes","releasable_bytes","error_message","created_at","started_at","finished_at","canceled_at"],"title":"CleanupTaskOut"},"ContactOut":{"properties":{"contact_id":{"type":"string","title":"Contact Id"},"display_name":{"type":"string","title":"Display Name"},"raw_id":{"type":"string","title":"Raw Id"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"avatar_status":{"type":"string","title":"Avatar Status","default":"missing"}},"type":"object","required":["contact_id","display_name","raw_id"],"title":"ContactOut"},"ContactSearchResult":{"properties":{"wecom_userid":{"type":"string","title":"Wecom Userid"},"display_name":{"type":"string","title":"Display Name"},"match_field":{"type":"string","title":"Match Field"},"match_context_userid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Context Userid"},"is_external_contact":{"type":"boolean","title":"Is External Contact","default":false}},"type":"object","required":["wecom_userid","display_name","match_field"],"title":"ContactSearchResult"},"ConversationDetailOut":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"message_count":{"type":"integer","title":"Message Count"},"decrypted_percent":{"type":"number","title":"Decrypted Percent"},"participants":{"items":{"$ref":"#/components/schemas/ConversationParticipantOut"},"type":"array","title":"Participants"}},"type":"object","required":["conversation_id","message_count","decrypted_percent","participants"],"title":"ConversationDetailOut","description":"Archive Console v2 (design import) -- conversation-level stats and\ninferred participants for the review console's 会话信息 panel. Additive:\ndoes not change ConversationOut or any other existing response shape."},"ConversationMessagesOut":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/TimelineMessageOut"},"type":"array","title":"Messages"},"pagination":{"$ref":"#/components/schemas/PaginationOut"},"room_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Room Display Name"}},"type":"object","required":["messages","pagination"],"title":"ConversationMessagesOut"},"ConversationOut":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"conversation_type":{"type":"string","title":"Conversation Type"},"display_name":{"type":"string","title":"Display Name"},"raw_id":{"type":"string","title":"Raw Id"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"avatar_status":{"type":"string","title":"Avatar Status","default":"missing"},"roomid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Roomid"},"monitored_account_ids":{"items":{"type":"string"},"type":"array","title":"Monitored Account Ids"},"monitored_account_raw_ids":{"items":{"type":"string"},"type":"array","title":"Monitored Account Raw Ids"},"monitored_account_display_names":{"items":{"type":"string"},"type":"array","title":"Monitored Account Display Names"},"contact_ids":{"items":{"type":"string"},"type":"array","title":"Contact Ids"},"contact_raw_ids":{"items":{"type":"string"},"type":"array","title":"Contact Raw Ids"},"contact_display_names":{"items":{"type":"string"},"type":"array","title":"Contact Display Names"},"room_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Room Display Name"},"room_raw_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Room Raw Id"},"last_message_time":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Message Time"},"last_message_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Message Text"},"message_count":{"type":"integer","title":"Message Count"},"latest_sender_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Sender Id"},"latest_sender_raw_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Sender Raw Id"},"latest_sender_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Sender Display Name"},"review_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Status"},"ai_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Status"},"ai_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Summary"}},"type":"object","required":["conversation_id","conversation_type","display_name","raw_id","monitored_account_ids","monitored_account_raw_ids","monitored_account_display_names","contact_ids","contact_raw_ids","contact_display_names","message_count"],"title":"ConversationOut"},"ConversationParticipantOut":{"properties":{"id":{"type":"string","title":"Id"},"raw_id":{"type":"string","title":"Raw Id"},"display_name":{"type":"string","title":"Display Name"},"role":{"type":"string","title":"Role"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"avatar_status":{"type":"string","title":"Avatar Status","default":"missing"}},"type":"object","required":["id","raw_id","display_name","role"],"title":"ConversationParticipantOut","description":"One participant INFERRED from this conversation's archived messages\n(every distinct sender/recipient observed among them) -- never a live\nWeCom room roster, which this system has no sync for. See\nGET /api/conversations/{conversation_id}/detail."},"DashboardOut":{"properties":{"range_days":{"type":"integer","title":"Range Days"},"days":{"type":"integer","title":"Days"},"total_messages":{"type":"integer","title":"Total Messages"},"storage_bytes":{"type":"integer","title":"Storage Bytes"},"staff_count":{"type":"integer","title":"Staff Count"},"silent_staff_30d":{"type":"integer","title":"Silent Staff 30D"},"sync_status":{"type":"string","title":"Sync Status"},"sync_healthy":{"type":"boolean","title":"Sync Healthy"},"daily_series":{"items":{"$ref":"#/components/schemas/DayBucket"},"type":"array","title":"Daily Series"},"recent_activity":{"items":{"$ref":"#/components/schemas/ActivityItem"},"type":"array","title":"Recent Activity"},"generated_at":{"type":"string","title":"Generated At"},"total_archived_messages":{"type":"integer","title":"Total Archived Messages"},"archive_coverage_days":{"type":"integer","title":"Archive Coverage Days"},"first_archived_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Archived At"},"last_archived_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Archived At"},"archive_status":{"type":"string","title":"Archive Status"},"sync_updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sync Updated At"},"archive_configured":{"type":"boolean","title":"Archive Configured"},"can_manage_settings":{"type":"boolean","title":"Can Manage Settings"},"type_composition":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Type Composition"},"storage_composition":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Storage Composition"},"hourly_distribution":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Hourly Distribution"},"insight_errors":{"additionalProperties":{"type":"string"},"type":"object","title":"Insight Errors"},"annual_plan_expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Annual Plan Expires At"}},"type":"object","required":["range_days","days","total_messages","storage_bytes","staff_count","silent_staff_30d","sync_status","sync_healthy","daily_series","recent_activity","generated_at","total_archived_messages","archive_coverage_days","archive_status","archive_configured","can_manage_settings","type_composition","storage_composition","hourly_distribution","insight_errors"],"title":"DashboardOut"},"DayBucket":{"properties":{"date":{"type":"string","title":"Date"},"text_count":{"type":"integer","title":"Text Count"},"media_count":{"type":"integer","title":"Media Count"}},"type":"object","required":["date","text_count","media_count"],"title":"DayBucket"},"DeletionStatusOut":{"properties":{"can_delete":{"type":"boolean","title":"Can Delete"},"deletion_locked":{"type":"boolean","title":"Deletion Locked"}},"type":"object","required":["can_delete","deletion_locked"],"title":"DeletionStatusOut"},"DisplayNameUpdateIn":{"properties":{"kind":{"type":"string","enum":["room","user"],"title":"Kind"},"target_id":{"type":"string","maxLength":128,"minLength":1,"title":"Target Id"},"display_name":{"type":"string","maxLength":64,"title":"Display Name","default":""}},"additionalProperties":false,"type":"object","required":["kind","target_id"],"title":"DisplayNameUpdateIn","description":"One label for one archived target; any other key is a 422."},"DisplayNameUpdateOut":{"properties":{"ok":{"type":"boolean","title":"Ok","default":true},"kind":{"type":"string","title":"Kind"},"target_id":{"type":"string","title":"Target Id"},"display_name":{"type":"string","title":"Display Name"}},"type":"object","required":["kind","target_id","display_name"],"title":"DisplayNameUpdateOut"},"DomainConfigureIn":{"properties":{"hostname":{"type":"string","maxLength":253,"minLength":1,"title":"Hostname"}},"additionalProperties":false,"type":"object","required":["hostname"],"title":"DomainConfigureIn","description":"The one hostname a tenant wants the managed edge to serve."},"ExportApprovalRequest":{"properties":{"password":{"type":"string","title":"Password"},"params":{"additionalProperties":true,"type":"object","title":"Params"}},"type":"object","required":["password","params"],"title":"ExportApprovalRequest"},"ExportExecuteRequest":{"properties":{"approval_token":{"type":"string","title":"Approval Token"},"params":{"additionalProperties":true,"type":"object","title":"Params"}},"type":"object","required":["approval_token","params"],"title":"ExportExecuteRequest"},"ExportRecordRequest":{"properties":{"format":{"type":"string","title":"Format","default":"csv"},"scope":{"$ref":"#/components/schemas/ExportRecordScope"},"approval_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Token"}},"type":"object","title":"ExportRecordRequest"},"ExportRecordScope":{"properties":{"conversation_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Conversation Ids"},"date_from":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Date From"},"date_to":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Date To"},"msgtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Msgtype"}},"type":"object","title":"ExportRecordScope","description":"Metadata-only filters defining the records covered by an export."},"ExternalContactDetail":{"properties":{"id":{"type":"integer","title":"Id"},"external_userid":{"type":"string","title":"External Userid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"display_name":{"type":"string","title":"Display Name"},"current_nickname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Nickname"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"avatar_status":{"type":"string","title":"Avatar Status","default":"missing"},"avatar_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Avatar Synced At"},"follow_remarks":{"items":{"$ref":"#/components/schemas/ExternalContactFollowRemark"},"type":"array","title":"Follow Remarks"},"search_matches":{"items":{"$ref":"#/components/schemas/ExternalContactSearchMatch"},"type":"array","title":"Search Matches"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"owner_wecom_userid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Wecom Userid"},"owner_display_name":{"type":"string","title":"Owner Display Name"},"last_interaction_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Interaction At"},"message_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Message Count"},"nickname_history":{"items":{"$ref":"#/components/schemas/ExternalContactNicknameHistoryItem"},"type":"array","title":"Nickname History"},"conversations":{"items":{"$ref":"#/components/schemas/ConversationOut"},"type":"array","title":"Conversations"},"related_staff":{"items":{"$ref":"#/components/schemas/RelatedStaffItem"},"type":"array","title":"Related Staff"}},"type":"object","required":["id","external_userid","display_name","tags","owner_display_name","conversations"],"title":"ExternalContactDetail"},"ExternalContactFollowRemark":{"properties":{"follow_userid":{"type":"string","title":"Follow Userid"},"follow_user_display_name":{"type":"string","title":"Follow User Display Name"},"remark":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remark"},"is_active":{"type":"boolean","title":"Is Active"},"observed_at":{"type":"string","format":"date-time","title":"Observed At"}},"type":"object","required":["follow_userid","follow_user_display_name","is_active","observed_at"],"title":"ExternalContactFollowRemark","description":"An employee-scoped current/historical follow relationship."},"ExternalContactListItem":{"properties":{"id":{"type":"integer","title":"Id"},"external_userid":{"type":"string","title":"External Userid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"display_name":{"type":"string","title":"Display Name"},"current_nickname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Nickname"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"avatar_status":{"type":"string","title":"Avatar Status","default":"missing"},"avatar_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Avatar Synced At"},"follow_remarks":{"items":{"$ref":"#/components/schemas/ExternalContactFollowRemark"},"type":"array","title":"Follow Remarks"},"search_matches":{"items":{"$ref":"#/components/schemas/ExternalContactSearchMatch"},"type":"array","title":"Search Matches"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"owner_wecom_userid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Wecom Userid"},"owner_display_name":{"type":"string","title":"Owner Display Name"},"last_interaction_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Interaction At"},"message_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Message Count"}},"type":"object","required":["id","external_userid","display_name","tags","owner_display_name"],"title":"ExternalContactListItem"},"ExternalContactListPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ExternalContactListItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More"},"available_tags":{"items":{"type":"string"},"type":"array","title":"Available Tags"}},"type":"object","required":["items","total","has_more"],"title":"ExternalContactListPage"},"ExternalContactNicknameHistoryItem":{"properties":{"old_nickname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Old Nickname"},"new_nickname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"New Nickname"},"observed_at":{"type":"string","format":"date-time","title":"Observed At"}},"type":"object","required":["observed_at"],"title":"ExternalContactNicknameHistoryItem","description":"A normalized customer-nickname state transition observed by the system."},"ExternalContactSearchMatch":{"properties":{"match_type":{"type":"string","title":"Match Type"},"follow_userid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Follow Userid"}},"type":"object","required":["match_type"],"title":"ExternalContactSearchMatch","description":"One way a search term matched this same external identity."},"FavoriteBatchIn":{"properties":{"action":{"type":"string","enum":["favorite","unfavorite"],"title":"Action"},"items":{"items":{"$ref":"#/components/schemas/FavoriteObjectIn"},"type":"array","maxItems":100,"minItems":1,"title":"Items"}},"additionalProperties":false,"type":"object","required":["action","items"],"title":"FavoriteBatchIn"},"FavoriteItemOut":{"properties":{"favorite_id":{"type":"string","title":"Favorite Id"},"object_type":{"type":"string","enum":["message","media"],"title":"Object Type"},"object_id":{"type":"string","title":"Object Id"},"favorited_by_admin_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Favorited By Admin User Id"},"favorited_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Favorited By Name"},"favorited_at":{"type":"string","format":"date-time","title":"Favorited At"},"source_page":{"anyOf":[{"type":"string","enum":["messages","media","favorites"]},{"type":"null"}],"title":"Source Page"},"message_time_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Message Time Ms"},"message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Id"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"conversation_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Name"},"conversation_type":{"anyOf":[{"type":"string","enum":["direct","group"]},{"type":"null"}],"title":"Conversation Type"},"staff_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Staff Id"},"staff_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Staff Name"},"contact_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Id"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"focus_entity_type":{"anyOf":[{"type":"string","enum":["staff","contact"]},{"type":"null"}],"title":"Focus Entity Type"},"focus_entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Focus Entity Id"},"sender_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Id"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"},"message_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Type"},"preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview"},"media_file_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Media File Id"},"media_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Type"},"media_mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Mime Type"},"media_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Media Size Bytes"},"media_download_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Download Status"},"media_item_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Item Path"}},"type":"object","required":["favorite_id","object_type","object_id","favorited_by_admin_user_id","favorited_at"],"title":"FavoriteItemOut"},"FavoriteMutationIn":{"properties":{"object_type":{"type":"string","enum":["message","media"],"title":"Object Type"},"object_id":{"type":"string","maxLength":64,"minLength":1,"title":"Object Id"},"source_page":{"anyOf":[{"type":"string","enum":["messages","media","favorites"]},{"type":"null"}],"title":"Source Page"}},"additionalProperties":false,"type":"object","required":["object_type","object_id"],"title":"FavoriteMutationIn"},"FavoriteMutationItemOut":{"properties":{"object_type":{"type":"string","enum":["message","media"],"title":"Object Type"},"object_id":{"type":"string","title":"Object Id"},"result":{"type":"string","enum":["favorited","already_favorited","unfavorited","already_unfavorited","not_found"],"title":"Result"},"duplicate":{"type":"boolean","title":"Duplicate","default":false}},"type":"object","required":["object_type","object_id","result"],"title":"FavoriteMutationItemOut"},"FavoriteMutationOut":{"properties":{"requested":{"type":"integer","title":"Requested"},"unique":{"type":"integer","title":"Unique"},"applied":{"type":"integer","title":"Applied"},"unchanged":{"type":"integer","title":"Unchanged"},"not_found":{"type":"integer","title":"Not Found"},"items":{"items":{"$ref":"#/components/schemas/FavoriteMutationItemOut"},"type":"array","title":"Items"}},"type":"object","required":["requested","unique","applied","unchanged","not_found","items"],"title":"FavoriteMutationOut"},"FavoriteObjectIn":{"properties":{"object_type":{"type":"string","enum":["message","media"],"title":"Object Type"},"object_id":{"type":"string","maxLength":64,"minLength":1,"title":"Object Id"},"source_page":{"anyOf":[{"type":"string","enum":["messages","media","favorites"]},{"type":"null"}],"title":"Source Page"}},"additionalProperties":false,"type":"object","required":["object_type","object_id"],"title":"FavoriteObjectIn","description":"Canonical target identity: archive msgid or tenant MediaFile.id."},"FavoritePageOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FavoriteItemOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["items","total","limit","offset","has_more"],"title":"FavoritePageOut"},"FavoriteStatusIn":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FavoriteObjectIn"},"type":"array","maxItems":100,"minItems":1,"title":"Items"}},"additionalProperties":false,"type":"object","required":["items"],"title":"FavoriteStatusIn"},"FavoriteStatusItemOut":{"properties":{"object_type":{"type":"string","enum":["message","media"],"title":"Object Type"},"object_id":{"type":"string","title":"Object Id"},"result":{"type":"string","enum":["found","not_found"],"title":"Result"},"is_favorited":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Favorited"},"duplicate":{"type":"boolean","title":"Duplicate","default":false}},"type":"object","required":["object_type","object_id","result"],"title":"FavoriteStatusItemOut"},"FavoriteStatusOut":{"properties":{"requested":{"type":"integer","title":"Requested"},"unique":{"type":"integer","title":"Unique"},"items":{"items":{"$ref":"#/components/schemas/FavoriteStatusItemOut"},"type":"array","title":"Items"}},"type":"object","required":["requested","unique","items"],"title":"FavoriteStatusOut"},"FeedbackIn":{"properties":{"helpful":{"type":"boolean","title":"Helpful"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["helpful"],"title":"FeedbackIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HandoffOut":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","status"],"title":"HandoffOut"},"HandoffPreviewOut":{"properties":{"summary":{"type":"string","title":"Summary"}},"type":"object","required":["summary"],"title":"HandoffPreviewOut"},"HandoffSubmitIn":{"properties":{"summary":{"type":"string","title":"Summary"},"contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["summary"],"title":"HandoffSubmitIn"},"McpGroupMessage":{"properties":{"msgid":{"type":"string","title":"Msgid"},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender"},"msgtime":{"type":"integer","title":"Msgtime"},"content_text":{"type":"string","title":"Content Text"}},"type":"object","required":["msgid","sender","msgtime","content_text"],"title":"McpGroupMessage"},"McpGroupMessagesPage":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/McpGroupMessage"},"type":"array","title":"Messages"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"}},"type":"object","required":["messages","next_cursor"],"title":"McpGroupMessagesPage"},"MediaAccessOut":{"properties":{"media_id":{"type":"integer","title":"Media Id"},"storage_backend":{"type":"string","title":"Storage Backend"},"access_type":{"type":"string","title":"Access Type"},"url":{"type":"string","title":"Url"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"content_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Type"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes"}},"type":"object","required":["media_id","storage_backend","access_type","url"],"title":"MediaAccessOut","description":"Unified media access descriptor (RND-187) — the one shape the\nfrontend consumes regardless of storage_backend, so it never needs to\nunderstand Qiniu vs local storage details, read storage_ref, or\nconstruct a media.example.com URL itself.\n\naccess_type=\"signed_url\": url is a short-lived, browser-usable Qiniu\nsigned URL good until expires_at; the browser fetches it directly, no\nFastAPI proxying of image bytes.\naccess_type=\"proxy\": url is this backend's own authenticated route\n(unchanged local-media behavior); expires_at is None since the URL\nitself carries no time-boxed credential — the session cookie is what\nauthorizes each request."},"MediaExportRequest":{"properties":{"approval_token":{"type":"string","maxLength":512,"minLength":20,"title":"Approval Token"}},"type":"object","required":["approval_token"],"title":"MediaExportRequest"},"MediaFileListItem":{"properties":{"id":{"type":"integer","title":"Id"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"file_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size"},"image_width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Image Width"},"image_height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Image Height"},"download_status":{"type":"string","title":"Download Status"},"storage_backend":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Storage Backend"},"has_thumbnail":{"type":"boolean","title":"Has Thumbnail","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"message_id":{"type":"integer","title":"Message Id"},"msgid":{"type":"string","title":"Msgid"},"conversation_id":{"type":"string","title":"Conversation Id"},"session_title":{"type":"string","title":"Session Title"},"room_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Room Id"},"msgtime":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Msgtime"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["id","download_status","created_at","message_id","msgid","conversation_id","session_title"],"title":"MediaFileListItem","description":"Safe media metadata for the admin media-library grid.\n\nStorage references and other sensitive media-file fields are deliberately\nabsent. ``storage_backend`` is only the provider type; ``has_thumbnail``\ndoes not expose its storage reference."},"MediaLibraryPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MediaFileListItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["items","total","has_more"],"title":"MediaLibraryPage"},"MessageDeleteIn":{"properties":{"message_ids":{"items":{"type":"string"},"type":"array","maxItems":200,"minItems":1,"title":"Message Ids"},"reason":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Reason"}},"type":"object","required":["message_ids"],"title":"MessageDeleteIn"},"MessageDeleteOut":{"properties":{"deleted":{"type":"integer","title":"Deleted"},"already_deleted":{"type":"integer","title":"Already Deleted"},"not_found":{"type":"integer","title":"Not Found"},"deleted_message_ids":{"items":{"type":"string"},"type":"array","title":"Deleted Message Ids","default":[]}},"type":"object","required":["deleted","already_deleted","not_found"],"title":"MessageDeleteOut"},"MessageDetailOut":{"properties":{"msgid":{"type":"string","title":"Msgid"},"seq":{"type":"integer","title":"Seq"},"msgtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Msgtype"},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender"},"roomid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Roomid"},"msgtime":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Msgtime"},"content_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Text"},"decrypt_status":{"type":"string","title":"Decrypt Status"},"recipients":{"items":{"$ref":"#/components/schemas/RecipientOut"},"type":"array","title":"Recipients"}},"type":"object","required":["msgid","seq","msgtype","action","sender","roomid","msgtime","content_text","decrypt_status","recipients"],"title":"MessageDetailOut"},"MessageOut":{"properties":{"msgid":{"type":"string","title":"Msgid"},"seq":{"type":"integer","title":"Seq"},"msgtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Msgtype"},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender"},"roomid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Roomid"},"msgtime":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Msgtime"},"content_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Text"},"decrypt_status":{"type":"string","title":"Decrypt Status"}},"type":"object","required":["msgid","seq","msgtype","sender","roomid","msgtime","content_text","decrypt_status"],"title":"MessageOut"},"MessageSearchPagination":{"properties":{"has_older":{"type":"boolean","title":"Has Older"},"next_before":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Before"}},"type":"object","required":["has_older"],"title":"MessageSearchPagination"},"MessageSearchResponse":{"properties":{"results":{"items":{"$ref":"#/components/schemas/MessageSearchResult"},"type":"array","title":"Results"},"pagination":{"$ref":"#/components/schemas/MessageSearchPagination"}},"type":"object","required":["results","pagination"],"title":"MessageSearchResponse"},"MessageSearchResult":{"properties":{"msgid":{"type":"string","title":"Msgid"},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender"},"sender_display_name":{"type":"string","title":"Sender Display Name"},"content_snippet":{"type":"string","title":"Content Snippet"},"msgtime":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Msgtime"},"roomid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Roomid"},"conversation_id":{"type":"string","title":"Conversation Id"},"conversation_type":{"type":"string","title":"Conversation Type"},"conversation_name":{"type":"string","title":"Conversation Name"},"match_position":{"type":"integer","title":"Match Position"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"msgtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Msgtype"},"contact_ids":{"items":{"type":"string"},"type":"array","title":"Contact Ids","default":[]},"staff_ids":{"items":{"type":"string"},"type":"array","title":"Staff Ids","default":[]}},"type":"object","required":["msgid","sender","sender_display_name","content_snippet","msgtime","roomid","conversation_id","conversation_type","conversation_name","match_position"],"title":"MessageSearchResult"},"MonitoredAccountOut":{"properties":{"monitored_account_id":{"type":"string","title":"Monitored Account Id"},"display_name":{"type":"string","title":"Display Name"},"staff_id":{"type":"string","title":"Staff Id"},"raw_id":{"type":"string","title":"Raw Id"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"avatar_status":{"type":"string","title":"Avatar Status","default":"missing"},"seat_status":{"type":"string","title":"Seat Status"},"is_active_archive_seat":{"type":"boolean","title":"Is Active Archive Seat"},"latest_message_time":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latest Message Time"},"conversation_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Conversation Count"}},"type":"object","required":["monitored_account_id","display_name","staff_id","raw_id","seat_status","is_active_archive_seat"],"title":"MonitoredAccountOut"},"NestedMediaAccessOut":{"properties":{"storage_backend":{"type":"string","title":"Storage Backend"},"access_type":{"type":"string","title":"Access Type"},"url":{"type":"string","title":"Url"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Size Bytes"}},"type":"object","required":["storage_backend","access_type","url"],"title":"NestedMediaAccessOut","description":"Public access descriptor for a nested mixed/chatrecord media item\n(RND-200 QA fix — security remediation). Deliberately a SEPARATE model\nfrom MediaAccessOut, not that model reused: MediaAccessOut.media_id\nexposes the internal MediaFile primary key, which was an accepted,\npre-existing exposure for the single-media-per-message top-level\ncontract (see get_message_media_access) but is NOT part of the\napproved nested-media public contract — the parent message + nested\nnode path is the only public handle nested media is ever looked up\nby, and no internal database identifier may accompany it.\n\nEvery other field mirrors MediaAccessOut's meaning exactly\n(access_type=\"proxy\" vs \"signed_url\", expires_at only set for the\nlatter) so nested and top-level media remain trivially similar for\nany consumer that already understands one of the two shapes — only\nthe internal-id field is omitted, and mime_type/filename are named to\nmatch the per-node structured_content descriptor's own field names\n(see _build_nested_media_descriptor) rather than MediaAccessOut's\ncontent_type, for consistency within the nested contract itself.\nfilename is always None today (no media type in this system carries\none — see _build_nested_media_descriptor's docstring) but is kept as\nan explicit, documented field rather than omitted, matching the\nshape independent QA approved."},"OnboardingCompleteOut":{"properties":{"first_run":{"type":"boolean","title":"First Run"}},"type":"object","required":["first_run"],"title":"OnboardingCompleteOut"},"OnboardingStatusOut":{"properties":{"first_run":{"type":"boolean","title":"First Run"}},"type":"object","required":["first_run"],"title":"OnboardingStatusOut"},"OverviewOut":{"properties":{"archived_days":{"type":"integer","title":"Archived Days"},"total_messages":{"type":"integer","title":"Total Messages"},"avg_daily":{"type":"number","title":"Avg Daily"},"storage_bytes":{"type":"integer","title":"Storage Bytes"}},"type":"object","required":["archived_days","total_messages","avg_daily","storage_bytes"],"title":"OverviewOut"},"PaginationOut":{"properties":{"has_older":{"type":"boolean","title":"Has Older"},"next_before":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Before"}},"type":"object","required":["has_older"],"title":"PaginationOut"},"PreferencesOut":{"properties":{"theme":{"type":"string","title":"Theme"},"locale":{"type":"string","title":"Locale"}},"type":"object","required":["theme","locale"],"title":"PreferencesOut"},"PreferencesUpdate":{"properties":{"theme":{"anyOf":[{"type":"string","enum":["light","dark"]},{"type":"null"}],"title":"Theme"},"locale":{"anyOf":[{"type":"string","enum":["zh-CN","zh-TW","en"]},{"type":"null"}],"title":"Locale"}},"additionalProperties":false,"type":"object","title":"PreferencesUpdate","description":"Partial update of the current user's UI preferences."},"ProductAnalyticsEventAcceptedOut":{"properties":{"accepted":{"type":"boolean","title":"Accepted","default":true}},"type":"object","title":"ProductAnalyticsEventAcceptedOut"},"ProductAnalyticsEventIn":{"properties":{"event_id":{"type":"string","format":"uuid","title":"Event Id"},"event_name":{"type":"string","enum":["product.conversation.review_opened.v1","product.directory.view_selected.v1","product.directory.subject_selected.v1","product.conversation.detail_opened.v1","product.conversation.older_messages_loaded.v1","product.search.executed.v1","product.search.filter_applied.v1","product.media.preview_opened.v1","product.settings.opened.v1"],"title":"Event Name"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"},"view_kind":{"anyOf":[{"type":"string","enum":["employee","contact"]},{"type":"null"}],"title":"View Kind"},"subject_kind":{"anyOf":[{"type":"string","enum":["employee","contact"]},{"type":"null"}],"title":"Subject Kind"},"search_scope":{"anyOf":[{"type":"string","enum":["contact_nickname","message_content","combined"]},{"type":"null"}],"title":"Search Scope"},"filter_dimension":{"anyOf":[{"type":"string","enum":["date","person","message_type"]},{"type":"null"}],"title":"Filter Dimension"},"filter_action":{"anyOf":[{"type":"string","enum":["applied","cleared"]},{"type":"null"}],"title":"Filter Action"}},"additionalProperties":false,"type":"object","required":["event_id","event_name","occurred_at"],"title":"ProductAnalyticsEventIn","description":"One allowlisted browser action, without identity or content fields.\n\nTenant and actor identity are derived by the server from the authenticated\nsession.  Event-specific attributes are top-level so Pydantic rejects\narbitrary nested telemetry payloads."},"ProvisioningConfigUpdateIn":{"properties":{"archive_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Archive Secret"},"private_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Private Key"},"publickey_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Publickey Version"},"callback_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callback Token"},"callback_encoding_aes_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callback Encoding Aes Key"}},"additionalProperties":false,"type":"object","title":"ProvisioningConfigUpdateIn","description":"Allowed wizard fields only. Any other key (tenant_id, corp_id, ...) is a\n422 contract violation."},"PurgeIn":{"properties":{"message_ids":{"items":{"type":"string"},"type":"array","maxItems":200,"minItems":1,"title":"Message Ids"},"confirm":{"type":"boolean","title":"Confirm","default":false}},"type":"object","required":["message_ids"],"title":"PurgeIn"},"PurgeMetricsOut":{"properties":{"pending_purge_count":{"type":"integer","title":"Pending Purge Count"},"oldest_pending_age_days":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Oldest Pending Age Days"},"last_success_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Success At"},"last_failure_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Failure At"},"recent_failure_count":{"type":"integer","title":"Recent Failure Count"},"storage_retry_pending":{"type":"integer","title":"Storage Retry Pending"}},"type":"object","required":["pending_purge_count","oldest_pending_age_days","last_success_at","last_failure_at","recent_failure_count","storage_retry_pending"],"title":"PurgeMetricsOut"},"PurgeOut":{"properties":{"purged":{"type":"integer","title":"Purged"},"not_found":{"type":"integer","title":"Not Found"},"media_retry_pending":{"type":"integer","title":"Media Retry Pending"},"purged_message_ids":{"items":{"type":"string"},"type":"array","title":"Purged Message Ids","default":[]}},"type":"object","required":["purged","not_found","media_retry_pending"],"title":"PurgeOut"},"ReachabilityAuditOut":{"properties":{"scanned_count":{"type":"integer","title":"Scanned Count"},"matching_total":{"type":"integer","title":"Matching Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"},"max_scan_limit":{"type":"integer","title":"Max Scan Limit"},"reachable_count":{"type":"integer","title":"Reachable Count"},"unreachable_count":{"type":"integer","title":"Unreachable Count"},"counts_by_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts By Status"},"counts_by_message_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts By Message Type"},"counts_by_conversation_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts By Conversation Type"},"samples":{"anyOf":[{"items":{"$ref":"#/components/schemas/ReachabilitySampleOut"},"type":"array"},{"type":"null"}],"title":"Samples"}},"type":"object","required":["scanned_count","matching_total","limit","offset","has_more","max_scan_limit","reachable_count","unreachable_count","counts_by_status","counts_by_message_type","counts_by_conversation_type"],"title":"ReachabilityAuditOut"},"ReachabilityCheckCountsOut":{"properties":{"matching":{"type":"integer","title":"Matching"},"checked":{"type":"integer","title":"Checked"},"reachable":{"type":"integer","title":"Reachable"},"unreachable":{"type":"integer","title":"Unreachable"}},"type":"object","required":["matching","checked","reachable","unreachable"],"title":"ReachabilityCheckCountsOut"},"ReachabilityCheckScopeOut":{"properties":{"from_at":{"type":"string","format":"date-time","title":"From At"},"to_at":{"type":"string","format":"date-time","title":"To At"}},"type":"object","required":["from_at","to_at"],"title":"ReachabilityCheckScopeOut"},"ReachabilityCheckSnapshotOut":{"properties":{"public_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Run Id"},"state":{"type":"string","enum":["healthy","attention","checking","no_data","incomplete","error"],"title":"State"},"complete":{"type":"boolean","title":"Complete"},"scope":{"$ref":"#/components/schemas/ReachabilityCheckScopeOut"},"counts":{"$ref":"#/components/schemas/ReachabilityCheckCountsOut"},"reason_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Reason Counts"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"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"},"last_checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Checked At"},"algorithm_version":{"type":"string","title":"Algorithm Version"},"safe_error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Safe Error Code"}},"type":"object","required":["state","complete","scope","counts","reason_counts","algorithm_version"],"title":"ReachabilityCheckSnapshotOut"},"ReachabilityCheckStartIn":{"properties":{},"additionalProperties":false,"type":"object","title":"ReachabilityCheckStartIn","description":"Deliberately empty: tenant scope only comes from the admin session."},"ReachabilityFindingListOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReachabilityFindingOut"},"type":"array","title":"Items"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"summary":{"$ref":"#/components/schemas/ReachabilityFindingSummaryOut"}},"type":"object","required":["items","summary"],"title":"ReachabilityFindingListOut"},"ReachabilityFindingOut":{"properties":{"public_finding_id":{"type":"string","title":"Public Finding Id"},"reason":{"type":"string","title":"Reason"},"status":{"type":"string","enum":["active","resolved"],"title":"Status"},"first_seen_at":{"type":"string","format":"date-time","title":"First Seen At"},"last_seen_at":{"type":"string","format":"date-time","title":"Last Seen At"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"occurrence_count":{"type":"integer","title":"Occurrence Count"},"algorithm_version":{"type":"string","title":"Algorithm Version"},"remediation_code":{"type":"string","const":"review_reachability","title":"Remediation Code","default":"review_reachability"}},"type":"object","required":["public_finding_id","reason","status","first_seen_at","last_seen_at","occurrence_count","algorithm_version"],"title":"ReachabilityFindingOut"},"ReachabilityFindingSummaryOut":{"properties":{"total":{"type":"integer","title":"Total"},"active":{"type":"integer","title":"Active"},"resolved":{"type":"integer","title":"Resolved"}},"type":"object","required":["total","active","resolved"],"title":"ReachabilityFindingSummaryOut"},"ReachabilitySampleOut":{"properties":{"message_db_id":{"type":"integer","title":"Message Db Id"},"reachability_status":{"type":"string","title":"Reachability Status"},"reason_code":{"type":"string","title":"Reason Code"},"message_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Type"},"conversation_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Type"},"has_sender":{"type":"boolean","title":"Has Sender"},"has_room":{"type":"boolean","title":"Has Room"},"recipient_count":{"type":"integer","title":"Recipient Count"},"timeline_visible":{"type":"boolean","title":"Timeline Visible"},"msg_time":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Msg Time"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["message_db_id","reachability_status","reason_code","has_sender","has_room","recipient_count","timeline_visible"],"title":"ReachabilitySampleOut"},"RecipientOut":{"properties":{"receiver_userid":{"type":"string","title":"Receiver Userid"},"receiver_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Receiver Type"}},"type":"object","required":["receiver_userid","receiver_type"],"title":"RecipientOut"},"RecycleBinItemOut":{"properties":{"msgid":{"type":"string","title":"Msgid"},"msgtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Msgtype"},"roomid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Roomid"},"msgtime":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Msgtime"},"preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview"},"has_media":{"type":"boolean","title":"Has Media"},"deleted_at":{"type":"string","format":"date-time","title":"Deleted At"},"deleted_by_admin_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deleted By Admin User Id"},"purge_after":{"type":"string","format":"date-time","title":"Purge After"},"deletion_batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deletion Batch Id"}},"type":"object","required":["msgid","msgtype","roomid","msgtime","preview","has_media","deleted_at","deleted_by_admin_user_id","purge_after","deletion_batch_id"],"title":"RecycleBinItemOut"},"RecycleBinOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RecycleBinItemOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"RecycleBinOut"},"RelatedStaffItem":{"properties":{"staff_userid":{"type":"string","title":"Staff Userid"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"admin_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Status"},"is_official_follow":{"type":"boolean","title":"Is Official Follow","default":false},"is_derived_from_archive":{"type":"boolean","title":"Is Derived From Archive","default":false},"follow_remark":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Follow Remark"},"message_count":{"type":"integer","title":"Message Count","default":0},"first_interaction_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Interaction At"},"last_interaction_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Interaction At"}},"type":"object","required":["staff_userid"],"title":"RelatedStaffItem","description":"RND-373: one employee related to an external customer.\n\nofficial/derived are reported separately and never blended: an\nofficial follow comes from external_contact_follows / the contact\nowner; \"derived\" means the archive proves the pair communicated, and\nmust never be presented as an official ownership claim."},"RetentionConfigOut":{"properties":{"configured":{"type":"boolean","title":"Configured"},"retention_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retention Days"},"is_locked":{"type":"boolean","title":"Is Locked"}},"type":"object","required":["configured","retention_days","is_locked"],"title":"RetentionConfigOut"},"RetentionConfigUpdate":{"properties":{"retention_days":{"type":"integer","maximum":3650.0,"minimum":1.0,"title":"Retention Days"},"lock":{"type":"boolean","title":"Lock"}},"type":"object","required":["retention_days","lock"],"title":"RetentionConfigUpdate"},"SendMessageIn":{"properties":{"message":{"type":"string","title":"Message"},"include_diagnostics":{"type":"boolean","title":"Include Diagnostics","default":false},"page_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Id"}},"type":"object","required":["message"],"title":"SendMessageIn"},"SettingsFieldOut":{"properties":{"key":{"type":"string","title":"Key"},"value":{"title":"Value"},"source":{"type":"string","enum":["default","env","db"],"title":"Source"},"requires_restart":{"type":"boolean","title":"Requires Restart"}},"type":"object","required":["key","value","source","requires_restart"],"title":"SettingsFieldOut"},"SettingsGetOut":{"properties":{"groups":{"additionalProperties":{"items":{"$ref":"#/components/schemas/SettingsFieldOut"},"type":"array"},"type":"object","title":"Groups"}},"type":"object","required":["groups"],"title":"SettingsGetOut"},"SettingsUpdateIn":{"properties":{"updates":{"additionalProperties":true,"type":"object","title":"Updates"}},"type":"object","title":"SettingsUpdateIn"},"SettingsUpdateOut":{"properties":{"ok":{"type":"boolean","title":"Ok"},"restart_required_keys":{"items":{"type":"string"},"type":"array","title":"Restart Required Keys"}},"type":"object","required":["ok","restart_required_keys"],"title":"SettingsUpdateOut"},"StaffCustomerItem":{"properties":{"customer_userid":{"type":"string","title":"Customer Userid"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"is_registered_external":{"type":"boolean","title":"Is Registered External","default":false},"direct_messages":{"type":"integer","title":"Direct Messages","default":0},"group_messages":{"type":"integer","title":"Group Messages","default":0},"message_count":{"type":"integer","title":"Message Count","default":0},"first_interaction_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Interaction At"},"last_interaction_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Interaction At"}},"type":"object","required":["customer_userid"],"title":"StaffCustomerItem","description":"One external customer a staff member has interacted with (RND-374)."},"StaffCustomersPage":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"},"items":{"items":{"$ref":"#/components/schemas/StaffCustomerItem"},"type":"array","title":"Items"},"staff_userid":{"type":"string","title":"Staff Userid"},"staff_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Staff Display Name"},"staff_admin_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Staff Admin Status"}},"type":"object","required":["total","page","per_page","items","staff_userid"],"title":"StaffCustomersPage"},"StaffDirectoryItem":{"properties":{"wecom_userid":{"type":"string","title":"Wecom Userid"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"avatar_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Status"},"has_seat":{"type":"boolean","title":"Has Seat","default":false},"msg_count_30d":{"type":"integer","title":"Msg Count 30D","default":0},"msg_count_total":{"type":"integer","title":"Msg Count Total","default":0}},"type":"object","required":["wecom_userid"],"title":"StaffDirectoryItem","description":"One internal staff member with read-only archive message statistics."},"StaffDirectoryPage":{"properties":{"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"},"items":{"items":{"$ref":"#/components/schemas/StaffDirectoryItem"},"type":"array","title":"Items"}},"type":"object","required":["total","page","per_page","items"],"title":"StaffDirectoryPage"},"SyncNowResponse":{"properties":{"accepted":{"type":"boolean","title":"Accepted"},"message":{"type":"string","enum":["started","already_running","rate_limited"],"title":"Message"},"retryAfterSeconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retryafterseconds"}},"type":"object","required":["accepted","message"],"title":"SyncNowResponse"},"SyncStatusResponse":{"properties":{"status":{"type":"string","enum":["idle","syncing","error"],"title":"Status"},"lastSeq":{"type":"integer","title":"Lastseq"},"startTime":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Starttime"},"errorMessage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Errormessage"},"seqVersion":{"type":"integer","title":"Seqversion"}},"type":"object","required":["status","lastSeq","seqVersion"],"title":"SyncStatusResponse"},"TextExportRequest":{"properties":{"approval_token":{"type":"string","maxLength":512,"minLength":20,"title":"Approval Token"},"format":{"type":"string","enum":["pdf","excel"],"title":"Format"},"selection":{"$ref":"#/components/schemas/TextSelectionIn"}},"type":"object","required":["approval_token","format","selection"],"title":"TextExportRequest"},"TextSelectionIn":{"properties":{"roomid":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Roomid"},"participant_id":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Participant Id"},"start_ms":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Start Ms"},"end_ms":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"End Ms"},"message_ids":{"items":{"type":"string"},"type":"array","maxItems":1000,"title":"Message Ids"}},"type":"object","title":"TextSelectionIn"},"TimelineMessageOut":{"properties":{"msgid":{"type":"string","title":"Msgid"},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"},"sender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender"},"sender_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Display Name"},"sender_raw_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Raw Id"},"sender_avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Avatar Url"},"sender_avatar_status":{"type":"string","title":"Sender Avatar Status","default":"missing"},"recipients":{"items":{"type":"string"},"type":"array","title":"Recipients"},"recipient_display_names":{"items":{"type":"string"},"type":"array","title":"Recipient Display Names","default":[]},"recipient_raw_ids":{"items":{"type":"string"},"type":"array","title":"Recipient Raw Ids","default":[]},"msgtime":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Msgtime"},"msgtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Msgtype"},"content_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Content Text"},"roomid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Roomid"},"decrypt_status":{"type":"string","title":"Decrypt Status"},"media_type":{"type":"string","title":"Media Type"},"media_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Status"},"unsupported_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unsupported Reason"},"media_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Url"},"media_access_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Media Access Url"},"thumbnail_access_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thumbnail Access Url"},"image_width":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Image Width"},"image_height":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Image Height"},"normalized_type":{"type":"string","title":"Normalized Type"},"category":{"type":"string","title":"Category"},"support_status":{"type":"string","title":"Support Status"},"renderer_strategy":{"type":"string","title":"Renderer Strategy"},"display_label_key":{"type":"string","title":"Display Label Key"},"structured_content":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Structured Content"},"is_revoked":{"type":"boolean","title":"Is Revoked","default":false},"revoked_at":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Revoked At"},"revoke_event_msgid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revoke Event Msgid"},"revoke_association_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revoke Association Status"}},"type":"object","required":["msgid","recipients","decrypt_status","media_type","normalized_type","category","support_status","renderer_strategy","display_label_key"],"title":"TimelineMessageOut"},"UsageAnalyticsOut":{"properties":{"overview":{"$ref":"#/components/schemas/OverviewOut"},"trend":{"additionalProperties":true,"type":"object","title":"Trend"},"type_composition":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Type Composition"},"storage_composition":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Storage Composition"},"hourly_distribution":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Hourly Distribution"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"}},"type":"object","required":["overview","trend","type_composition","storage_composition","hourly_distribution","meta"],"title":"UsageAnalyticsOut"},"UserFeedbackIn":{"properties":{"feedback_type":{"type":"string","enum":["bug","question","suggestion","other"],"title":"Feedback Type"},"body":{"type":"string","title":"Body"},"contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact"},"page_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Id"},"include_diagnostics":{"type":"boolean","title":"Include Diagnostics","default":false},"browser_info":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Browser Info"}},"type":"object","required":["feedback_type","body"],"title":"UserFeedbackIn"},"UserFeedbackOut":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","status"],"title":"UserFeedbackOut"},"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"},"_AcceptBody":{"properties":{"token":{"type":"string","title":"Token"},"password":{"type":"string","title":"Password"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["token","password"],"title":"_AcceptBody"},"_BootstrapBody":{"properties":{"admin_username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Username"},"admin_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Password"},"wecom_corp_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wecom Corp Id"},"wecom_agent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wecom Agent Id"},"wecom_oauth_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wecom Oauth Secret"}},"type":"object","title":"_BootstrapBody"},"_ChangePasswordBody":{"properties":{"old_password":{"type":"string","title":"Old Password"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["old_password","new_password"],"title":"_ChangePasswordBody"},"_ConnectionTestBody":{"properties":{"target":{"title":"Target"}},"additionalProperties":true,"type":"object","required":["target"],"title":"_ConnectionTestBody","description":"Only names a saved configuration target; credentials are never accepted."},"_CreateAccountFromRequestBody":{"properties":{"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status","default":"active"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"release_conflicting_legacy_account":{"type":"boolean","title":"Release Conflicting Legacy Account","default":false}},"type":"object","required":["role"],"title":"_CreateAccountFromRequestBody"},"_ForgotBody":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"_ForgotBody"},"_InviteBatchBody":{"properties":{"invites":{"items":{"$ref":"#/components/schemas/_InviteBatchItem"},"type":"array","title":"Invites"}},"type":"object","required":["invites"],"title":"_InviteBatchBody"},"_InviteBatchItem":{"properties":{"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["email","role"],"title":"_InviteBatchItem"},"_InviteBody":{"properties":{"wecom_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wecom User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"_InviteBody"},"_LinkAccessRequestBody":{"properties":{"admin_user_id":{"type":"string","title":"Admin User Id"},"release_conflicting_legacy_account":{"type":"boolean","title":"Release Conflicting Legacy Account","default":false}},"type":"object","required":["admin_user_id"],"title":"_LinkAccessRequestBody"},"_PasswordLoginBody":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"}},"type":"object","required":["username","password"],"title":"_PasswordLoginBody"},"_ResetBody":{"properties":{"token":{"type":"string","title":"Token"},"password":{"type":"string","title":"Password"}},"type":"object","required":["token","password"],"title":"_ResetBody"},"_RoleUpdate":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"_RoleUpdate"},"_StatusUpdate":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"_StatusUpdate"}},"securitySchemes":{"McpGroupBearer":{"type":"http","scheme":"bearer"}}}}