{"openapi":"3.1.0","info":{"title":"Ask AI API","description":"Search existing cards. Record new knowledge. Publish optionally. A structured knowledge vault for humans and AI tools.","version":"0.1.0"},"paths":{"/health":{"get":{"tags":["Health"],"summary":"Health Check","description":"Basic health check endpoint.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}}}}},"/health/ready":{"get":{"tags":["Health"],"summary":"Readiness Check","description":"Readiness check - verifies all dependencies are available.","operationId":"readiness_check_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadinessResponse"}}}}}}},"/api/v1/auth/register":{"post":{"tags":["Authentication","Authentication"],"summary":"Register","description":"Register a new user account.","operationId":"register_api_v1_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRegister"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/login":{"post":{"tags":["Authentication","Authentication"],"summary":"Login","description":"Login with email and password.","operationId":"login_api_v1_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLogin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/google":{"post":{"tags":["Authentication","Authentication"],"summary":"Google Login","description":"Login with Google (ID token). Links accounts by email to avoid duplicates.","operationId":"google_login_api_v1_auth_google_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleLogin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["Authentication","Authentication"],"summary":"Get Me","description":"Get current user profile.","operationId":"get_me_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/auth/onboarding":{"post":{"tags":["Authentication","Authentication"],"summary":"Submit Onboarding","description":"Save onboarding questionnaire answers and mark onboarding as complete.","operationId":"submit_onboarding_api_v1_auth_onboarding_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingSubmit"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/auth/api-keys":{"get":{"tags":["Authentication","Authentication"],"summary":"List Api Keys","description":"List all API keys for the current user.","operationId":"list_api_keys_api_v1_auth_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/APIKeyResponse"},"type":"array","title":"Response List Api Keys Api V1 Auth Api Keys Get"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]},"post":{"tags":["Authentication","Authentication"],"summary":"Create Api Key","description":"Create a new API key. The full key is only shown once.","operationId":"create_api_key_api_v1_auth_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIKeyCreatedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/auth/api-keys/{key_id}":{"delete":{"tags":["Authentication","Authentication"],"summary":"Delete Api Key","description":"Delete an API key.","operationId":"delete_api_key_api_v1_auth_api_keys__key_id__delete","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/search":{"post":{"tags":["Search"],"summary":"Search Cases","description":"Search for cases matching the query.\n\nUses multi-path sparse retrieval (BM25 + pg_trgm) with RRF fusion.\n\n- **query**: Search query (min 3 characters)\n- **workspace_ids**: Optional list of workspace IDs to search\n- **tags**: Optional tags to filter by\n- **environment**: Optional environment filters\n- **limit**: Maximum results (1-50, default 10)\n- **scope**: 'personal' (free) or 'public' (costs credits on hit)\n- **generate_action_card**: Whether to generate action card (costs credits if hit)","operationId":"search_cases_api_v1_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/cases":{"post":{"tags":["Cases"],"summary":"Create Case","description":"Create a new case card.\n\nThe card is created as unpublished. Use the publish endpoint to make it public.","operationId":"create_case_api_v1_cases_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Cases"],"summary":"List Cases","description":"List cases with optional filters.","operationId":"list_cases_api_v1_cases_get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"track","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Primary track filter: 'debug' or 'build' (debug_fix vs everything else)","title":"Track"},"description":"Primary track filter: 'debug' or 'build' (debug_fix vs everything else)"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"Text filter (public scope only)","title":"Q"},"description":"Text filter (public scope only)"},{"name":"scope","in":"query","required":false,"schema":{"type":"string","description":"List scope: personal (default) or workspace","default":"personal","title":"Scope"},"description":"List scope: personal (default) or workspace"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cards":{"post":{"tags":["Cases"],"summary":"Create Card","description":"Alias of create_case for card-oriented clients.","operationId":"create_card_api_v1_cards_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Cases"],"summary":"List Cards","description":"Alias of list_cases for card-oriented clients.","operationId":"list_cards_api_v1_cards_get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","description":"List scope: personal (default) or workspace","default":"personal","title":"Scope"},"description":"List scope: personal (default) or workspace"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cases/stats":{"get":{"tags":["Cases"],"summary":"Get Case Stats","description":"Get aggregated case statistics for the current user.","operationId":"get_case_stats_api_v1_cases_stats_get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","description":"Stats scope: personal (default) or workspace","default":"personal","title":"Scope"},"description":"Stats scope: personal (default) or workspace"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cards/stats":{"get":{"tags":["Cases"],"summary":"Get Card Stats","description":"Alias of get_case_stats for card-oriented clients.","operationId":"get_card_stats_api_v1_cards_stats_get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"}},{"name":"scope","in":"query","required":false,"schema":{"type":"string","description":"Stats scope: personal (default) or workspace","default":"personal","title":"Scope"},"description":"Stats scope: personal (default) or workspace"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cases/{case_id}":{"get":{"tags":["Cases"],"summary":"Get Case","description":"Get a case by ID.","operationId":"get_case_api_v1_cases__case_id__get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Case Id"}},{"name":"include_evidences","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Evidences"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Cases"],"summary":"Update Case","description":"Update a case card (unpublished or published).\n\n- Owners can always edit their own cards.\n- Workspace editors/admins can edit cards inside their workspace.\n- Evidence updates are append-only.","operationId":"update_case_api_v1_cases__case_id__patch","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Case Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cards/{card_id}":{"get":{"tags":["Cases"],"summary":"Get Card","description":"Alias of get_case for card-oriented clients.","operationId":"get_card_api_v1_cards__card_id__get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"card_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Card Id"}},{"name":"include_evidences","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Evidences"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Cases"],"summary":"Update Card","description":"Alias of update_case for card-oriented clients.","operationId":"update_card_api_v1_cards__card_id__patch","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"card_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Card Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cases/{case_id}/publish":{"post":{"tags":["Cases"],"summary":"Publish Case","description":"Publish a case to make it searchable.\n\nThe case must meet quality thresholds to be published.\nPublishing rewards the user with additional credits.","operationId":"publish_case_api_v1_cases__case_id__publish_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Case Id"}},{"name":"target_workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Target Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cases/{case_id}/share":{"post":{"tags":["Cases"],"summary":"Share Case","description":"Share an unpublished card inside its current workspace (internal publish).\n\nUnlike /publish, this endpoint does NOT move the card to the public workspace.\nIt only changes status to 'published' so other workspace members can read/search it.","operationId":"share_case_api_v1_cases__case_id__share_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cards/{card_id}/share":{"post":{"tags":["Cases"],"summary":"Share Card","description":"Alias of share_case for card-oriented clients.","operationId":"share_card_api_v1_cards__card_id__share_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"card_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Card Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cards/{card_id}/publish":{"post":{"tags":["Cases"],"summary":"Publish Card","description":"Alias of publish_case for card-oriented clients.","operationId":"publish_card_api_v1_cards__card_id__publish_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"card_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Card Id"}},{"name":"target_workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Target Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cases/{case_id}/unpublish":{"post":{"tags":["Cases"],"summary":"Unpublish Case","description":"Unpublish a case (withdraw it back to unpublished).\n\nThis is always allowed for the owner, even if publishing is disabled in user settings.","operationId":"unpublish_case_api_v1_cases__case_id__unpublish_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cards/{card_id}/unpublish":{"post":{"tags":["Cases"],"summary":"Unpublish Card","description":"Alias of unpublish_case for card-oriented clients.","operationId":"unpublish_card_api_v1_cards__card_id__unpublish_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"card_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Card Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cases/{case_id}/feedback":{"post":{"tags":["Feedback"],"summary":"Create Feedback","description":"Submit feedback for a case.\n\n- **useful**: The case helped solve the problem\n- **not_applicable**: The case didn't apply to the situation\n- **outdated**: The case information is outdated\n\nIf marked as \"useful\", the case contributor receives credits.","operationId":"create_feedback_api_v1_cases__case_id__feedback_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Case Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cases/{case_id}/feedback/stats":{"get":{"tags":["Feedback"],"summary":"Get Feedback Stats","description":"Get aggregated feedback statistics for a case.","operationId":"get_feedback_stats_api_v1_cases__case_id__feedback_stats_get","parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces":{"post":{"tags":["Workspaces"],"summary":"Create Workspace","description":"Create a new workspace.","operationId":"create_workspace_api_v1_workspaces_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Workspaces"],"summary":"List Workspaces","description":"List workspaces accessible to the current user.","operationId":"list_workspaces_api_v1_workspaces_get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"include_public","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Public"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/{workspace_id}":{"get":{"tags":["Workspaces"],"summary":"Get Workspace","description":"Get a workspace by ID.","operationId":"get_workspace_api_v1_workspaces__workspace_id__get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/{workspace_id}/members":{"post":{"tags":["Workspaces"],"summary":"Add Member","description":"Add a member to a workspace.","operationId":"add_member_api_v1_workspaces__workspace_id__members_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Workspaces"],"summary":"List Members","description":"List members of a workspace (requires membership).","operationId":"list_members_api_v1_workspaces__workspace_id__members_get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceMemberResponse"},"title":"Response List Members Api V1 Workspaces  Workspace Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/{workspace_id}/members/by-email":{"post":{"tags":["Workspaces"],"summary":"Add Member By Email","description":"Add an existing user to a workspace by email (admin only).","operationId":"add_member_by_email_api_v1_workspaces__workspace_id__members_by_email_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipCreateByEmail"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/{workspace_id}/invites":{"get":{"tags":["Workspaces"],"summary":"List Workspace Invites","description":"List workspace invites (admin only).","operationId":"list_workspace_invites_api_v1_workspaces__workspace_id__invites_get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"include_history","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include History"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceInviteResponse"},"title":"Response List Workspace Invites Api V1 Workspaces  Workspace Id  Invites Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Workspaces"],"summary":"Create Workspace Invite","description":"Create (or resend) a workspace invite by email (admin only).","operationId":"create_workspace_invite_api_v1_workspaces__workspace_id__invites_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceInviteCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceInviteActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/{workspace_id}/invites/{invite_id}/resend":{"post":{"tags":["Workspaces"],"summary":"Resend Workspace Invite","description":"Resend a pending invite (rotates token).","operationId":"resend_workspace_invite_api_v1_workspaces__workspace_id__invites__invite_id__resend_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceInviteActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/{workspace_id}/invites/{invite_id}":{"delete":{"tags":["Workspaces"],"summary":"Revoke Workspace Invite","description":"Revoke (cancel) a pending invite.","operationId":"revoke_workspace_invite_api_v1_workspaces__workspace_id__invites__invite_id__delete","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"invite_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/invites/{token}":{"get":{"tags":["Workspaces"],"summary":"Get Workspace Invite","description":"Fetch invitation details (token-gated; no auth required).","operationId":"get_workspace_invite_api_v1_workspaces_invites__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceInvitePublicResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workspaces/invites/accept":{"post":{"tags":["Workspaces"],"summary":"Accept Workspace Invite","description":"Accept a workspace invite (logged-in user; token required).","operationId":"accept_workspace_invite_api_v1_workspaces_invites_accept_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceInviteAccept"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/workspaces/{workspace_id}/members/{user_id}":{"patch":{"tags":["Workspaces"],"summary":"Update Member Role","description":"Update a member role (admin only).","operationId":"update_member_role_api_v1_workspaces__workspace_id__members__user_id__patch","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Workspaces"],"summary":"Remove Member","description":"Remove a member from a workspace (admin only).","operationId":"remove_member_api_v1_workspaces__workspace_id__members__user_id__delete","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/credits/policy":{"get":{"tags":["Credits"],"summary":"Get Policy","description":"Get the current credit policy (public, non-sensitive).\n\nThis is safe to expose publicly so humans and AI tools can understand\nhow credits are earned/spent without needing authentication.","operationId":"get_policy_api_v1_credits_policy_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsPolicy"}}}}}}},"/api/v1/credits/balance":{"get":{"tags":["Credits"],"summary":"Get Balance","description":"Get current credits balance.","operationId":"get_balance_api_v1_credits_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsBalance"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/credits/history":{"get":{"tags":["Credits"],"summary":"Get History","description":"Get credits transaction history.","operationId":"get_history_api_v1_credits_history_get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditsHistory"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/raw-materials":{"post":{"tags":["Raw Materials"],"summary":"Create Raw Material","operationId":"create_raw_material_api_v1_raw_materials_post","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RawMaterialCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RawMaterialResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Raw Materials"],"summary":"List Raw Materials","operationId":"list_raw_materials_api_v1_raw_materials_get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Page Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RawMaterialListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/raw-materials/{raw_id}":{"get":{"tags":["Raw Materials"],"summary":"Get Raw Material","operationId":"get_raw_material_api_v1_raw_materials__raw_id__get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"raw_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Raw Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RawMaterialResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/project-context/events":{"post":{"tags":["Agent Memory"],"summary":"Append Project Context Event","operationId":"append_project_context_event_api_v1_project_context_events_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectContextEventCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectContextEventResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/project-context/events/{raw_id}":{"get":{"tags":["Agent Memory"],"summary":"Get Project Context Event","operationId":"get_project_context_event_api_v1_project_context_events__raw_id__get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"raw_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Raw Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectContextEventResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Agent Memory"],"summary":"Delete Project Context Event","operationId":"delete_project_context_event_api_v1_project_context_events__raw_id__delete","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"raw_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Raw Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/project-context/snapshot":{"get":{"tags":["Agent Memory"],"summary":"Get Project Context Snapshot","operationId":"get_project_context_snapshot_api_v1_project_context_snapshot_get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"project_key","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Project Key"}},{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"}},{"name":"limit_events","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit Events"}},{"name":"max_chars_per_event","in":"query","required":false,"schema":{"type":"integer","maximum":20000,"minimum":200,"default":2000,"title":"Max Chars Per Event"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectContextSnapshotResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/project-context/preferences/transfer":{"post":{"tags":["Agent Memory"],"summary":"Transfer Preferences","operationId":"transfer_preferences_api_v1_project_context_preferences_transfer_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesTransferRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesTransferResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/project-context/search":{"get":{"tags":["Agent Memory"],"summary":"Search Project Context","operationId":"search_project_context_api_v1_project_context_search_get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"project_key","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Project Key"}},{"name":"query","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Query"}},{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectContextSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/project-context/projects":{"get":{"tags":["Agent Memory"],"summary":"List Project Context Projects","operationId":"list_project_context_projects_api_v1_project_context_projects_get","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectContextProjectsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Agent Memory"],"summary":"Delete Project Context Project","operationId":"delete_project_context_project_api_v1_project_context_projects_delete","security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}],"parameters":[{"name":"project_key","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Project Key"}},{"name":"confirmed_by_user","in":"query","required":true,"schema":{"type":"boolean","title":"Confirmed By User"}},{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectContextProjectDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/project-context/projects/rename":{"post":{"tags":["Agent Memory"],"summary":"Rename Project Context Project","operationId":"rename_project_context_project_api_v1_project_context_projects_rename_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectContextProjectRenameRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectContextProjectRenameResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/user/settings":{"get":{"tags":["User Settings"],"summary":"Get User Settings","operationId":"get_user_settings_api_v1_user_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSettings"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]},"put":{"tags":["User Settings"],"summary":"Update User Settings","operationId":"update_user_settings_api_v1_user_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSettings"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSettings"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/support/tickets":{"post":{"tags":["Support"],"summary":"Create Support Ticket","operationId":"create_support_ticket_api_v1_support_tickets_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_support_ticket_api_v1_support_tickets_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Support Ticket Api V1 Support Tickets Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/support":{"post":{"tags":["Chat"],"summary":"Support Chat","operationId":"support_chat_api_v1_chat_support_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/chat/support/stream":{"post":{"tags":["Chat"],"summary":"Support Chat Stream","operationId":"support_chat_stream_api_v1_chat_support_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/billing/plans":{"get":{"tags":["Billing"],"summary":"Get Plans","operationId":"get_plans_api_v1_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SubscriptionPlan"},"type":"array","title":"Response Get Plans Api V1 Billing Plans Get"}}}}}}},"/api/v1/billing/credit-packs":{"get":{"tags":["Billing"],"summary":"Get Credit Packs","operationId":"get_credit_packs_api_v1_billing_credit_packs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/CreditPack"},"type":"array","title":"Response Get Credit Packs Api V1 Billing Credit Packs Get"}}}}}}},"/api/v1/billing/status":{"get":{"tags":["Billing"],"summary":"Get Billing Status","operationId":"get_billing_status_api_v1_billing_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingStatus"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/billing/checkout":{"post":{"tags":["Billing"],"summary":"Create Subscription Checkout","operationId":"create_subscription_checkout_api_v1_billing_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubscriptionCheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/billing/credits/checkout":{"post":{"tags":["Billing"],"summary":"Create Credits Checkout","operationId":"create_credits_checkout_api_v1_billing_credits_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCreditsCheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/billing/portal":{"post":{"tags":["Billing"],"summary":"Create Portal","operationId":"create_portal_api_v1_billing_portal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/billing/webhook":{"post":{"tags":["Billing"],"summary":"Stripe Webhook","description":"Stripe webhook endpoint (idempotent).\n\nImportant: In production you MUST configure STRIPE_WEBHOOK_SECRET.","operationId":"stripe_webhook_api_v1_billing_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Stripe Webhook Api V1 Billing Webhook Post"}}}}}}},"/api/v1/billing/simulate-upgrade":{"post":{"tags":["Billing"],"summary":"Simulate Upgrade","description":"Development-only: simulate upgrading without Stripe.\n\nThis endpoint keeps the previous MVP workflow available for local development\nwhile the production path uses Stripe checkout + webhooks.","operationId":"simulate_upgrade_api_v1_billing_simulate_upgrade_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateUpgradeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Simulate Upgrade Api V1 Billing Simulate Upgrade Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/billing/invites":{"get":{"tags":["Billing"],"summary":"List Invites","operationId":"list_invites_api_v1_billing_invites_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/InviteResponse"},"type":"array","title":"Response List Invites Api V1 Billing Invites Get"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]},"post":{"tags":["Billing"],"summary":"Create Invite","operationId":"create_invite_api_v1_billing_invites_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInviteRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/api/v1/billing/redeem-invite":{"post":{"tags":["Billing"],"summary":"Redeem Invite","operationId":"redeem_invite_api_v1_billing_redeem_invite_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedeemInviteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedeemInviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/get_ai_guide":{"post":{"tags":["MCP"],"summary":"Get Ai Guide","description":"Get the Ask AI AI-Guide JSON (policies + workflow). Recommended once per session.","operationId":"get_ai_guide_mcp_tools_get_ai_guide_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetAIGuideInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/list_workspaces":{"post":{"tags":["MCP"],"summary":"List Workspaces","description":"List workspaces accessible to the current user (personal + team/org; public optional).","operationId":"list_workspaces_mcp_tools_list_workspaces_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWorkspacesInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/create_workspace":{"post":{"tags":["MCP"],"summary":"Create Workspace","description":"Create a new team.","operationId":"create_workspace_mcp_tools_create_workspace_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/add_workspace_member_by_email":{"post":{"tags":["MCP"],"summary":"Add Workspace Member By Email","description":"Add an existing user to a workspace by email (admin only).","operationId":"add_workspace_member_by_email_mcp_tools_add_workspace_member_by_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddWorkspaceMemberByEmailInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/list_workspace_members":{"post":{"tags":["MCP"],"summary":"List Workspace Members","description":"List members of a workspace (requires membership).","operationId":"list_workspace_members_mcp_tools_list_workspace_members_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWorkspaceMembersInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/update_workspace_member_role":{"post":{"tags":["MCP"],"summary":"Update Workspace Member Role","description":"Update a member's role (admin only).","operationId":"update_workspace_member_role_mcp_tools_update_workspace_member_role_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkspaceMemberRoleInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/remove_workspace_member":{"post":{"tags":["MCP"],"summary":"Remove Workspace Member","description":"Remove a member from a workspace (admin only).","operationId":"remove_workspace_member_mcp_tools_remove_workspace_member_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveWorkspaceMemberInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/invite_workspace_member":{"post":{"tags":["MCP"],"summary":"Invite Workspace Member","description":"Invite a teammate by email (admin only). Sends email when SMTP is configured.","operationId":"invite_workspace_member_mcp_tools_invite_workspace_member_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteWorkspaceMemberInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/list_workspace_invites":{"post":{"tags":["MCP"],"summary":"List Workspace Invites","description":"List workspace invites (admin only).","operationId":"list_workspace_invites_mcp_tools_list_workspace_invites_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWorkspaceInvitesInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/resend_workspace_invite":{"post":{"tags":["MCP"],"summary":"Resend Workspace Invite","description":"Resend a pending workspace invite (admin only; rotates token).","operationId":"resend_workspace_invite_mcp_tools_resend_workspace_invite_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendWorkspaceInviteInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/revoke_workspace_invite":{"post":{"tags":["MCP"],"summary":"Revoke Workspace Invite","description":"Revoke (cancel) a pending invite (admin only).","operationId":"revoke_workspace_invite_mcp_tools_revoke_workspace_invite_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeWorkspaceInviteInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/accept_workspace_invite":{"post":{"tags":["MCP"],"summary":"Accept Workspace Invite","description":"Accept a workspace invite (token required).","operationId":"accept_workspace_invite_mcp_tools_accept_workspace_invite_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptWorkspaceInviteInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/search_records":{"post":{"tags":["MCP"],"summary":"Search Records","description":"Search for reusable knowledge cards (Debug + Build).\n\nThis tool searches the Ask AI knowledge base for cases matching\nthe query. It uses multi-path sparse retrieval with RRF fusion.\n\nCredits: Only charged if there's a hit (no-hit-no-charge policy).","operationId":"search_records_mcp_tools_search_records_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRecordsInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/record_case":{"post":{"tags":["MCP"],"summary":"Record Case","description":"Record a new debug case.\n\nCreates a new case card in unpublished status. The case will be sanitized\nto remove sensitive information before storage.","operationId":"record_case_mcp_tools_record_case_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordCaseInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/record_card":{"post":{"tags":["MCP"],"summary":"Record Card","description":"Alias of record_case for card-oriented clients.","operationId":"record_card_mcp_tools_record_card_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordCaseInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/get_card":{"post":{"tags":["MCP"],"summary":"Get Card","description":"Fetch a card by id (includes public publish review status).","operationId":"get_card_mcp_tools_get_card_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCardInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/update_card":{"post":{"tags":["MCP"],"summary":"Update Card","description":"Update a card by id (re-runs public publish review).","operationId":"update_card_mcp_tools_update_card_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCardInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/capture_raw":{"post":{"tags":["MCP"],"summary":"Capture Raw","description":"Capture raw unstructured material.\n\nStores long-form raw content (chat logs, command output, web excerpts) so it can\nlater be curated into a structured card.","operationId":"capture_raw_mcp_tools_capture_raw_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaptureRawInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/append_context_event":{"post":{"tags":["MCP"],"summary":"Append Context Event","description":"Append an Agent Memory event (private persistent memory).\n\nUse this to store:\n- verbatim user intent (user_message)\n- end-of-turn assistant report (agent_report)\n- a short \"current focus\" summary (summary) (working snapshot; may be partial)\n\nPrivate-only. If you plan to publish/share a card, do not include secrets.","operationId":"append_context_event_mcp_tools_append_context_event_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppendContextEventInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/append_context_turn":{"post":{"tags":["MCP"],"summary":"Append Context Turn","description":"Append one Agent Memory \"turn\" event (verbatim user + final outcome in one record).\n\nThis is a latency/token-optimized alternative to writing two separate events\n(user_message + agent_report). Private-only; keep secrets out of publishable/shared cards.\n\nOptional: you can also include summary/facts/project_preferences updates in the same call\nto reduce tool calls and keep project memory current.","operationId":"append_context_turn_mcp_tools_append_context_turn_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppendContextTurnInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/transfer_preferences":{"post":{"tags":["MCP"],"summary":"Transfer Preferences","description":"Copy preferences between a project and:\n- another project, or\n- global user preferences (__user__/preferences).\n\nThis must be user-directed: confirmed_by_user must be true.","operationId":"transfer_preferences_mcp_tools_transfer_preferences_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferPreferencesInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/delete_context_event":{"post":{"tags":["MCP"],"summary":"Delete Context Event","description":"Delete one Agent Memory event by raw_id (destructive).\n\nThis must be explicitly user-directed: confirmed_by_user must be true.","operationId":"delete_context_event_mcp_tools_delete_context_event_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteContextEventInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/get_project_context":{"post":{"tags":["MCP"],"summary":"Get Project Context","description":"Get a compact project memory \"context pack\" (Agent Memory).\n\nReturns (if present):\n- project_preferences: a fact_snapshot with meta.fact_kind=\"project_preferences\"\n- fact_snapshot: stable facts (recommended meta.fact_kind=\"project_facts\")\n- summary: a short \"current focus\" working snapshot (may be partial; not the full project spec)\n- events: a window of recent non-summary/non-fact events (oldest→newest)","operationId":"get_project_context_mcp_tools_get_project_context_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetProjectContextInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/search_project_context":{"post":{"tags":["MCP"],"summary":"Search Project Context","description":"Search within Agent Memory events (portable substring match).\n\nUse this when you need an older detail that is not in the recent window.","operationId":"search_project_context_mcp_tools_search_project_context_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchProjectContextInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/curate_raw_to_card":{"post":{"tags":["MCP"],"summary":"Curate Raw To Card","description":"Curate a raw material into an unpublished card.\n\nThis tool never publishes automatically. It creates an unpublished card with:\n- card_payload.raw_material referencing the raw_id\n- an evidence excerpt for search coverage","operationId":"curate_raw_to_card_mcp_tools_curate_raw_to_card_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurateRawToCardInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/publish_case":{"post":{"tags":["MCP"],"summary":"Publish Case","description":"Publish an unpublished case to make it searchable.\n\nThe case must meet quality thresholds to be published.","operationId":"publish_case_mcp_tools_publish_case_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishCaseInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/publish_card":{"post":{"tags":["MCP"],"summary":"Publish Card","description":"Alias of publish_case for card-oriented clients.","operationId":"publish_card_mcp_tools_publish_card_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishCardInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/unpublish_case":{"post":{"tags":["MCP"],"summary":"Unpublish Case","description":"Withdraw a published case back to unpublished status.","operationId":"unpublish_case_mcp_tools_unpublish_case_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnpublishCaseInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/share_case":{"post":{"tags":["MCP"],"summary":"Share Case","description":"Share an unpublished card inside its current workspace (internal publish).\n\nThis tool flips status to 'published' (no public publish quality gate) but does not move the\ncard to a public workspace.","operationId":"share_case_mcp_tools_share_case_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareCaseInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/share_card":{"post":{"tags":["MCP"],"summary":"Share Card","description":"Alias of share_case for card-oriented clients.","operationId":"share_card_mcp_tools_share_card_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShareCardInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/tools/unpublish_card":{"post":{"tags":["MCP"],"summary":"Unpublish Card","description":"Alias of unpublish_case for card-oriented clients.","operationId":"unpublish_card_mcp_tools_unpublish_card_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnpublishCardInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPToolResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp/manifest/":{"get":{"tags":["MCP"],"summary":"Get Manifest","description":"Get MCP server manifest with available tools.","operationId":"get_manifest_mcp_manifest__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/mcp/manifest":{"get":{"tags":["MCP"],"summary":"Get Manifest","description":"Get MCP server manifest with available tools.","operationId":"get_manifest_mcp_manifest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/mcp/sse/":{"get":{"tags":["MCP"],"summary":"Sse Endpoint","description":"Server-Sent Events endpoint for MCP streaming.\n\nThis endpoint provides a persistent connection for MCP clients\nto receive real-time updates.","operationId":"sse_endpoint_mcp_sse__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/mcp/sse":{"get":{"tags":["MCP"],"summary":"Sse Endpoint","description":"Server-Sent Events endpoint for MCP streaming.\n\nThis endpoint provides a persistent connection for MCP clients\nto receive real-time updates.","operationId":"sse_endpoint_mcp_sse_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/mcp/":{"post":{"tags":["MCP"],"summary":"Mcp Jsonrpc","description":"MCP JSON-RPC endpoint.\n\nThis endpoint is compatible with MCP clients that use the Streamable HTTP transport\n(e.g., Cursor). It supports:\n- initialize\n- ping\n- tools/list\n- tools/call\n- prompts/list\n- prompts/get\n\nWe intentionally keep the existing custom HTTP endpoints for backward compatibility:\n- /mcp/manifest\n- /mcp/tools/*","operationId":"mcp_jsonrpc_mcp__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/mcp":{"post":{"tags":["MCP"],"summary":"Mcp Jsonrpc","description":"MCP JSON-RPC endpoint.\n\nThis endpoint is compatible with MCP clients that use the Streamable HTTP transport\n(e.g., Cursor). It supports:\n- initialize\n- ping\n- tools/list\n- tools/call\n- prompts/list\n- prompts/get\n\nWe intentionally keep the existing custom HTTP endpoints for backward compatibility:\n- /mcp/manifest\n- /mcp/tools/*","operationId":"mcp_jsonrpc_mcp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]},{"HTTPBearer":[]}]}},"/":{"get":{"summary":"Root","description":"Root endpoint.","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ai-guide":{"get":{"summary":"Ai Guide","description":"AI Agent Guide - Instructions for AI assistants to use Ask AI.\n\nThis endpoint provides structured instructions that any AI agent can\nread and understand to use the Ask AI API effectively.","operationId":"ai_guide_ai_guide_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/robots.txt":{"get":{"summary":"Robots Txt","operationId":"robots_txt_robots_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/llms.txt":{"get":{"summary":"Llms Txt","operationId":"llms_txt_llms_txt_get","responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"APIKeyCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"expires_in_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Days"}},"type":"object","required":["name"],"title":"APIKeyCreate"},"APIKeyCreatedResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"key_preview":{"type":"string","title":"Key Preview"},"api_key":{"type":"string","title":"Api Key"}},"type":"object","required":["id","name","scopes","created_at","expires_at","last_used_at","key_preview","api_key"],"title":"APIKeyCreatedResponse"},"APIKeyResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"key_preview":{"type":"string","title":"Key Preview"}},"type":"object","required":["id","name","scopes","created_at","expires_at","last_used_at","key_preview"],"title":"APIKeyResponse"},"AcceptWorkspaceInviteInput":{"properties":{"token":{"type":"string","maxLength":400,"minLength":10,"title":"Token","description":"Invitation token from the invite URL"}},"type":"object","required":["token"],"title":"AcceptWorkspaceInviteInput","description":"Input schema for accept_workspace_invite tool (invitee)."},"ActionCard":{"properties":{"title":{"type":"string","title":"Title"},"summary":{"type":"string","title":"Summary"},"steps":{"items":{"type":"string"},"type":"array","title":"Steps"},"warnings":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Warnings"},"related_cases":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Related Cases"}},"type":"object","required":["title","summary","steps"],"title":"ActionCard","description":"Generated action card for a search result."},"AddWorkspaceMemberByEmailInput":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id","description":"Workspace ID (UUID)"},"email":{"type":"string","maxLength":320,"minLength":3,"title":"Email","description":"Member email (must be an existing user)"},"role":{"type":"string","title":"Role","description":"Role: admin | editor | viewer","default":"viewer"}},"type":"object","required":["workspace_id","email"],"title":"AddWorkspaceMemberByEmailInput","description":"Input schema for add_workspace_member_by_email tool."},"AppendContextEventInput":{"properties":{"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id","description":"Target workspace ID (defaults to your personal workspace if omitted)"},"project_key":{"type":"string","title":"Project Key","description":"Stable project identifier (e.g., repo URL, org/repo, etc.)"},"event_type":{"type":"string","title":"Event Type","description":"Event type: user_message | agent_report | turn | summary | fact_snapshot"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Optional short title"},"content":{"type":"string","title":"Content","description":"Event content (long text supported; sanitized server-side). If event_type='user_message', content MUST be the user's verbatim text (do NOT paraphrase/summarize; keep verbatim up to ~4000 chars; if longer, first ~4000 chars verbatim + short summary)."},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Optional session identifier (client-defined)"},"client":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client","description":"Optional client identifier (Cursor/Codex/Claude/etc)"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta","description":"Additional metadata (JSON)"}},"type":"object","required":["project_key","event_type","content"],"title":"AppendContextEventInput","description":"Input schema for append_context_event tool."},"AppendContextTurnInput":{"properties":{"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id","description":"Target workspace ID (defaults to your personal workspace if omitted)"},"project_key":{"type":"string","title":"Project Key","description":"Stable project identifier (e.g., repo URL, org/repo, etc.)"},"user_message":{"type":"string","title":"User Message","description":"MUST be the verbatim user request for this work unit (do NOT paraphrase/summarize; keep verbatim up to ~4000 chars; if longer, include the first ~4000 chars verbatim then a short summary)"},"agent_report":{"type":"string","title":"Agent Report","description":"End-of-turn agent report / outcome for this work unit"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary","description":"Optional: updated current-focus summary (writes an additional event_type='summary')"},"facts":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Facts","description":"Optional: updated stable project facts (writes an additional event_type='fact_snapshot' with meta.fact_kind='project_facts')"},"project_preferences":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Preferences","description":"Optional: updated project preferences (writes an additional event_type='fact_snapshot' with meta.fact_kind='project_preferences'; only if the human explicitly asked)"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Optional short title (defaults to a short user summary)"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Optional session identifier (client-defined)"},"client":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client","description":"Optional client identifier (Cursor/Codex/Claude/etc)"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta","description":"Additional metadata (JSON)"}},"type":"object","required":["project_key","user_message","agent_report"],"title":"AppendContextTurnInput","description":"Input schema for append_context_turn tool (store a user+agent pair as one event)."},"BillingStatus":{"properties":{"user_id":{"type":"string","title":"User Id"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"subscription_status":{"type":"string","title":"Subscription Status"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","default":false},"credits_balance":{"type":"integer","title":"Credits Balance"},"allow_public_search":{"type":"boolean","title":"Allow Public Search"},"allow_publish":{"type":"boolean","title":"Allow Publish"}},"type":"object","required":["user_id","subscription_tier","subscription_status","credits_balance","allow_public_search","allow_publish"],"title":"BillingStatus"},"Body_create_support_ticket_api_v1_support_tickets_post":{"properties":{"subject":{"type":"string","maxLength":200,"minLength":3,"title":"Subject"},"message":{"type":"string","maxLength":200000,"minLength":1,"title":"Message"},"email":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Email"},"attachments":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Attachments","default":[]}},"type":"object","required":["subject","message"],"title":"Body_create_support_ticket_api_v1_support_tickets_post"},"CaptureRawInput":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id","description":"Target workspace ID"},"kind":{"type":"string","title":"Kind","description":"Raw kind (chat, log, web, note, etc.)"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Optional title"},"content":{"type":"string","title":"Content","description":"Raw content (supports long content)"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta","description":"Metadata (JSON)"}},"type":"object","required":["workspace_id","kind","content"],"title":"CaptureRawInput","description":"Input schema for capture_raw tool."},"CaseCreate":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id","description":"Target workspace ID"},"card_type":{"type":"string","title":"Card Type","description":"Card type (debug_fix, how_to, lesson_learned, decision, reference)","default":"debug_fix"},"title":{"type":"string","maxLength":5000,"minLength":10,"title":"Title","description":"Case title (supports long titles)"},"symptom":{"type":"string","minLength":20,"title":"Symptom","description":"Problem / goal description (supports long content)"},"environment":{"anyOf":[{"$ref":"#/components/schemas/EnvironmentSchema"},{"type":"null"}],"description":"Environment info"},"root_cause":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Cause","description":"Root cause analysis (supports long content)"},"fix_summary":{"type":"string","minLength":20,"title":"Fix Summary","description":"Solution summary (supports long content)"},"steps":{"anyOf":[{"items":{"$ref":"#/components/schemas/StepSchema"},"type":"array"},{"type":"null"}],"title":"Steps","description":"Resolution steps"},"scope_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope Notes","description":"Scope and limitations (supports long content)"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Tags"},"card_payload":{"additionalProperties":true,"type":"object","title":"Card Payload","description":"Type-specific payload (JSON)"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body","description":"Long-form body (supports long content)"},"evidences":{"anyOf":[{"items":{"$ref":"#/components/schemas/EvidenceCreate"},"type":"array"},{"type":"null"}],"title":"Evidences","description":"Evidence items"}},"type":"object","required":["workspace_id","title","symptom","fix_summary"],"title":"CaseCreate","description":"Schema for creating a case."},"CaseListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CaseResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["items","total","page","page_size","has_more"],"title":"CaseListResponse","description":"Schema for case list response."},"CaseResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"status":{"type":"string","title":"Status","description":"Card publication status: unpublished | published"},"card_type":{"type":"string","title":"Card Type"},"title":{"type":"string","title":"Title"},"symptom":{"type":"string","title":"Symptom"},"environment":{"additionalProperties":true,"type":"object","title":"Environment"},"root_cause":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Cause"},"fix_summary":{"type":"string","title":"Fix Summary"},"steps":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Steps"},"scope_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope Notes"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"card_payload":{"additionalProperties":true,"type":"object","title":"Card Payload"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"confidence":{"type":"number","title":"Confidence"},"quality_score":{"type":"number","title":"Quality Score"},"public_publish_approved":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Public Publish Approved"},"public_publish_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Publish Reason"},"public_publish_issues":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Public Publish Issues"},"public_publish_checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Public Publish Checked At"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Name","description":"Display name of the card author (user.name or fallback)"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"evidences":{"anyOf":[{"items":{"$ref":"#/components/schemas/EvidenceResponse"},"type":"array"},{"type":"null"}],"title":"Evidences"}},"type":"object","required":["id","workspace_id","status","card_type","title","symptom","environment","root_cause","fix_summary","steps","scope_notes","tags","card_payload","body","confidence","quality_score","created_by","created_at","updated_at"],"title":"CaseResponse","description":"Schema for case response."},"CaseStatsResponse":{"properties":{"total_count":{"type":"integer","title":"Total Count"},"published_count":{"type":"integer","title":"Published Count"},"unpublished_count":{"type":"integer","title":"Unpublished Count"}},"type":"object","required":["total_count","published_count","unpublished_count"],"title":"CaseStatsResponse","description":"Schema for aggregated case statistics."},"CaseUpdate":{"properties":{"card_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Type"},"title":{"anyOf":[{"type":"string","maxLength":5000,"minLength":10},{"type":"null"}],"title":"Title"},"symptom":{"anyOf":[{"type":"string","minLength":20},{"type":"null"}],"title":"Symptom"},"environment":{"anyOf":[{"$ref":"#/components/schemas/EnvironmentSchema"},{"type":"null"}]},"root_cause":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Cause"},"fix_summary":{"anyOf":[{"type":"string","minLength":20},{"type":"null"}],"title":"Fix Summary"},"steps":{"anyOf":[{"items":{"$ref":"#/components/schemas/StepSchema"},"type":"array"},{"type":"null"}],"title":"Steps"},"scope_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope Notes"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"card_payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Card Payload"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"evidences":{"anyOf":[{"items":{"$ref":"#/components/schemas/EvidenceCreate"},"type":"array"},{"type":"null"}],"title":"Evidences"}},"type":"object","title":"CaseUpdate","description":"Schema for updating a case."},"ChatMessage":{"properties":{"role":{"type":"string","enum":["user","assistant","system"],"title":"Role"},"content":{"type":"string","maxLength":20000,"title":"Content"}},"type":"object","required":["role","content"],"title":"ChatMessage"},"CheckoutResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"},"session_id":{"type":"string","title":"Session Id"}},"type":"object","required":["checkout_url","session_id"],"title":"CheckoutResponse"},"CreateCreditsCheckoutRequest":{"properties":{"pack_id":{"type":"string","title":"Pack Id"},"success_url":{"type":"string","title":"Success Url"},"cancel_url":{"type":"string","title":"Cancel Url"}},"type":"object","required":["pack_id","success_url","cancel_url"],"title":"CreateCreditsCheckoutRequest"},"CreateInviteRequest":{"properties":{"plan_id":{"type":"string","title":"Plan Id","description":"starter | pro"},"max_uses":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Max Uses","default":1},"expires_in_days":{"anyOf":[{"type":"integer","maximum":365.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Days"},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Note"}},"type":"object","required":["plan_id"],"title":"CreateInviteRequest"},"CreateSubscriptionCheckoutRequest":{"properties":{"plan_id":{"type":"string","title":"Plan Id"},"success_url":{"type":"string","title":"Success Url"},"cancel_url":{"type":"string","title":"Cancel Url"}},"type":"object","required":["plan_id","success_url","cancel_url"],"title":"CreateSubscriptionCheckoutRequest"},"CreateWorkspaceInput":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name","description":"Workspace name"},"type":{"type":"string","title":"Type","description":"Workspace type: org | personal","default":"org"},"visibility":{"type":"string","title":"Visibility","description":"Workspace visibility: private | unlisted | public","default":"private"},"policy_json":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Policy Json","description":"Optional workspace policy JSON"}},"type":"object","required":["name"],"title":"CreateWorkspaceInput","description":"Input schema for create_workspace tool (org/team workspace)."},"CreditPack":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"price":{"type":"integer","title":"Price","description":"Price in cents (USD)"},"credits":{"type":"integer","title":"Credits"}},"type":"object","required":["id","name","price","credits"],"title":"CreditPack"},"CreditsBalance":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"balance":{"type":"integer","title":"Balance","description":"Current credits balance"},"subscription_tier":{"type":"string","title":"Subscription Tier","description":"Current subscription tier"}},"type":"object","required":["user_id","balance","subscription_tier"],"title":"CreditsBalance","description":"Schema for credits balance response."},"CreditsHistory":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"transactions":{"items":{"$ref":"#/components/schemas/CreditsTransaction"},"type":"array","title":"Transactions"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["user_id","transactions","total","page","page_size","has_more"],"title":"CreditsHistory","description":"Schema for credits history response."},"CreditsPolicy":{"properties":{"signup_bonus_credits":{"type":"integer","title":"Signup Bonus Credits","description":"Credits granted on signup"},"unpublished_reward_credits":{"type":"integer","title":"Unpublished Reward Credits","description":"Credits earned for saving an unpublished card (0 if disabled)"},"publish_reward_credits":{"type":"integer","title":"Publish Reward Credits","description":"Credits earned for publishing to the public library"},"public_search_cost_credits":{"type":"integer","title":"Public Search Cost Credits","description":"Credits charged for a public search hit"},"generate_cost_credits":{"type":"integer","title":"Generate Cost Credits","description":"Credits charged for generation hit (if enabled)"},"hit_only_billing":{"type":"boolean","title":"Hit Only Billing","description":"Charges happen only on high-confidence hits","default":true},"publisher_reward_on_hit":{"type":"boolean","title":"Publisher Reward On Hit","description":"Whether publishers earn credits when others search/hit their cards (disabled)","default":false}},"type":"object","required":["signup_bonus_credits","unpublished_reward_credits","publish_reward_credits","public_search_cost_credits","generate_cost_credits"],"title":"CreditsPolicy","description":"Public, non-sensitive credit economics for the product."},"CreditsTransaction":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"delta":{"type":"integer","title":"Delta","description":"Credits change (positive or negative)"},"reason":{"type":"string","title":"Reason","description":"Transaction reason"},"ref_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Ref Id","description":"Reference ID (e.g., case ID)"},"balance_after":{"type":"integer","title":"Balance After","description":"Balance after transaction"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","delta","reason","balance_after","created_at"],"title":"CreditsTransaction","description":"Schema for a single credits transaction."},"CurateRawToCardInput":{"properties":{"raw_id":{"type":"string","title":"Raw Id","description":"Raw material ID to curate"},"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id","description":"Target workspace ID (defaults to raw material workspace)"},"card_type":{"type":"string","title":"Card Type","description":"Card type (debug_fix, how_to, lesson_learned, decision, reference)","default":"debug_fix"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Optional title override"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Optional tags to add"},"use_ai":{"type":"boolean","title":"Use Ai","description":"Attempt AI-assisted curation when configured (falls back on failure)","default":true}},"type":"object","required":["raw_id"],"title":"CurateRawToCardInput","description":"Input schema for curate_raw_to_card tool."},"DeleteContextEventInput":{"properties":{"raw_id":{"type":"string","title":"Raw Id","description":"Context event raw_id (UUID) to delete"},"confirmed_by_user":{"type":"boolean","title":"Confirmed By User","description":"Must be true. Use only when the human explicitly requested this deletion."},"client":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client","description":"Optional client identifier (Cursor/Codex/Claude/etc)"}},"type":"object","required":["raw_id","confirmed_by_user"],"title":"DeleteContextEventInput","description":"Input schema for delete_context_event tool (explicit user-directed deletion)."},"EnvironmentSchema":{"properties":{"os":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Os","description":"Operating system"},"runtime":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Runtime","description":"Runtime version"},"packages":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Packages","description":"Package versions"},"extra":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extra","description":"Additional environment info"}},"type":"object","title":"EnvironmentSchema","description":"Environment information."},"EvidenceCreate":{"properties":{"kind":{"type":"string","title":"Kind","description":"Evidence type (log, stacktrace, config, etc.)"},"content":{"type":"string","title":"Content","description":"Evidence content (supports long content)"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta","description":"Metadata"}},"type":"object","required":["kind","content"],"title":"EvidenceCreate","description":"Schema for creating evidence."},"EvidenceResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"kind":{"type":"string","title":"Kind"},"content":{"type":"string","title":"Content"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"redacted":{"type":"boolean","title":"Redacted"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","kind","content","meta","redacted","created_at"],"title":"EvidenceResponse","description":"Schema for evidence response."},"EvidenceSnippet":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"kind":{"type":"string","title":"Kind"},"snippet":{"type":"string","title":"Snippet","description":"Relevant snippet from evidence"},"relevance":{"type":"number","title":"Relevance","description":"Relevance score"}},"type":"object","required":["id","kind","snippet","relevance"],"title":"EvidenceSnippet","description":"Snippet of evidence for search results."},"FeedbackCreate":{"properties":{"vote":{"type":"string","pattern":"^(useful|not_applicable|outdated)$","title":"Vote","description":"Feedback vote type"},"comment":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Comment","description":"Optional comment"},"environment":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Environment","description":"User's environment for context"}},"type":"object","required":["vote"],"title":"FeedbackCreate","description":"Schema for creating feedback."},"FeedbackResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"case_id":{"type":"string","format":"uuid","title":"Case Id"},"user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Id"},"vote":{"type":"string","title":"Vote"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"},"environment":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Environment"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","case_id","user_id","vote","comment","environment","created_at"],"title":"FeedbackResponse","description":"Schema for feedback response."},"FeedbackStats":{"properties":{"case_id":{"type":"string","format":"uuid","title":"Case Id"},"useful_count":{"type":"integer","title":"Useful Count","default":0},"not_applicable_count":{"type":"integer","title":"Not Applicable Count","default":0},"outdated_count":{"type":"integer","title":"Outdated Count","default":0},"total_count":{"type":"integer","title":"Total Count","default":0}},"type":"object","required":["case_id"],"title":"FeedbackStats","description":"Aggregated feedback statistics for a case."},"GetAIGuideInput":{"properties":{"base_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Url","description":"Optional base URL override. If omitted, uses server config; otherwise URLs may be relative."}},"type":"object","title":"GetAIGuideInput","description":"Input schema for get_ai_guide tool (fetch the AI Guide JSON via MCP tools)."},"GetCardInput":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Card ID to fetch"},"include_evidences":{"type":"boolean","title":"Include Evidences","description":"Whether to include evidence items (recommended)","default":true}},"type":"object","required":["card_id"],"title":"GetCardInput","description":"Input schema for get_card tool."},"GetProjectContextInput":{"properties":{"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id","description":"Target workspace ID (defaults to your personal workspace if omitted)"},"project_key":{"type":"string","title":"Project Key","description":"Stable project identifier (same as used in append_context_event)"},"limit_events":{"type":"integer","maximum":100.0,"minimum":1.0,"title":"Limit Events","description":"Number of recent events to return","default":20},"max_chars_per_event":{"type":"integer","maximum":20000.0,"minimum":200.0,"title":"Max Chars Per Event","description":"Truncate each event content to this many characters (token-safety)","default":2000}},"type":"object","required":["project_key"],"title":"GetProjectContextInput","description":"Input schema for get_project_context tool."},"GoogleLogin":{"properties":{"credential":{"type":"string","minLength":10,"title":"Credential"}},"type":"object","required":["credential"],"title":"GoogleLogin"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Health status"},"version":{"type":"string","title":"Version","description":"API version"},"timestamp":{"type":"string","title":"Timestamp","description":"Current timestamp"}},"type":"object","required":["status","version","timestamp"],"title":"HealthResponse","description":"Health check response."},"InviteResponse":{"properties":{"code":{"type":"string","title":"Code"},"plan_id":{"type":"string","title":"Plan Id"},"max_uses":{"type":"integer","title":"Max Uses"},"used_count":{"type":"integer","title":"Used Count"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["code","plan_id","max_uses","used_count","created_at"],"title":"InviteResponse"},"InviteWorkspaceMemberInput":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id","description":"Workspace ID (UUID)"},"email":{"type":"string","maxLength":320,"minLength":3,"title":"Email","description":"Invitee email"},"role":{"type":"string","title":"Role","description":"Role on accept: admin | editor | viewer","default":"viewer"}},"type":"object","required":["workspace_id","email"],"title":"InviteWorkspaceMemberInput","description":"Input schema for invite_workspace_member tool (email invite; sends email when SMTP is configured)."},"ListWorkspaceInvitesInput":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id","description":"Workspace ID (UUID)"},"include_history":{"type":"boolean","title":"Include History","description":"Include accepted/revoked invites (default false)","default":false}},"type":"object","required":["workspace_id"],"title":"ListWorkspaceInvitesInput","description":"Input schema for list_workspace_invites tool (admin only)."},"ListWorkspaceMembersInput":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id","description":"Workspace ID (UUID)"}},"type":"object","required":["workspace_id"],"title":"ListWorkspaceMembersInput","description":"Input schema for list_workspace_members tool."},"ListWorkspacesInput":{"properties":{"include_public":{"type":"boolean","title":"Include Public","description":"Whether to include public workspaces (defaults false; teams/personal only).","default":false}},"type":"object","title":"ListWorkspacesInput","description":"Input schema for list_workspaces tool."},"MCPToolResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success"],"title":"MCPToolResponse","description":"Standard MCP tool response."},"MatchSignal":{"properties":{"type":{"type":"string","title":"Type","description":"Signal type (error_code, package_version, etc.)"},"value":{"type":"string","title":"Value","description":"Matched value"},"score":{"type":"number","title":"Score","description":"Match score"}},"type":"object","required":["type","value","score"],"title":"MatchSignal","description":"Signal that contributed to a match."},"MembershipCreate":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id","description":"User ID to add"},"role":{"type":"string","pattern":"^(admin|editor|viewer)$","title":"Role","description":"Member role","default":"viewer"}},"type":"object","required":["user_id"],"title":"MembershipCreate","description":"Schema for adding a member to a workspace."},"MembershipCreateByEmail":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"Existing user's email"},"role":{"type":"string","pattern":"^(admin|editor|viewer)$","title":"Role","description":"Member role","default":"viewer"}},"type":"object","required":["email"],"title":"MembershipCreateByEmail","description":"Add a member by email (user must already exist)."},"MembershipResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"role":{"type":"string","title":"Role"},"joined_at":{"type":"string","format":"date-time","title":"Joined At"}},"type":"object","required":["workspace_id","user_id","role","joined_at"],"title":"MembershipResponse","description":"Schema for membership response."},"MembershipUpdate":{"properties":{"role":{"type":"string","pattern":"^(admin|editor|viewer)$","title":"Role","description":"Updated member role"}},"type":"object","required":["role"],"title":"MembershipUpdate","description":"Schema for updating a member's role in a workspace."},"OnboardingSubmit":{"properties":{"channels":{"items":{"type":"string"},"type":"array","title":"Channels","default":[]},"tools":{"items":{"type":"string"},"type":"array","title":"Tools","default":[]},"usage_type":{"type":"string","title":"Usage Type","default":"personal"},"team_size":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Size"},"other_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Other Channel"},"other_tool":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Other Tool"}},"type":"object","title":"OnboardingSubmit"},"PortalRequest":{"properties":{"return_url":{"type":"string","title":"Return Url"}},"type":"object","required":["return_url"],"title":"PortalRequest"},"PortalResponse":{"properties":{"portal_url":{"type":"string","title":"Portal Url"}},"type":"object","required":["portal_url"],"title":"PortalResponse"},"PreferencesTransferRequest":{"properties":{"source_project_key":{"type":"string","title":"Source Project Key","description":"Source project key (use __user__/preferences for global preferences)"},"target_project_key":{"type":"string","title":"Target Project Key","description":"Target project key (use __user__/preferences for global preferences)"},"items":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Items","description":"Optional list of preference items to transfer. If omitted, transfers the entire preferences document."},"replace_target":{"type":"boolean","title":"Replace Target","description":"If true and items is omitted, replace the target preferences document (instead of merging).","default":false},"confirmed_by_user":{"type":"boolean","title":"Confirmed By User","description":"Must be true. Use only when the human explicitly requested this transfer."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note","description":"Optional human-provided note for audit/debugging"},"workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id","description":"Target workspace ID (defaults to your personal workspace if omitted)"}},"type":"object","required":["source_project_key","target_project_key","confirmed_by_user"],"title":"PreferencesTransferRequest"},"PreferencesTransferResponse":{"properties":{"source_project_key":{"type":"string","title":"Source Project Key"},"target_project_key":{"type":"string","title":"Target Project Key"},"target_raw_id":{"type":"string","format":"uuid","title":"Target Raw Id"}},"type":"object","required":["source_project_key","target_project_key","target_raw_id"],"title":"PreferencesTransferResponse"},"ProjectContextEventCreate":{"properties":{"project_key":{"type":"string","title":"Project Key","description":"Stable project identifier (e.g., repo URL, org/repo, etc.)"},"event_type":{"type":"string","title":"Event Type","description":"Event type: user_message | agent_report | turn | summary | fact_snapshot"},"content":{"type":"string","title":"Content","description":"Event content (long text supported; sanitized server-side)"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Optional short title"},"workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id","description":"Target workspace ID (defaults to your personal workspace if omitted)"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Optional session identifier (client-defined)"},"client":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client","description":"Optional client identifier (Cursor/Codex/Claude/etc)"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Additional metadata (JSON)"}},"type":"object","required":["project_key","event_type","content"],"title":"ProjectContextEventCreate"},"ProjectContextEventResponse":{"properties":{"raw_id":{"type":"string","format":"uuid","title":"Raw Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"project_key":{"type":"string","title":"Project Key"},"event_type":{"type":"string","title":"Event Type"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"content":{"type":"string","title":"Content"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["raw_id","workspace_id","project_key","event_type","title","content","meta","created_at"],"title":"ProjectContextEventResponse"},"ProjectContextProjectDeleteResponse":{"properties":{"project_key":{"type":"string","title":"Project Key"},"deleted_count":{"type":"integer","title":"Deleted Count"}},"type":"object","required":["project_key","deleted_count"],"title":"ProjectContextProjectDeleteResponse"},"ProjectContextProjectItem":{"properties":{"project_key":{"type":"string","title":"Project Key"},"events_count":{"type":"integer","title":"Events Count"},"last_event_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Event At"}},"type":"object","required":["project_key","events_count","last_event_at"],"title":"ProjectContextProjectItem"},"ProjectContextProjectRenameRequest":{"properties":{"source_project_key":{"type":"string","title":"Source Project Key","description":"Project key to rename/move from"},"target_project_key":{"type":"string","title":"Target Project Key","description":"Project key to rename/move to"},"confirmed_by_user":{"type":"boolean","title":"Confirmed By User","description":"Must be true. Use only when the human explicitly requested this rename."},"workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id","description":"Target workspace ID (defaults to your personal workspace if omitted)"}},"type":"object","required":["source_project_key","target_project_key","confirmed_by_user"],"title":"ProjectContextProjectRenameRequest"},"ProjectContextProjectRenameResponse":{"properties":{"source_project_key":{"type":"string","title":"Source Project Key"},"target_project_key":{"type":"string","title":"Target Project Key"},"moved_count":{"type":"integer","title":"Moved Count"}},"type":"object","required":["source_project_key","target_project_key","moved_count"],"title":"ProjectContextProjectRenameResponse"},"ProjectContextProjectsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ProjectContextProjectItem"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ProjectContextProjectsResponse"},"ProjectContextSearchResponse":{"properties":{"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ProjectContextSearchResponse"},"ProjectContextSnapshotResponse":{"properties":{"project_key":{"type":"string","title":"Project Key"},"summary":{"anyOf":[{"$ref":"#/components/schemas/ProjectContextEventResponse"},{"type":"null"}]},"fact_snapshot":{"anyOf":[{"$ref":"#/components/schemas/ProjectContextEventResponse"},{"type":"null"}]},"project_preferences":{"anyOf":[{"$ref":"#/components/schemas/ProjectContextEventResponse"},{"type":"null"}]},"events":{"items":{"$ref":"#/components/schemas/ProjectContextEventResponse"},"type":"array","title":"Events"}},"type":"object","required":["project_key","summary","events"],"title":"ProjectContextSnapshotResponse"},"PublishCardInput":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Card ID to publish"},"target_workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Workspace Id","description":"Target workspace for publishing"}},"type":"object","required":["card_id"],"title":"PublishCardInput","description":"Input schema for publish_card tool (alias of publish_case)."},"PublishCaseInput":{"properties":{"case_id":{"type":"string","title":"Case Id","description":"Case ID to publish"},"target_workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Workspace Id","description":"Target workspace for publishing"}},"type":"object","required":["case_id"],"title":"PublishCaseInput","description":"Input schema for publish_case tool."},"RawMaterialCreate":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id","description":"Target workspace ID"},"kind":{"type":"string","title":"Kind","description":"Raw material kind (chat, log, web, note, etc.)"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Optional title"},"content":{"type":"string","title":"Content","description":"Raw content (supports long content)"},"meta":{"additionalProperties":true,"type":"object","title":"Meta","description":"Metadata (JSON)"}},"type":"object","required":["workspace_id","kind","content"],"title":"RawMaterialCreate"},"RawMaterialListItemResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"kind":{"type":"string","title":"Kind"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","workspace_id","created_by","kind","title","meta","created_at"],"title":"RawMaterialListItemResponse","description":"List-item shape for raw materials.\n\nIntentionally omits the full `content` payload to keep list responses small\nand reduce accidental sensitive leakage in bulk views."},"RawMaterialListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RawMaterialListItemResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"page_size":{"type":"integer","title":"Page Size"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["items","total","page","page_size","has_more"],"title":"RawMaterialListResponse"},"RawMaterialResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"kind":{"type":"string","title":"Kind"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"content":{"type":"string","title":"Content"},"meta":{"additionalProperties":true,"type":"object","title":"Meta"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","workspace_id","created_by","kind","title","content","meta","created_at"],"title":"RawMaterialResponse"},"ReadinessResponse":{"properties":{"database":{"type":"string","title":"Database","description":"Database connection status"},"redis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redis","description":"Redis connection status"},"secret_key_ok":{"type":"boolean","title":"Secret Key Ok","description":"Whether a non-default secret_key is configured"}},"type":"object","required":["database","secret_key_ok"],"title":"ReadinessResponse","description":"Readiness check response."},"RecordCaseInput":{"properties":{"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id","description":"Target workspace ID (defaults to your personal workspace if omitted)"},"card_type":{"type":"string","title":"Card Type","description":"Card type (debug_fix, how_to, lesson_learned, decision, reference)","default":"debug_fix"},"title":{"type":"string","title":"Title","description":"Case title (supports long titles up to 5000 chars)"},"symptom":{"type":"string","title":"Symptom","description":"Problem / goal description (supports long content)"},"fix_summary":{"type":"string","title":"Fix Summary","description":"Solution summary (what worked) (supports long content)"},"environment":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Environment","description":"Environment details (language, framework, versions)"},"root_cause":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Cause","description":"Root cause analysis (supports long content)"},"steps":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Steps","description":"Step-by-step fix instructions with order (int), action (str), result (str). Action and result fields support long content."},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Tags for categorization"},"card_payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Card Payload","description":"Type-specific payload (JSON)"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body","description":"Long-form body (supports long content)"},"evidences":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Evidences","description":"Supporting evidence (logs, code snippets). Content field supports long content."}},"type":"object","required":["title","symptom","fix_summary"],"title":"RecordCaseInput","description":"Input schema for record_card tool (alias: record_case).\n\nSupports long-form content (post-length). All text fields can contain\nextensive content including detailed explanations, code examples, logs, etc."},"RedeemInviteRequest":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"RedeemInviteRequest"},"RedeemInviteResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"plan_id":{"type":"string","title":"Plan Id"},"subscription_status":{"type":"string","title":"Subscription Status"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"granted_credits":{"type":"integer","title":"Granted Credits"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","plan_id","subscription_status","subscription_tier","granted_credits","message"],"title":"RedeemInviteResponse"},"RemoveWorkspaceMemberInput":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id","description":"Workspace ID (UUID)"},"user_id":{"type":"string","title":"User Id","description":"Target user ID (UUID)"}},"type":"object","required":["workspace_id","user_id"],"title":"RemoveWorkspaceMemberInput","description":"Input schema for remove_workspace_member tool (admin only)."},"ResendWorkspaceInviteInput":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id","description":"Workspace ID (UUID)"},"invite_id":{"type":"string","title":"Invite Id","description":"Invite ID (UUID)"}},"type":"object","required":["workspace_id","invite_id"],"title":"ResendWorkspaceInviteInput","description":"Input schema for resend_workspace_invite tool (admin only; rotates token)."},"RevokeWorkspaceInviteInput":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id","description":"Workspace ID (UUID)"},"invite_id":{"type":"string","title":"Invite Id","description":"Invite ID (UUID)"}},"type":"object","required":["workspace_id","invite_id"],"title":"RevokeWorkspaceInviteInput","description":"Input schema for revoke_workspace_invite tool (admin only)."},"SearchProjectContextInput":{"properties":{"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id","description":"Target workspace ID (defaults to your personal workspace if omitted)"},"project_key":{"type":"string","title":"Project Key","description":"Stable project identifier (same as used in append_context_event)"},"query":{"type":"string","title":"Query","description":"Search query (substring match in title/content; portable)"},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","description":"Max results","default":10}},"type":"object","required":["project_key","query"],"title":"SearchProjectContextInput","description":"Input schema for search_project_context tool."},"SearchRecordsInput":{"properties":{"query":{"type":"string","title":"Query","description":"Natural language search query"},"track":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Track","description":"Primary track filter: 'debug' or 'build' (debug_fix vs everything else)"},"scope":{"type":"string","title":"Scope","description":"Search scope: 'personal' (your own vault, free), 'workspace' (org/shared workspaces, free), or 'public' (community knowledge base, may cost credits on hit)","default":"personal"},"workspace_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Workspace Ids","description":"Limit search to specific workspaces"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Filter by tags"},"environment":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Environment","description":"Environment filters (e.g. language/framework versions)"},"limit":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"Limit","description":"Maximum results","default":5}},"type":"object","required":["query"],"title":"SearchRecordsInput","description":"Input schema for search_records tool."},"SearchRequest":{"properties":{"query":{"type":"string","minLength":3,"title":"Query","description":"Search query"},"track":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Track","description":"Primary track filter: 'debug' or 'build' (debug_fix vs everything else)"},"scope":{"type":"string","title":"Scope","description":"Search scope: 'personal' (your own vault, free), 'workspace' (org/shared workspaces, free), or 'public' (community knowledge base, may cost credits on hit)","default":"personal"},"workspace_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Workspace Ids","description":"Limit search to specific workspaces"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Filter by tags"},"environment":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Environment","description":"Filter by environment"},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","description":"Maximum results","default":10},"generate_action_card":{"type":"boolean","title":"Generate Action Card","description":"Whether to generate action card (costs credits)","default":false}},"type":"object","required":["query"],"title":"SearchRequest","description":"Schema for search request."},"SearchResponse":{"properties":{"query":{"type":"string","title":"Query"},"hit":{"type":"boolean","title":"Hit","description":"Whether a strong signal match was found"},"hit_reason":{"type":"string","title":"Hit Reason","description":"Explainable hit/no-hit reason (for billing UX)"},"results":{"items":{"$ref":"#/components/schemas/SearchResult"},"type":"array","title":"Results"},"total":{"type":"integer","title":"Total"},"action_card":{"anyOf":[{"$ref":"#/components/schemas/ActionCard"},{"type":"null"}],"description":"Generated action card (if requested and hit)"},"credits_charged":{"type":"integer","title":"Credits Charged","description":"Credits charged for this search","default":0},"search_time_ms":{"type":"integer","title":"Search Time Ms","description":"Search time in milliseconds"}},"type":"object","required":["query","hit","hit_reason","results","total","search_time_ms"],"title":"SearchResponse","description":"Schema for search response."},"SearchResult":{"properties":{"card_id":{"type":"string","format":"uuid","title":"Card Id","description":"Card ID (canonical)"},"case_id":{"type":"string","format":"uuid","title":"Case Id","description":"Legacy alias of card_id (same value)"},"card_type":{"type":"string","title":"Card Type","description":"Card type (debug_fix, how_to, lesson_learned, decision, reference)"},"title":{"type":"string","title":"Title"},"symptom_snippet":{"type":"string","title":"Symptom Snippet","description":"Relevant snippet from symptom"},"fix_summary_snippet":{"type":"string","title":"Fix Summary Snippet","description":"Relevant snippet from fix"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"confidence":{"type":"number","title":"Confidence"},"quality_score":{"type":"number","title":"Quality Score"},"match_signals":{"items":{"$ref":"#/components/schemas/MatchSignal"},"type":"array","title":"Match Signals","description":"Signals that matched"},"matched_fields":{"items":{"type":"string"},"type":"array","title":"Matched Fields","description":"Fields that matched the query"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By","description":"Card author user ID (workspace scope)"},"created_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Name","description":"Card author display name (workspace scope)"},"text_snippets":{"items":{"$ref":"#/components/schemas/TextSnippet"},"type":"array","title":"Text Snippets","description":"Matched text snippets from case fields"},"evidence_snippets":{"items":{"$ref":"#/components/schemas/EvidenceSnippet"},"type":"array","title":"Evidence Snippets","description":"Relevant evidence snippets"},"score":{"type":"number","title":"Score","description":"Overall relevance score"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["card_id","case_id","card_type","title","symptom_snippet","fix_summary_snippet","tags","confidence","quality_score","score","created_at"],"title":"SearchResult","description":"Single search result."},"ShareCardInput":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Card ID to share"}},"type":"object","required":["card_id"],"title":"ShareCardInput","description":"Input schema for share_card tool (alias of share_case)."},"ShareCaseInput":{"properties":{"case_id":{"type":"string","title":"Case Id","description":"Case ID to share (publish within its current workspace)"}},"type":"object","required":["case_id"],"title":"ShareCaseInput","description":"Input schema for share_case tool (internal publish within workspace)."},"SimulateUpgradeRequest":{"properties":{"plan_id":{"type":"string","title":"Plan Id"}},"type":"object","required":["plan_id"],"title":"SimulateUpgradeRequest"},"StepSchema":{"properties":{"order":{"type":"integer","title":"Order","description":"Step order"},"action":{"type":"string","title":"Action","description":"Action description (supports long content)"},"expected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected","description":"Expected outcome (supports long content)"},"evidence_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Evidence Ids","description":"Related evidence IDs"}},"type":"object","required":["order","action"],"title":"StepSchema","description":"Step in a case resolution."},"SubscriptionPlan":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"price":{"type":"integer","title":"Price","description":"Price in cents (USD)"},"credits_per_month":{"type":"integer","title":"Credits Per Month"},"features":{"items":{"type":"string"},"type":"array","title":"Features"}},"type":"object","required":["id","name","price","credits_per_month","features"],"title":"SubscriptionPlan"},"SupportChatRequest":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","maxItems":30,"minItems":1,"title":"Messages"},"mode":{"anyOf":[{"type":"string","enum":["auto","debug","build","setup"]},{"type":"null"}],"title":"Mode","description":"Optional hint for the support agent to answer in Debug vs Build vs Setup mode.","default":"auto"}},"type":"object","required":["messages"],"title":"SupportChatRequest"},"SupportChatResponse":{"properties":{"text":{"type":"string","title":"Text"}},"type":"object","required":["text"],"title":"SupportChatResponse"},"TextSnippet":{"properties":{"field":{"type":"string","title":"Field","description":"Field name (title, symptom, fix_summary, etc.)"},"snippet":{"type":"string","title":"Snippet","description":"Relevant snippet"},"relevance":{"type":"number","title":"Relevance","description":"Relevance score","default":1.0}},"type":"object","required":["field","snippet"],"title":"TextSnippet","description":"Snippet of matched text from core case fields."},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"user":{"additionalProperties":true,"type":"object","title":"User"}},"type":"object","required":["access_token","expires_at","user"],"title":"TokenResponse"},"TransferPreferencesInput":{"properties":{"workspace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workspace Id","description":"Target workspace ID (defaults to your personal workspace if omitted)"},"source_project_key":{"type":"string","title":"Source Project Key","description":"Source project key (use __user__/preferences for global preferences)"},"target_project_key":{"type":"string","title":"Target Project Key","description":"Target project key (use __user__/preferences for global preferences)"},"items":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Items","description":"Optional list of preference items to transfer. If omitted, transfers the entire preferences document."},"replace_target":{"type":"boolean","title":"Replace Target","description":"If true and items is omitted, replace the target preferences document (instead of merging).","default":false},"confirmed_by_user":{"type":"boolean","title":"Confirmed By User","description":"Must be true. Use only when the human explicitly requested this transfer."},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note","description":"Optional human-provided note for audit/debugging"},"client":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client","description":"Optional client identifier (Cursor/Codex/Claude/etc)"}},"type":"object","required":["source_project_key","target_project_key","confirmed_by_user"],"title":"TransferPreferencesInput","description":"Input schema for transfer_preferences tool (copy preferences across projects/global)."},"UnpublishCardInput":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Card ID to unpublish"}},"type":"object","required":["card_id"],"title":"UnpublishCardInput","description":"Input schema for unpublish_card tool (alias of unpublish_case)."},"UnpublishCaseInput":{"properties":{"case_id":{"type":"string","title":"Case Id","description":"Case ID to unpublish"}},"type":"object","required":["case_id"],"title":"UnpublishCaseInput","description":"Input schema for unpublish_case tool."},"UpdateCardInput":{"properties":{"card_id":{"type":"string","title":"Card Id","description":"Card ID to update"},"card_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Card Type","description":"Card type (debug_fix, how_to, lesson_learned, decision, reference)"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","description":"Case title (supports long titles up to 5000 chars)"},"symptom":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Symptom","description":"Problem / goal description (supports long content)"},"fix_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fix Summary","description":"Solution summary (what worked) (supports long content)"},"environment":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Environment","description":"Environment details (language, framework, versions)"},"root_cause":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Root Cause","description":"Root cause analysis (supports long content)"},"steps":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Steps","description":"Step-by-step fix instructions with order/action/result (JSON array)."},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Tags for categorization (string[])"},"card_payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Card Payload","description":"Type-specific payload (JSON)"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body","description":"Long-form body (supports long content)"},"scope_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope Notes","description":"Scope/limitations notes (supports long content)"},"evidences":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Evidences","description":"Append-only evidence items (list of {kind, content, meta})"}},"type":"object","required":["card_id"],"title":"UpdateCardInput","description":"Input schema for update_card tool (patch update)."},"UpdateWorkspaceMemberRoleInput":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id","description":"Workspace ID (UUID)"},"user_id":{"type":"string","title":"User Id","description":"Target user ID (UUID)"},"role":{"type":"string","title":"Role","description":"Role: admin | editor | viewer"}},"type":"object","required":["workspace_id","user_id","role"],"title":"UpdateWorkspaceMemberRoleInput","description":"Input schema for update_workspace_member_role tool (admin only)."},"UserLogin":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"UserLogin"},"UserRegister":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name"},"password":{"type":"string","minLength":8,"title":"Password"}},"type":"object","required":["email","name","password"],"title":"UserRegister"},"UserResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"credits_balance":{"type":"integer","title":"Credits Balance"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"subscription_status":{"type":"string","title":"Subscription Status"},"subscription_current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Subscription Current Period End"},"subscription_is_active":{"type":"boolean","title":"Subscription Is Active"},"allow_public_search":{"type":"boolean","title":"Allow Public Search"},"allow_publish":{"type":"boolean","title":"Allow Publish"},"allow_team":{"type":"boolean","title":"Allow Team"},"allow_agent_memory":{"type":"boolean","title":"Allow Agent Memory"},"onboarding_completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Onboarding Completed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","name","credits_balance","subscription_tier","subscription_status","subscription_is_active","allow_public_search","allow_publish","allow_team","allow_agent_memory","created_at"],"title":"UserResponse"},"UserSettings":{"properties":{"allow_public_search":{"type":"boolean","title":"Allow Public Search"},"allow_publish":{"type":"boolean","title":"Allow Publish"},"allow_team":{"type":"boolean","title":"Allow Team"},"allow_agent_memory":{"type":"boolean","title":"Allow Agent Memory"}},"type":"object","required":["allow_public_search","allow_publish","allow_team","allow_agent_memory"],"title":"UserSettings"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WorkspaceCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":2,"title":"Name","description":"Workspace name"},"type":{"type":"string","pattern":"^(public|personal|org)$","title":"Type","description":"Workspace type","default":"personal"},"visibility":{"type":"string","pattern":"^(public|unlisted|private)$","title":"Visibility","description":"Visibility setting","default":"private"},"policy_json":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Policy Json","description":"Workspace policies"}},"type":"object","required":["name"],"title":"WorkspaceCreate","description":"Schema for creating a workspace."},"WorkspaceInviteAccept":{"properties":{"token":{"type":"string","maxLength":400,"minLength":10,"title":"Token","description":"Invitation token from the invite URL"}},"type":"object","required":["token"],"title":"WorkspaceInviteAccept","description":"Accept a workspace invitation by token."},"WorkspaceInviteActionResponse":{"properties":{"invite":{"$ref":"#/components/schemas/WorkspaceInviteResponse"},"invite_url":{"type":"string","title":"Invite Url"},"email_sent":{"type":"boolean","title":"Email Sent"}},"type":"object","required":["invite","invite_url","email_sent"],"title":"WorkspaceInviteActionResponse","description":"Result of an invite action (create/resend)."},"WorkspaceInviteCreate":{"properties":{"email":{"type":"string","format":"email","title":"Email","description":"Invitee email"},"role":{"type":"string","pattern":"^(admin|editor|viewer)$","title":"Role","description":"Role to grant on accept","default":"viewer"}},"type":"object","required":["email"],"title":"WorkspaceInviteCreate","description":"Create an email invitation for a workspace."},"WorkspaceInvitePublicResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"workspace_name":{"type":"string","title":"Workspace Name"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"}},"type":"object","required":["workspace_id","workspace_name","email","role","status","created_at","expires_at"],"title":"WorkspaceInvitePublicResponse","description":"Workspace invitation (public view; token-gated)."},"WorkspaceInviteResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"email":{"type":"string","format":"email","title":"Email"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"inviter_user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Inviter User Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"last_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sent At"},"send_count":{"type":"integer","title":"Send Count","default":0}},"type":"object","required":["id","workspace_id","email","role","status","created_at","expires_at"],"title":"WorkspaceInviteResponse","description":"Workspace invitation (admin view)."},"WorkspaceListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/WorkspaceResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"WorkspaceListResponse","description":"Schema for workspace list response."},"WorkspaceMemberResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"role":{"type":"string","title":"Role"},"joined_at":{"type":"string","format":"date-time","title":"Joined At"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["workspace_id","user_id","role","joined_at"],"title":"WorkspaceMemberResponse","description":"Workspace member with basic user profile."},"WorkspaceResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"type":{"type":"string","title":"Type"},"name":{"type":"string","title":"Name"},"visibility":{"type":"string","title":"Visibility"},"owner_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Owner Id"},"policy_json":{"additionalProperties":true,"type":"object","title":"Policy Json"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"member_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Member Count"},"case_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Case Count"},"my_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"My Role"}},"type":"object","required":["id","type","name","visibility","owner_id","policy_json","created_at"],"title":"WorkspaceResponse","description":"Schema for workspace response."}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"},"HTTPBearer":{"type":"http","scheme":"bearer"}}}}