{"openapi":"3.1.0","info":{"title":"Recallium API Server","version":"0.1.0"},"paths":{"/healthz":{"get":{"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/edition":{"get":{"summary":"Edition Route","description":"Edition probe with scheduler + activation diagnostic fields (RCAL-104 §D13).\n\nNo auth required — exposes only observable state. Does not reveal JWT claims\nor secrets. Wizard UI and ops dashboards consume this endpoint.","operationId":"edition_route_api_v1_edition_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/data/stats":{"get":{"tags":["data-management"],"summary":"Get Database Stats","operationId":"get_database_stats_api_data_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatabaseStats"}}}}}}},"/health":{"get":{"summary":"Get Health","description":"Basic health check\n\nReturns simple status and timestamp","operationId":"get_health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/health/detailed":{"get":{"summary":"Get Detailed Health","description":"Detailed health check with system info\nHandles both /api/health and /api/health/detailed\n\nReturns:\n- Database connection status\n- Service health status\n- System information (platform, Python version, uptime, memory, CPU)\n- Statistics (projects, memories, thinking sequences)","operationId":"get_detailed_health_api_health_detailed_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/health":{"get":{"summary":"Get Detailed Health","description":"Detailed health check with system info\nHandles both /api/health and /api/health/detailed\n\nReturns:\n- Database connection status\n- Service health status\n- System information (platform, Python version, uptime, memory, CPU)\n- Statistics (projects, memories, thinking sequences)","operationId":"get_detailed_health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/health/auth-config":{"get":{"summary":"Get Auth Config Selftest","description":"Unauthenticated OIDC config self-test — proves auth is wired correctly with\nNO identity/token. Checks: OIDC env present; MCP_RESOURCE_URL != OIDC_AUDIENCE\n(the Entra single-registration collapse / audience-confusion guard); and the\nconfigured JWKS URL (static env only — SSRF-safe, never request-supplied) is\nreachable and carries an RSA key. Returns 200 {ok:true,...} or 503 {ok:false,\nfailures:[...]}. Liveness/readiness stay separate and unauthenticated.","operationId":"get_auth_config_selftest_api_health_auth_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/version":{"get":{"summary":"Get Version","description":"Get version information with update check.\n\nReturns:\n- current_version: Installed version\n- latest_version: Latest available (or null if unknown)\n- update_available: True if newer version exists\n- update_required: True if current < minimum_required\n- critical_update: True if critical patch available\n- changelog_url: URL to changelog\n- last_checked: ISO timestamp of last check","operationId":"get_version_api_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/update/command":{"get":{"summary":"Get Update Command","description":"Get the command to update Recallium.\n\nDetects OS from User-Agent and returns appropriate command.\nIf RECALLIUM_INSTALL_PATH is set, returns full path command.\n\nReturns:\n- command: The shell command to run (copy-paste ready)\n- install_path: The install directory (if known)\n- script: Just the script name\n- instructions: Human-readable instructions","operationId":"get_update_command_api_update_command_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/mcp-status":{"get":{"summary":"Mcp Status","description":"MCP status endpoint.\n\nShows active connections and server info.\n\nArgs:\n    full: If True, show full tool schemas","operationId":"mcp_status_mcp_status_get","parameters":[{"name":"full","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Full"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp-capabilities":{"get":{"summary":"Mcp Capabilities","description":"MCP capabilities endpoint.\n\nLightweight endpoint for capability checking.","operationId":"mcp_capabilities_mcp_capabilities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/oauth-protected-resource":{"get":{"tags":["oauth-metadata"],"summary":"Protected Resource Root","operationId":"protected_resource_root__well_known_oauth_protected_resource_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"head":{"tags":["oauth-metadata"],"summary":"Protected Resource Root","operationId":"protected_resource_root__well_known_oauth_protected_resource_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/oauth-protected-resource/mcp":{"get":{"tags":["oauth-metadata"],"summary":"Protected Resource Mcp","operationId":"protected_resource_mcp__well_known_oauth_protected_resource_mcp_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"head":{"tags":["oauth-metadata"],"summary":"Protected Resource Mcp","operationId":"protected_resource_mcp__well_known_oauth_protected_resource_mcp_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"tags":["oauth-metadata"],"summary":"Authorization Server Metadata Root","operationId":"authorization_server_metadata_root__well_known_oauth_authorization_server_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"head":{"tags":["oauth-metadata"],"summary":"Authorization Server Metadata Root","operationId":"authorization_server_metadata_root__well_known_oauth_authorization_server_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/.well-known/oauth-authorization-server/mcp":{"get":{"tags":["oauth-metadata"],"summary":"Authorization Server Metadata Mcp","operationId":"authorization_server_metadata_mcp__well_known_oauth_authorization_server_mcp_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"head":{"tags":["oauth-metadata"],"summary":"Authorization Server Metadata Mcp","operationId":"authorization_server_metadata_mcp__well_known_oauth_authorization_server_mcp_head","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/tasks":{"post":{"tags":["tasks (D3)"],"summary":"Create Task Route","operationId":"create_task_route_api_v2_tasks_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Task Route Api V2 Tasks Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["tasks (D3)"],"summary":"List Tasks Route","description":"Tasks visible to the caller, optionally narrowed to a project, a status,\nand (with a project) one workstream: ``workstream_id`` is the workstream's\nuuid, matched against each task's anchor.","operationId":"list_tasks_route_api_v2_tasks_get","parameters":[{"name":"project_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Uuid"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"workstream_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workstream Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Tasks Route Api V2 Tasks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/tasks/{task_uuid}":{"get":{"tags":["tasks (D3)"],"summary":"Fetch Task Route","operationId":"fetch_task_route_api_v2_tasks__task_uuid__get","parameters":[{"name":"task_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Fetch Task Route Api V2 Tasks  Task Uuid  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["tasks (D3)"],"summary":"Update Task Route","description":"Full task patch: description and/or status.\n\nPR-C2: goes straight through ITaskRepository.update — the old raw-SQL\nJSONB-merge exception path (memories table, H4 bootstrap) no longer\napplies; `tasks` has no metadata column and the repo is already\nproject-scoped via project_id on the row.","operationId":"update_task_route_api_v2_tasks__task_uuid__patch","parameters":[{"name":"task_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Task Route Api V2 Tasks  Task Uuid  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tasks (D3)"],"summary":"Delete Task Route","description":"Scoped soft-delete (replaces the legacy unscoped hard DELETE\n/api/tasks/{id}). A task outside the caller's scope 404s.","operationId":"delete_task_route_api_v2_tasks__task_uuid__delete","parameters":[{"name":"task_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Uuid"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/tasks/{task_uuid}/status":{"patch":{"tags":["tasks (D3)"],"summary":"Update Status Route","operationId":"update_status_route_api_v2_tasks__task_uuid__status_patch","parameters":[{"name":"task_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStatusRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Status Route Api V2 Tasks  Task Uuid  Status Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/tasks/{task_uuid}/memories":{"post":{"tags":["tasks (D3)"],"summary":"Link Memories Route","operationId":"link_memories_route_api_v2_tasks__task_uuid__memories_post","parameters":[{"name":"task_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkMemoriesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"},"title":"Response Link Memories Route Api V2 Tasks  Task Uuid  Memories Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/projects":{"post":{"tags":["projects (D3)"],"summary":"Create Project Route","operationId":"create_project_route_api_v2_projects_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertProjectRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Project Route Api V2 Projects Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["projects (D3)"],"summary":"List Projects Route","operationId":"list_projects_route_api_v2_projects_get","parameters":[{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Projects Route Api V2 Projects Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/projects/by-id/{project_uuid}":{"get":{"tags":["projects (D3)"],"summary":"Fetch Project Route","operationId":"fetch_project_route_api_v2_projects_by_id__project_uuid__get","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Fetch Project Route Api V2 Projects By Id  Project Uuid  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["projects (D3)"],"summary":"Delete Project Route","description":"Scoped soft-delete (replaces the legacy unscoped hard DELETE\n/api/projects/{id}, where any authenticated caller could delete any\ntenant's project). A project outside the caller's scope 404s.","operationId":"delete_project_route_api_v2_projects_by_id__project_uuid__delete","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["projects (D3)"],"summary":"Update Project By Id Route","description":"Update a project by UUID. Allows rename (body.name is the new name).","operationId":"update_project_by_id_route_api_v2_projects_by_id__project_uuid__patch","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertProjectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Project By Id Route Api V2 Projects By Id  Project Uuid  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/projects/by-name/{name}":{"get":{"tags":["projects (D3)"],"summary":"Fetch Project By Name Route","operationId":"fetch_project_by_name_route_api_v2_projects_by_name__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Fetch Project By Name Route Api V2 Projects By Name  Name  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["projects (D3)"],"summary":"Update Project Route","operationId":"update_project_route_api_v2_projects_by_name__name__patch","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertProjectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Project Route Api V2 Projects By Name  Name  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/projects/by-id/{project_uuid}/reactivate":{"post":{"tags":["projects (D3)"],"summary":"Reactivate Project Route","description":"Undo a soft delete: is_active back to TRUE, deleted_at cleared. The\nREST twin of MCP update_project(status='active'); Owner-only on\nenterprise inside IProjectRepository.reactivate (ProjectAccessDenied →\n403). Idempotent: an already-active project returns 200 with its row.\nA project outside the caller's scope 404s, like the delete.","operationId":"reactivate_project_route_api_v2_projects_by_id__project_uuid__reactivate_post","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reactivate Project Route Api V2 Projects By Id  Project Uuid  Reactivate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/projects/{project_uuid}/sessions":{"get":{"tags":["projects (D3)"],"summary":"List Project Sessions Route","description":"List sessions for a project (scoped by RLS).","operationId":"list_project_sessions_route_api_v2_projects__project_uuid__sessions_get","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Project Sessions Route Api V2 Projects  Project Uuid  Sessions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["projects (D3)"],"summary":"Create Project Session Route","description":"Create a session for a project.","operationId":"create_project_session_route_api_v2_projects__project_uuid__sessions_post","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Project Session Route Api V2 Projects  Project Uuid  Sessions Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/projects/{project_uuid}/links":{"get":{"tags":["projects (D3)"],"summary":"List Project Links Route","description":"List a project's links in both directions (`direction` is 'outgoing' or\n'incoming'), each flagged `is_live` for the caller's current access.","operationId":"list_project_links_route_api_v2_projects__project_uuid__links_get","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Project Links Route Api V2 Projects  Project Uuid  Links Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["projects (D3)"],"summary":"Create Project Link Route","description":"Create a link between this project and another.","operationId":"create_project_link_route_api_v2_projects__project_uuid__links_post","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLinkRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Project Link Route Api V2 Projects  Project Uuid  Links Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/projects/{project_uuid}/links/{target_project_uuid}":{"put":{"tags":["projects (D3)"],"summary":"Update Project Link Route","description":"Update the relationship/metadata on a project link.","operationId":"update_project_link_route_api_v2_projects__project_uuid__links__target_project_uuid__put","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}},{"name":"target_project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Target Project Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Project Link Route Api V2 Projects  Project Uuid  Links  Target Project Uuid  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["projects (D3)"],"summary":"Delete Project Link Route","description":"Remove a project link.","operationId":"delete_project_link_route_api_v2_projects__project_uuid__links__target_project_uuid__delete","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}},{"name":"target_project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Target Project Uuid"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/projects/{project_uuid}/relationship-hints":{"get":{"tags":["projects (D3)"],"summary":"Get Relationship Hints Route","description":"Return relationship suggestions based on shared tags.","operationId":"get_relationship_hints_route_api_v2_projects__project_uuid__relationship_hints_get","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}},{"name":"min_references","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":3,"title":"Min References"}},{"name":"min_shared_tags","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":5,"title":"Min Shared Tags"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Relationship Hints Route Api V2 Projects  Project Uuid  Relationship Hints Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/projects/{project_uuid}/memories":{"get":{"tags":["projects (D3)"],"summary":"List Project Memories Route","description":"Rich-filter list of memories for a project.\n\n`light=true` is the shape the Timeline and the detail rail read: they show\na title per row, so shipping `content` (and `metadata`, `smart_tags`) for\n200 rows was a multi-megabyte answer to a question about titles. The\nWHERE/ORDER/LIMIT are identical, so the two shapes always agree on which\nrows exist; only the SELECT list differs.","operationId":"list_project_memories_route_api_v2_projects__project_uuid__memories_get","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}},{"name":"importance_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Importance Min"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"order_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"created_at","title":"Order By"}},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"DESC","title":"Direction"}},{"name":"memory_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memory Type"}},{"name":"session_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Name"}},{"name":"anchor_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anchor Id"}},{"name":"unanchored","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unanchored"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"light","in":"query","required":false,"schema":{"type":"boolean","description":"Headline projection for lists: id, title, summary, type, importance, author, dates and the workstream tie — no content, metadata or tags. Same filters and order; the row is a few hundred bytes instead of a memory's whole body.","default":false,"title":"Light"},"description":"Headline projection for lists: id, title, summary, type, importance, author, dates and the workstream tie — no content, metadata or tags. Same filters and order; the row is a few hundred bytes instead of a memory's whole body."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Project Memories Route Api V2 Projects  Project Uuid  Memories Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["projects (D3)"],"summary":"Delete Project Memories Route","description":"Soft-delete memories in a project, optionally filtered.","operationId":"delete_project_memories_route_api_v2_projects__project_uuid__memories_delete","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}},{"name":"session_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Name"}},{"name":"memory_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memory Type"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/projects/{project_uuid}/tasks":{"get":{"tags":["projects (D3)"],"summary":"List Project Tasks Route","description":"List tasks (memory_type='task') for a project.","operationId":"list_project_tasks_route_api_v2_projects__project_uuid__tasks_get","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Project Tasks Route Api V2 Projects  Project Uuid  Tasks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["projects (D3)"],"summary":"Create Project Task Route","description":"Create a task under a project.","operationId":"create_project_task_route_api_v2_projects__project_uuid__tasks_post","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectTaskRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Project Task Route Api V2 Projects  Project Uuid  Tasks Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/analytics":{"get":{"tags":["analytics (D3)"],"summary":"Get Analytics Route","description":"Return scoped aggregates for the caller's org+team projects only.\n\nResponse shape follows the legacy ``GET /api/analytics``, with two W1/PR3\ndepartures:\n  * ``database.total_patterns`` and the ``patterns`` block are GONE on both\n    editions — the pattern_library_v2 read behind them was deleted (zero\n    producers, zero UI readers, name-matched \"scoping\").\n  * ``database.total_insights``, the ``insights`` block, and\n    ``projectBreakdown[].insight_count`` are present only on editions that\n    report insights. On community they are ABSENT, not zero.\n\nRaises:\n    503  project_repo, insight_repo, or database not registered.","operationId":"get_analytics_route_api_v2_analytics_get","parameters":[{"name":"project_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Name"}},{"name":"timeframe","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"default":"30 days","title":"Timeframe"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Analytics Route Api V2 Analytics Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/analytics/work":{"get":{"tags":["analytics (D3)"],"summary":"Get Work Route","description":"Per-project aggregates behind the dashboard's \"Your work\" tab: what was\nrecorded in the window by type and author, the daily series, and each\nproject's workstreams, diagnoses, open tasks, documents, edges and verdicts\n(design 01a1dcd4-5b34-7029-ba95-36e56e283273). ``days`` is 7, 30 or 90;\nanything else reads as 30. Restricted to the caller's visible projects.\n\nRaises:\n    503  project_repo or database not registered.","operationId":"get_work_route_api_v2_analytics_work_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Work Route Api V2 Analytics Work Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/analytics/economics":{"get":{"tags":["analytics (D3)"],"summary":"Get Economics Route","description":"What the caller's memories weigh in tokens, for the dashboard's Memory\nEconomics tab (design 01a1dfc5-aa3e-792a-9c31-3667f8b3c782): the average\nmemory and its split, the caller's share, what the period added, by type,\nby project, by day and the heaviest memories. ``scope`` is all, only_you,\nshared_by_you or shared_with_you; ``days`` is 7, 30 or 90. Restricted to the caller's visible projects.\n\nRaises:\n    503  project_repo or database not registered.\n    404  ``project`` given and not one of the caller's visible projects.","operationId":"get_economics_route_api_v2_analytics_economics_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days"}},{"name":"scope","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"}},{"name":"project","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A project uuid: that one project only (the project page).","title":"Project"},"description":"A project uuid: that one project only (the project page)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Economics Route Api V2 Analytics Economics Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/analytics/tokens":{"get":{"tags":["analytics (D3)"],"summary":"Get Tokens Route","description":"Scoped token usage analytics for the dashboard widget + analytics page.","operationId":"get_tokens_route_api_v2_analytics_tokens_get","parameters":[{"name":"project_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Name"}},{"name":"memory_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memory Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Tokens Route Api V2 Analytics Tokens Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/analytics/tokens/memories":{"get":{"tags":["analytics (D3)"],"summary":"Get Token Memories Route","description":"Scoped per-memory token details (drill-down list).","operationId":"get_token_memories_route_api_v2_analytics_tokens_memories_get","parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Project Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Token Memories Route Api V2 Analytics Tokens Memories Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/analytics/memory-graph":{"get":{"tags":["analytics (D3)"],"summary":"Get Memory Graph Route","description":"Scoped memory-graph for Dashboard's MemoryGraphWidget.\n\nReturns the same shape as the legacy /api/analytics/memory-graph so\nthe widget needs no logic change beyond the URL repoint.\n\nRestricts visibility to projects in the caller's org+team scope.\nCross-tenant memories cannot appear in the graph even if a cluster\nmembership transitively links them.","operationId":"get_memory_graph_route_api_v2_analytics_memory_graph_get","parameters":[{"name":"top_projects","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"description":"Top N projects by memory count","default":3,"title":"Top Projects"},"description":"Top N projects by memory count"},{"name":"memories_per_project","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":5,"description":"Max memories per project","default":30,"title":"Memories Per Project"},"description":"Max memories per project"},{"name":"include_connections","in":"query","required":false,"schema":{"type":"boolean","description":"Include memory connections","default":true,"title":"Include Connections"},"description":"Include memory connections"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Memory Graph Route Api V2 Analytics Memory Graph Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/analytics/status":{"get":{"tags":["analytics (D3)"],"summary":"Get Analytics Status","description":"Return analytics collection status and configuration (platform-admin).\n\nResponse shape lifted verbatim from legacy\n``analytics.py:get_analytics_status`` so the admin console needs\nno changes beyond the URL repoint.","operationId":"get_analytics_status_api_v2_analytics_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/analytics/collect":{"post":{"tags":["analytics (D3)"],"summary":"Trigger Analytics Collection","description":"Manually trigger analytics collection (platform-admin).\n\nTriggers a single GLOBAL snapshot — not per-tenant.  Delegates to\n``container.analytics_collector.collect_snapshot()``; 503s if the\ncollector is not initialised on this edition.","operationId":"trigger_analytics_collection_api_v2_analytics_collect_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/memories":{"get":{"tags":["memories (D3)"],"summary":"List Memories Route","operationId":"list_memories_route_api_v2_memories_get","parameters":[{"name":"project_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Uuid"}},{"name":"memory_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memory Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"processing_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing Status"}},{"name":"search_query","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Query"}},{"name":"order_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order By"}},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"}},{"name":"session_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Name"}},{"name":"has_embedding","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Embedding"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Memories Route Api V2 Memories Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["memories (D3)"],"summary":"Store Memory Route","operationId":"store_memory_route_api_v2_memories_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreMemoryRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Store Memory Route Api V2 Memories Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memories/bulk-status":{"post":{"tags":["memories (D3)"],"summary":"Bulk Status Route","description":"Activate or deactivate a batch of memories (up to 100 per call).","operationId":"bulk_status_route_api_v2_memories_bulk_status_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memories/search/{project_uuid}":{"get":{"tags":["memories (D3)"],"summary":"Search Memories Route","operationId":"search_memories_route_api_v2_memories_search__project_uuid__get","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}},{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Search Memories Route Api V2 Memories Search  Project Uuid  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memories/{memory_uuid}/edges":{"get":{"tags":["memories (D3)"],"summary":"Get Memory Edges Route","description":"Every `memory_edges` row touching this memory, both directions, each\ncarrying the other endpoint (title, type, state) and WHERE it lives\n(workstream slug + title). Edge types: supersedes | constrains | related |\ncontradicts (taxonomy.EDGE_TYPES); `direction` is outbound when this\nmemory is the edge's from_id, inbound when it is the to_id — `related`\nis symmetric, so its direction carries no meaning. Newest edge first,\ncapped at EDGES_LIMIT.","operationId":"get_memory_edges_route_api_v2_memories__memory_uuid__edges_get","parameters":[{"name":"memory_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Memory Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Memory Edges Route Api V2 Memories  Memory Uuid  Edges Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memories/{memory_uuid}/related":{"get":{"tags":["memories (D3)"],"summary":"Get Related Memories Route","description":"Memories linked to this one: every active neighbour over `memory_edges`\n(either direction, any edge type), plus — for rows that pre-date the edge\nmodel — the legacy `related_memory_ids` JSONB list. store_memory stopped\nwriting that list when `relationships` edges landed, so reading it alone\nreturned nothing for every memory stored since (bugfix\n01a173a9-8d86-7108-a3bf-238d06e93524). Flat memory rows, deduplicated;\nuse /edges for the edge type and direction.","operationId":"get_related_memories_route_api_v2_memories__memory_uuid__related_get","parameters":[{"name":"memory_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Memory Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Related Memories Route Api V2 Memories  Memory Uuid  Related Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memories/{memory_uuid}":{"get":{"tags":["memories (D3)"],"summary":"Fetch Memory Route","operationId":"fetch_memory_route_api_v2_memories__memory_uuid__get","parameters":[{"name":"memory_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Memory Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Fetch Memory Route Api V2 Memories  Memory Uuid  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["memories (D3)"],"summary":"Update Memory Route","operationId":"update_memory_route_api_v2_memories__memory_uuid__patch","parameters":[{"name":"memory_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Memory Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemoryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Memory Route Api V2 Memories  Memory Uuid  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["memories (D3)"],"summary":"Delete Memory Route","operationId":"delete_memory_route_api_v2_memories__memory_uuid__delete","parameters":[{"name":"memory_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Memory Uuid"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memories/diagnoses":{"get":{"tags":["memories (D3)"],"summary":"List Diagnoses Route","description":"The project's diagnoses with their derived resolution. Derives over\nthe newest 500 (created_at DESC, uuid DESC), filters by `resolution`,\nthen pages (design 01a1d9e8 F9).","operationId":"list_diagnoses_route_api_v2_memories_diagnoses_get","parameters":[{"name":"project_uuid","in":"query","required":true,"schema":{"type":"string","title":"Project Uuid"}},{"name":"resolution","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Diagnoses Route Api V2 Memories Diagnoses Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memories/{memory_uuid}/resolution":{"get":{"tags":["memories (D3)"],"summary":"Diagnosis Resolution Route","description":"One diagnosis's derived resolution (design 01a1d9e4 §C). 404 when the\nuuid is unknown, not visible, or not a diagnosis; an old version id\nresolves to the current version first (design 01a1d9e8 F5).","operationId":"diagnosis_resolution_route_api_v2_memories__memory_uuid__resolution_get","parameters":[{"name":"memory_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Memory Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Diagnosis Resolution Route Api V2 Memories  Memory Uuid  Resolution Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/thinking":{"post":{"tags":["thinking (D3)"],"summary":"Start Thinking Route","operationId":"start_thinking_route_api_v2_thinking_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartThinkingRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Start Thinking Route Api V2 Thinking Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["thinking (D3)"],"summary":"List Sequences Route","operationId":"list_sequences_route_api_v2_thinking_get","parameters":[{"name":"project_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Uuid"}},{"name":"include_complete","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Complete"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Sequences Route Api V2 Thinking Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/thinking/{sequence_uuid}":{"get":{"tags":["thinking (D3)"],"summary":"Fetch Sequence Route","operationId":"fetch_sequence_route_api_v2_thinking__sequence_uuid__get","parameters":[{"name":"sequence_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sequence Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Fetch Sequence Route Api V2 Thinking  Sequence Uuid  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/thinking/{sequence_uuid}/thoughts":{"post":{"tags":["thinking (D3)"],"summary":"Add Thought Route","operationId":"add_thought_route_api_v2_thinking__sequence_uuid__thoughts_post","parameters":[{"name":"sequence_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sequence Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddThoughtRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Add Thought Route Api V2 Thinking  Sequence Uuid  Thoughts Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/thinking/{sequence_uuid}/complete":{"patch":{"tags":["thinking (D3)"],"summary":"Complete Sequence Route","operationId":"complete_sequence_route_api_v2_thinking__sequence_uuid__complete_patch","parameters":[{"name":"sequence_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Sequence Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteSequenceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Complete Sequence Route Api V2 Thinking  Sequence Uuid  Complete Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/rules":{"get":{"tags":["rules (D3)"],"summary":"List Rules Route","operationId":"list_rules_route_api_v2_rules_get","parameters":[{"name":"project_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Uuid"}},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Rules Route Api V2 Rules Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rules (D3)"],"summary":"Create Rule Route","operationId":"create_rule_route_api_v2_rules_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRuleRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Rule Route Api V2 Rules Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/rules/{rule_id}":{"patch":{"tags":["rules (D3)"],"summary":"Update Rule Route","operationId":"update_rule_route_api_v2_rules__rule_id__patch","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRuleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Rule Route Api V2 Rules  Rule Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/rules/{rule_id}/deactivate":{"post":{"tags":["rules (D3)"],"summary":"Deactivate Rule Route","operationId":"deactivate_rule_route_api_v2_rules__rule_id__deactivate_post","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Deactivate Rule Route Api V2 Rules  Rule Id  Deactivate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/rules/{rule_id}/reactivate":{"post":{"tags":["rules (D3)"],"summary":"Reactivate Rule Route","operationId":"reactivate_rule_route_api_v2_rules__rule_id__reactivate_post","parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reactivate Rule Route Api V2 Rules  Rule Id  Reactivate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/documents":{"post":{"tags":["documents (D3)"],"summary":"Store Document Route","operationId":"store_document_route_api_v2_documents_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreDocumentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Store Document Route Api V2 Documents Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["documents (D3)"],"summary":"List Documents Route","operationId":"list_documents_route_api_v2_documents_get","parameters":[{"name":"project_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Uuid"}},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Inactive"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Documents Route Api V2 Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/documents/stats":{"get":{"tags":["documents (D3)"],"summary":"Document Stats Route","description":"Scoped document statistics (tenant-isolated replacement for the legacy\nunscoped /api/documents/stats). Declared BEFORE /{document_id} so the\nliteral 'stats' segment is not captured as a document id. Returns the same\nenvelope shape the UI's DocumentStats consumes (counts as strings).","operationId":"document_stats_route_api_v2_documents_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Document Stats Route Api V2 Documents Stats Get"}}}}}}},"/api/v2/documents/upload":{"post":{"tags":["documents (D3)"],"summary":"Upload Document Route","description":"Upload a single document file for a project.\n\nFull pipeline: bytes → temp file → DocumentService.process_document.\nThat flow persists bytes via DocumentStorageService (/documents),\ncreates the memory + documents + document_files rows, and queues\nfor background chunking (PyPDFLoader for PDFs, Docx2txtLoader for\nDOCX, TextLoader for text/md/code, CSVLoader for CSVs).\n\nResponse is UUID-only — no int PKs leak to the client.","operationId":"upload_document_route_api_v2_documents_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document_route_api_v2_documents_upload_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Upload Document Route Api V2 Documents Upload Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/documents/bulk":{"post":{"tags":["documents (D3)"],"summary":"Bulk Upload Documents Route","description":"Upload multiple document files in one request. Same flow as\n/upload but iterating; failures on individual files are collected\nwithout aborting the batch.","operationId":"bulk_upload_documents_route_api_v2_documents_bulk_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_bulk_upload_documents_route_api_v2_documents_bulk_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Bulk Upload Documents Route Api V2 Documents Bulk Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/documents/search":{"post":{"tags":["documents (D3)"],"summary":"Search Documents Route","description":"Keyword search over document title + content for a project.","operationId":"search_documents_route_api_v2_documents_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Search Documents Route Api V2 Documents Search Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/documents/{document_uuid}/process":{"post":{"tags":["documents (D3)"],"summary":"Process Held Document Route","description":"Process a document that was held at upload (design 206 §3.3).\n\nA document is HELD by default on every tier — chunked and stored, with no\nembedding, tags or LLM spend — until the user asks. This is the ask.\n\n202, not 200: the flip is synchronous but the enrichment it triggers is\nnot. The response says \"accepted\", and the documents page shows the chunk\ncount moving from held to enriched as the worker gets to them.\n\n404 covers not-found, not-yours, and nothing-held alike. That is\ndeliberate: a distinct \"not yours\" confirms the document exists, and a\ndistinct \"already processed\" leaks that it was. There is nothing here for\nthis caller to process, and that is the whole answer.","operationId":"process_held_document_route_api_v2_documents__document_uuid__process_post","parameters":[{"name":"document_uuid","in":"path","required":true,"schema":{"type":"string","title":"Document Uuid"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Process Held Document Route Api V2 Documents  Document Uuid  Process Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/documents/{document_uuid}":{"get":{"tags":["documents (D3)"],"summary":"Fetch Document Route","operationId":"fetch_document_route_api_v2_documents__document_uuid__get","parameters":[{"name":"document_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Fetch Document Route Api V2 Documents  Document Uuid  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["documents (D3)"],"summary":"Delete Document Route","operationId":"delete_document_route_api_v2_documents__document_uuid__delete","parameters":[{"name":"document_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Uuid"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/documents/{document_uuid}/chunks":{"get":{"tags":["documents (D3)"],"summary":"List Document Chunks Route","operationId":"list_document_chunks_route_api_v2_documents__document_uuid__chunks_get","parameters":[{"name":"document_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Document Chunks Route Api V2 Documents  Document Uuid  Chunks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/documents/{document_uuid}/download":{"get":{"tags":["documents (D3)"],"summary":"Download Document Route","description":"Stream document content as a downloadable file.\n\nCommunity only. On the enterprise edition the download surface does not\nexist (Manuj's PR-12 ruling, decision 01a17021-98cc-75e9-9703-afb28611b74a:\n\"not applicable, remove the path\") — the route answers 404 before any\nlookup, and the web app hides the Download action on SaaS.\n\nRFC-5987: filename is sanitized to strip CR, LF, and double-quote.","operationId":"download_document_route_api_v2_documents__document_uuid__download_get","parameters":[{"name":"document_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/search/analyze":{"get":{"tags":["search (D3)"],"summary":"Analyze Query Route","description":"Classify a query's shape. Pure algorithm, no I/O.","operationId":"analyze_query_route_api_v2_search_analyze_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Query string to classify","title":"Q"},"description":"Query string to classify"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Analyze Query Route Api V2 Search Analyze Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/search/memories":{"get":{"tags":["search (D3)"],"summary":"Keyword Search Route","description":"Keyword-style search over the org-scoped memory repo.","operationId":"keyword_search_route_api_v2_search_memories_get","parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"integer","description":"Project to search within","title":"Project Id"},"description":"Project to search within"},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"description":"Search query","title":"Q"},"description":"Search query"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max results","default":20,"title":"Limit"},"description":"Max results"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Keyword Search Route Api V2 Search Memories Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/search/memories/semantic":{"post":{"tags":["search (D3)"],"summary":"Semantic Search Route","description":"Semantic / hybrid search over the caller's scoped memories.\n\nResolves project_uuid → int (security H2) then delegates to the\nSearchOrchestrator — the single supported engine. It filters by\nproject_ids directly, so no name lookup is needed. RLS is already\napplied via the pool GUC. With no project_uuid, project_ids=None makes\nthe orchestrator resolve the caller's visible projects from scope.","operationId":"semantic_search_route_api_v2_search_memories_semantic_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SemanticSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Semantic Search Route Api V2 Search Memories Semantic Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/audit/events":{"get":{"tags":["audit (D3)"],"summary":"List Audit Events Route","operationId":"list_audit_events_route_api_v2_audit_events_get","parameters":[{"name":"action_prefix","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Prefix"}},{"name":"target_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Type"}},{"name":"actor_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Actor User Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Audit Events Route Api V2 Audit Events Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/admin/audit-log":{"get":{"tags":["admin (D3)"],"summary":"View Audit Log Route","operationId":"view_audit_log_route_api_v2_admin_audit_log_get","parameters":[{"name":"action_prefix","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Prefix"}},{"name":"target_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Type"}},{"name":"actor_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Actor User Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response View Audit Log Route Api V2 Admin Audit Log Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/config":{"get":{"tags":["config (D3)"],"summary":"Get All Config","description":"Return all configuration values (READ-ONLY, platform-admin).\n\nResponse shape identical to legacy ``GET /api/config`` — the\nAdmin Config page consumes ``data.<category>.<key>`` unchanged.","operationId":"get_all_config_api_v2_config_get","parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by category (models, features, settings, prompts, system)","title":"Category"},"description":"Filter by category (models, features, settings, prompts, system)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["config (D3)"],"summary":"Bulk Update Config","description":"Bulk update configuration — NOT SUPPORTED (405).","operationId":"bulk_update_config_api_v2_config_put","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/config/{key}":{"get":{"tags":["config (D3)"],"summary":"Get Config Value","description":"Return a single configuration value by key (platform-admin).","operationId":"get_config_value_api_v2_config__key__get","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","description":"Configuration key","title":"Key"},"description":"Configuration key"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["config (D3)"],"summary":"Update Config Value","description":"Update a single configuration value — NOT SUPPORTED (405).\n\nConfig is managed via environment variables + Vault.","operationId":"update_config_value_api_v2_config__key__put","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","description":"Configuration key","title":"Key"},"description":"Configuration key"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/config/reset":{"post":{"tags":["config (D3)"],"summary":"Reset Config","description":"Reset configuration — NOT SUPPORTED (405).","operationId":"reset_config_api_v2_config_reset_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/context/summon":{"get":{"tags":["context (refresh hooks)"],"summary":"Summon Context","description":"Summon project context for a lifecycle hook (or any REST caller).","operationId":"summon_context_api_v2_context_summon_get","parameters":[{"name":"project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Id"}},{"name":"project_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Name"}},{"name":"mode","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SummonMode","default":"full"}},{"name":"trigger","in":"query","required":false,"schema":{"$ref":"#/components/schemas/SummonTrigger","default":"manual"}},{"name":"X-Recallium-Client-Agent","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Recallium-Client-Agent"}},{"name":"X-Recallium-Client-Name","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Recallium-Client-Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/janitor/tasks":{"get":{"tags":["janitor (D3)"],"summary":"List Janitor Tasks","description":"List all registered janitor tasks with last-run + due status.","operationId":"list_janitor_tasks_api_v2_janitor_tasks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/janitor/tasks/{task_name}/run":{"post":{"tags":["janitor (D3)"],"summary":"Run Janitor Task","description":"Run a specific janitor task immediately (admin, destructive).","operationId":"run_janitor_task_api_v2_janitor_tasks__task_name__run_post","parameters":[{"name":"task_name","in":"path","required":true,"schema":{"type":"string","description":"Name of the janitor task to run","title":"Task Name"},"description":"Name of the janitor task to run"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/janitor/tasks/{task_name}/history":{"get":{"tags":["janitor (D3)"],"summary":"Get Task History","description":"Return execution history for a specific janitor task.","operationId":"get_task_history_api_v2_janitor_tasks__task_name__history_get","parameters":[{"name":"task_name","in":"path","required":true,"schema":{"type":"string","description":"Name of the janitor task","title":"Task Name"},"description":"Name of the janitor task"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max records to return","default":20,"title":"Limit"},"description":"Max records to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/janitor/dedup/preview":{"post":{"tags":["janitor (D3)"],"summary":"Preview Dedup","description":"Preview cross-tenant duplicate pairs above the similarity threshold.\n\nCross-tenant preserved by design — janitor optimizes globally.\nCommunity (no cluster tables) returns an empty envelope with\n``clusters_available: False`` so callers can distinguish \"no\nduplicates\" from \"clusters aren't part of this deployment\".","operationId":"preview_dedup_api_v2_janitor_dedup_preview_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Preview Dedup Api V2 Janitor Dedup Preview Post"}}}}}}},"/api/v2/providers/llm":{"get":{"tags":["providers (D3)"],"summary":"List Llm Providers","description":"List all LLM providers (platform-admin).","operationId":"list_llm_providers_api_v2_providers_llm_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/providers/llm/{provider_id}":{"get":{"tags":["providers (D3)"],"summary":"Get Llm Provider","description":"Return a specific LLM provider (platform-admin).","operationId":"get_llm_provider_api_v2_providers_llm__provider_id__get","parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","description":"Stringified LLM provider id","title":"Provider Id"},"description":"Stringified LLM provider id"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/providers/llm/{provider_id}/health":{"get":{"tags":["providers (D3)"],"summary":"Health Check Llm Provider","description":"Return a basic health summary for one LLM provider (platform-admin).","operationId":"health_check_llm_provider_api_v2_providers_llm__provider_id__health_get","parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","description":"Stringified LLM provider id","title":"Provider Id"},"description":"Stringified LLM provider id"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/providers/embedding-models/active":{"get":{"tags":["providers (D3)"],"summary":"Get Active Embedding Model","description":"Return the currently active embedding model (platform-admin, E9 path).","operationId":"get_active_embedding_model_api_v2_providers_embedding_models_active_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/providers/embedding-models/reembed-progress":{"get":{"tags":["providers (D3)"],"summary":"Get Embedding Reembed Progress","description":"Return per-entity reembed progress (E9 path — delegates to EmbeddingModelService).","operationId":"get_embedding_reembed_progress_api_v2_providers_embedding_models_reembed_progress_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/providers/embedding":{"get":{"tags":["providers (D3)"],"summary":"List Embedding Providers","description":"List embedding providers, falling back to legacy table when empty.","operationId":"list_embedding_providers_api_v2_providers_embedding_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/providers/active":{"get":{"tags":["providers (D3)"],"summary":"Get Active Providers","description":"Return active LLM + embedding rows (platform-admin).","operationId":"get_active_providers_api_v2_providers_active_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/providers/health-check":{"post":{"tags":["providers (D3)"],"summary":"Health Check All Providers","description":"Run a basic health check across all providers (platform-admin).","operationId":"health_check_all_providers_api_v2_providers_health_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/providers/setup/status":{"get":{"tags":["providers (D3)"],"summary":"Get Setup Status","description":"Return setup wizard status counts (platform-admin).","operationId":"get_setup_status_api_v2_providers_setup_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/providers/setup/complete":{"post":{"tags":["providers (D3)"],"summary":"Complete Setup","description":"Setup wizard completion — placeholder, preserved for API surface parity.","operationId":"complete_setup_api_v2_providers_setup_complete_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/embedding/reembed/progress":{"get":{"tags":["reembed (D3)"],"summary":"Get Reembed Progress","description":"Return per-entity re-embedding progress (platform-admin).\n\nUses ``embedding_model_service.get_reembed_progress`` when\nregistered (the canonical source that knows about the cluster\ncarve).  Falls back to raw counts on the same set of tables the\nservice consults.","operationId":"get_reembed_progress_api_v2_embedding_reembed_progress_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/embedding/reembed/needed":{"get":{"tags":["reembed (D3)"],"summary":"Check Reembed Needed","description":"Return ``{\"needed\": bool}`` for the admin Re-embedding tab (admin).","operationId":"check_reembed_needed_api_v2_embedding_reembed_needed_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/embedding/reembed/secondary":{"post":{"tags":["reembed (D3)"],"summary":"Start Secondary Reembed","description":"Start re-embedding for secondary source entities (document chunks).\n\nMemories re-embed via the background worker's ``pending_embed`` queue;\nthis endpoint kicks the orchestrator for their document chunks.\n\nW1/PR5: ``insight_batch_size`` is no longer read from the body. It is\nignored rather than rejected — a stale admin client that still sends it\ngets the chunk re-embed it asked for instead of a 4xx it cannot act on.","operationId":"start_secondary_reembed_api_v2_embedding_reembed_secondary_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/embedding/reembed/clear-all":{"post":{"tags":["reembed (D3)"],"summary":"Clear And Reembed","description":"Clear source embeddings and mark memories pending_embed (DESTRUCTIVE, admin).\n\nClears memories and their document chunks only — see the scope note in the\nmodule docstring. The ``affected`` dict reports exactly those two surfaces;\nthe ``insights`` and ``centroids`` counters are gone rather than reported\nas 0, so a caller cannot mistake \"not handled here\" for \"nothing to do\".\n\nInterlocks preserved verbatim from the legacy handler:\n\n  * ``EXCLUDE_SPLIT_PARENTS_SQL`` — parent rows of a chunk split\n    must NOT re-enter the embed queue (memory #9527 Fix 2).\n  * ``get_embedding_column()`` — respects the runtime dimension pin.","operationId":"clear_and_reembed_api_v2_embedding_reembed_clear_all_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/shares/project/{project_id}":{"post":{"tags":["resource-grants"],"summary":"Share Project Route","description":"Body: {\"team_id\": \"<uuid>\", \"access_level\": \"read\" | \"write\"} (default read).","operationId":"share_project_route_api_v2_shares_project__project_id__post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Share Project Route Api V2 Shares Project  Project Id  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["resource-grants"],"summary":"List Project Shares Route","operationId":"list_project_shares_route_api_v2_shares_project__project_id__get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Project Shares Route Api V2 Shares Project  Project Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/shares/project/{project_id}/teams/{team_id}":{"patch":{"tags":["resource-grants"],"summary":"Set Project Share Access Route","description":"Body: {\"access_level\": \"read\" | \"write\"} — flips an existing share.","operationId":"set_project_share_access_route_api_v2_shares_project__project_id__teams__team_id__patch","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Project Share Access Route Api V2 Shares Project  Project Id  Teams  Team Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["resource-grants"],"summary":"Revoke Project Share Route","operationId":"revoke_project_share_route_api_v2_shares_project__project_id__teams__team_id__delete","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revoke Project Share Route Api V2 Shares Project  Project Id  Teams  Team Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/reset/insights":{"post":{"tags":["reset (D3)"],"summary":"Reset Insights","description":"Reset memory-side insight bookkeeping (platform-admin only).\n\nClears memory graph edges and memory insight-processing timestamps, then\nrequeues all active memories for processing.\n\nW1/PR6: this NO LONGER deletes insight or cluster rows — the background\nworker owns tenant-scoped insight reset. On a deployment that has a\nclustering pipeline this returns ``success: false`` with\n``error: insight_reset_not_owned_here`` and changes nothing, rather than\nreporting a success it cannot deliver.","operationId":"reset_insights_api_v2_reset_insights_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetResult"}}}}}}},"/api/v2/reset/memory-data":{"post":{"tags":["reset (D3)"],"summary":"Reset Memory Data","description":"Reset ALL memory computed fields (platform-admin only, destructive).\n\nWipes embeddings (content + tag), summaries, smart tags, synonyms,\nprocessing status, insights and clustering data. Then requeues all\nactive memories. Cannot be undone.","operationId":"reset_memory_data_api_v2_reset_memory_data_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetResult"}}}}}}},"/api/v2/reset/preview":{"get":{"tags":["reset (D3)"],"summary":"Preview Reset","description":"Preview counts that would be affected by a reset (platform-admin only).\n\nRead-only aggregation. Returned before running the destructive\nreset_* endpoints so the operator can gauge blast radius.","operationId":"preview_reset_api_v2_reset_preview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewResult"}}}}}}},"/api/v2/me":{"get":{"tags":["usage (D3)"],"summary":"Get Me Route","description":"The caller's own identity (email + tier). Ungated — reads auth_context.","operationId":"get_me_route_api_v2_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Me Route Api V2 Me Get"}}}}}},"patch":{"tags":["usage (D3)"],"summary":"Patch Me Route","description":"Update the caller's own display_name; returns the stored value.","operationId":"patch_me_route_api_v2_me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Patch Me Route Api V2 Me Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/quota":{"get":{"tags":["usage (D3)"],"summary":"Get My Quota Route","operationId":"get_my_quota_route_api_v2_me_quota_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get My Quota Route Api V2 Me Quota Get"}}}}}}},"/api/v2/me/preferences":{"get":{"tags":["usage (D3)"],"summary":"Get My Preferences Route","description":"The caller's own display preferences (timezone/locale). Ungated —\nuser_id comes from auth_context, so no cross-user read.","operationId":"get_my_preferences_route_api_v2_me_preferences_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get My Preferences Route Api V2 Me Preferences Get"}}}}}},"patch":{"tags":["usage (D3)"],"summary":"Patch My Preferences Route","description":"Update the caller's own display preferences (partial). Writes to the\ncaller's OWN row only (auth_context.user_id; RLS WITH CHECK enforces it on\nenterprise). Timezone is validated/normalised server-side.","operationId":"patch_my_preferences_route_api_v2_me_preferences_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePreferencesRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Patch My Preferences Route Api V2 Me Preferences Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/export":{"get":{"tags":["usage (D3)"],"summary":"Export My Data Route","description":"GDPR B3 — DSAR data export. Streams a ZIP of the caller's OWN data:\nmanifest.json, profile.json, memories.jsonl, projects.jsonl,\nthinking.jsonl, documents.jsonl. See handlers/data_export.py for the\nisolation contract and manifest shape.","operationId":"export_my_data_route_api_v2_me_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/memory-mgt/stats/duplicates":{"get":{"tags":["memory-management (D3)"],"summary":"Get Duplicate Stats Route","description":"Aggregate statistics about potential duplicates in the caller's scope.","operationId":"get_duplicate_stats_route_api_v2_memory_mgt_stats_duplicates_get","parameters":[{"name":"project_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by project UUID","title":"Project Uuid"},"description":"Filter by project UUID"},{"name":"threshold","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0.0,"default":0.85,"title":"Threshold"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Duplicate Stats Route Api V2 Memory Mgt Stats Duplicates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memory-mgt/duplicates":{"get":{"tags":["memory-management (D3)"],"summary":"Get Duplicates Route","description":"Find potential duplicate memories in the caller's scope.","operationId":"get_duplicates_route_api_v2_memory_mgt_duplicates_get","parameters":[{"name":"project_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by project UUID","title":"Project Uuid"},"description":"Filter by project UUID"},{"name":"threshold","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0.0,"default":0.85,"title":"Threshold"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Duplicates Route Api V2 Memory Mgt Duplicates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memory-mgt/{memory_uuid}/status":{"patch":{"tags":["memory-management (D3)"],"summary":"Update Memory Status Route","description":"Set is_active on a memory; store reason in metadata JSONB.","operationId":"update_memory_status_route_api_v2_memory_mgt__memory_uuid__status_patch","parameters":[{"name":"memory_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Memory Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Memory Status Route Api V2 Memory Mgt  Memory Uuid  Status Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memory-mgt/{memory_uuid}/feedback":{"patch":{"tags":["memory-management (D3)"],"summary":"Update Memory Feedback Route","description":"Store user feedback (like/dislike/null) in metadata JSONB.","operationId":"update_memory_feedback_route_api_v2_memory_mgt__memory_uuid__feedback_patch","parameters":[{"name":"memory_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Memory Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Memory Feedback Route Api V2 Memory Mgt  Memory Uuid  Feedback Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memory-mgt/{memory_uuid}/comments":{"patch":{"tags":["memory-management (D3)"],"summary":"Update Memory Comments Route","description":"Store user comments in metadata JSONB under 'user_comments'.","operationId":"update_memory_comments_route_api_v2_memory_mgt__memory_uuid__comments_patch","parameters":[{"name":"memory_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Memory Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentsUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Memory Comments Route Api V2 Memory Mgt  Memory Uuid  Comments Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/workstreams":{"get":{"tags":["workstreams (D3)"],"summary":"List Workstreams Route","description":"Roster of workstreams: one project, or every project the caller sees.\n\n`unanchored_count` is returned only for a single project — a cross-project\nfigure would be a sum the caller cannot act on from one screen.","operationId":"list_workstreams_route_api_v2_workstreams_get","parameters":[{"name":"project_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Uuid"}},{"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":{"type":"object","additionalProperties":true,"title":"Response List Workstreams Route Api V2 Workstreams Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/workstreams/{project_uuid}/{slug}":{"get":{"tags":["workstreams (D3)"],"summary":"Get Workstream Route","description":"One workstream with the memories anchored to it.\n\nDeliberately NOT grouped server-side: the client groups by `memory_type`.\nWhat the server does owe it is the currency annotation (which children\nare superseded, and by what) and the true per-type totals, neither of\nwhich can be recovered from the returned rows.","operationId":"get_workstream_route_api_v2_workstreams__project_uuid___slug__get","parameters":[{"name":"project_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Project Uuid"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Workstream Route Api V2 Workstreams  Project Uuid   Slug  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/working-state":{"get":{"tags":["workstreams (D3)"],"summary":"Get Working State Route","description":"The CALLER's own resume buffers, newest first.\n\n`resolve_current_user_id` is transport-independent — it returns\n`scope.user_id` on a scoped deployment and the fixed local user on\ncommunity — so it is correct for a REST request, not only for the MCP\ndoor. The explicit `user_id` predicate is defence in depth: the table is\nalso RLS-scoped to its owner on enterprise.\n\nAn empty buffer is treated as no buffer, matching how session summon\nalready reads this table, and the exclusion happens in SQL so it cannot\nconsume a slot in the LIMIT.","operationId":"get_working_state_route_api_v2_working_state_get","parameters":[{"name":"project_uuid","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":1,"default":3,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Working State Route Api V2 Working State Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/community/device/authorize":{"post":{"summary":"Device Authorize","operationId":"device_authorize_api_community_device_authorize_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/community/device/lookup/{user_code_hash}":{"get":{"summary":"Device Lookup","operationId":"device_lookup_api_community_device_lookup__user_code_hash__get","parameters":[{"name":"user_code_hash","in":"path","required":true,"schema":{"type":"string","title":"User Code Hash"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/community/device/approve":{"post":{"summary":"Device Approve","operationId":"device_approve_api_community_device_approve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveDenyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/community/device/deny":{"post":{"summary":"Device Deny","operationId":"device_deny_api_community_device_deny_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveDenyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/community/device/token":{"post":{"summary":"Device Token","operationId":"device_token_api_community_device_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/community/revocations":{"get":{"summary":"Get Revocations","description":"Return the revoked-installation list. Honors If-None-Match → 304.\nNo auth required — the list is non-sensitive (just UUIDs).","operationId":"get_revocations_api_community_revocations_get","parameters":[{"name":"If-None-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-None-Match"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/community/installations/{installation_id}":{"delete":{"summary":"Revoke Installation","operationId":"revoke_installation_api_community_installations__installation_id__delete","parameters":[{"name":"installation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Installation Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/me":{"get":{"tags":["Auth"],"summary":"Get Me","description":"Return the authenticated caller's identity claims.","operationId":"get_me_api_v1_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/me/sessions":{"get":{"tags":["Auth"],"summary":"List My Sessions","description":"List the caller's active WorkOS sign-in sessions (device/IP/last-used).","operationId":"list_my_sessions_api_v2_me_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/me/sessions/{session_id}/revoke":{"post":{"tags":["Auth"],"summary":"Revoke My Session","description":"Revoke one of the caller's OWN sessions.\n\nIDOR guard: WorkOS `revoke_session(session_id)` is unscoped — the env key\ncan revoke ANY user's session — so first confirm `session_id` is in the\ncaller's own session set (scoped by the verified `external_user_id`). 404\n(not 403) if not owned, so the endpoint can't be used as a session-id\noracle for other users.","operationId":"revoke_my_session_api_v2_me_sessions__session_id__revoke_post","parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/sessions/revoke-others":{"post":{"tags":["Auth"],"summary":"Revoke My Other Sessions","description":"Revoke every ACTIVE session the caller owns except the one they are on.\n\nWhy this is a route and not a client loop: the dashboard used to iterate the\nsession list it had last fetched, so a session that signed in after that GET\nwas never revoked and the UI still reported success — on the one flow that\nexists for \"my account is compromised\". Enumeration happens HERE, at request\ntime, so there is no client-held snapshot to go stale.\n\nWhich session to KEEP is not a client input. It is `auth.session_id`: the\nWorkOS `sid` claim off the verified JWT, set at AuthContext construction and\nfrozen. Accepting an id from the request body would let a caller (or anyone\nwho could shape that request) keep an attacker's session alive.\n\nFails closed when `sid` is absent — community tokens, or any token without\nthe claim. \"No identifiable current session\" must never be read as \"revoke\neverything\", which would sign the caller out of the browser making the call.\n\nOwnership is scoped exactly as the single-session route: candidates come\nfrom `_fetch_session_page(auth.external_user_id)`, the verified WorkOS\n`sub`, never from input. WorkOS `revoke_session` is unscoped, so this set IS\nthe authorization boundary.","operationId":"revoke_my_other_sessions_api_v2_me_sessions_revoke_others_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/auth/logout":{"post":{"tags":["Auth"],"summary":"Logout","description":"Revoke the caller's current WorkOS session.\n\nAuth is the existing X-Workos-Token/Authorization-Bearer extractor path\n(get_auth_context) — the same token being logged out authenticates the\nlogout call itself, which is why the client refreshes an expired access\ntoken BEFORE calling this endpoint (an expired token can't authenticate\nits own logout).","operationId":"logout_api_v2_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/me/sensor-status":{"get":{"tags":["usage (D3)"],"summary":"Get Sensor Status Route","description":"Phase 2 gone-dark signal (decision 01a07f13-2c30-7b04-a3d9-\n43987ac4558a). ``sensor_silent`` is true when THIS caller's host is\ndemonstrably active (recent ``tool_events``) but their sensor install has\ngone quiet (``installs.last_seen_at`` stale/absent) for the same window —\nsee ``analytics/gone_dark.py`` for the full predicate + data sources.\nDrives the status chip on the apps/web dashboard's Sensor activity card.\nComputed live (no new table/migration); ungated like the sibling\n``/api/v2/me`` reads — ``get_auth_context`` is enough, this is the\ncaller's own signal only.","operationId":"get_sensor_status_route_api_v2_me_sensor_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Sensor Status Route Api V2 Me Sensor Status Get"}}}}}}},"/api/v2/me/sensor-activity":{"get":{"tags":["usage (D3)"],"summary":"Get Sensor Activity Route","description":"The caller's file events per bucket (edits and reads) over 24h, 7d or\n30d, with the window's totals, for the dashboard's Sensor activity card\n(design 01a0f983-c15e-734a-9a7b-45fa21bcee7f). An unknown window reads as\n7d. See ``analytics/me_activity.py`` for the definitions.","operationId":"get_sensor_activity_route_api_v2_me_sensor_activity_get","parameters":[{"name":"window","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Window"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Sensor Activity Route Api V2 Me Sensor Activity Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/context-pressure":{"get":{"tags":["usage (D3)"],"summary":"Get Context Pressure Route","description":"The caller's daily context-window fill over the last 30 days, from the\nnightly rollup (design 01a0f983-c15e-734a-9a7b-45fa21bcee7f), with the\nrecent week's typical turn, fullest tenth and fullest turn, the week\nbefore it, and a row per agent and model, for the dashboard's \"How you\nhandle context\" tab (design 01a1dcd4-5b34-7029-ba95-36e56e283273).","operationId":"get_context_pressure_route_api_v2_me_context_pressure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Context Pressure Route Api V2 Me Context Pressure Get"}}}}}}},"/api/v2/me/tool-activity":{"get":{"tags":["usage (D3)"],"summary":"Get Tool Activity Route","description":"The caller's agents' MCP tool calls over the last 30 days — every tool's\ncount and the searches that came back with a result — for the dashboard's\n\"Your work\" tab (design 01a1dcd4-5b34-7029-ba95-36e56e283273). Load-test and\nsynthetic clients are excluded. Own-user only: an explicit ``user_id`` and\nthe tables' RLS on ``app.current_user_id``.\n\n``days`` is the dashboard's period (7, 30 or 90; anything else reads as 30),\nso the searches figure on the Knowledge reused tab covers the same days as\nthe reuse figures beside it (Manuj, 2026-11-17: the searches tile moves there).","operationId":"get_tool_activity_route_api_v2_me_tool_activity_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Tool Activity Route Api V2 Me Tool Activity Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/reuse":{"get":{"tags":["usage (D3)"],"summary":"Get Reuse Route","description":"What the caller's own agents picked up from memory in the last ``days``:\nmemories a search offered and the agent then opened, how many of those a\nteammate wrote, how many were more than 30 days old, and the ones opened\nmost (design 01a1dcd4-5b34-7029-ba95-36e56e283273).\n\n``days`` is the dashboard's period: 7, 30 or 90; anything else reads as 30.\n\nThe caller's own agents' pick-ups come from the caller's own events. The\nother direction — teammates' agents opening the caller's memories — is\n``by_teammates``: three counts from the privileged function\n``memory_reuse_counts`` (enterprise_0106), or null when the database does\nnot have it yet (decisions 01a1dcd7-44df-7739-8071-408a1f6447c8 and\n01a1df81-09c7-7500-94e4-1d2a6fd5b710).\n\nThe project list comes from the project repo under the caller's scope and\nbounds both reads (the tables' RLS is the second line). Fail-closed: an\nunwired repo yields no projects, so zeros, never an unscoped scan.","operationId":"get_reuse_route_api_v2_me_reuse_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days"}},{"name":"scope","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"}},{"name":"project","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A project uuid: that one project only (the project page).","title":"Project"},"description":"A project uuid: that one project only (the project page)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Reuse Route Api V2 Me Reuse Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/plan-features":{"get":{"tags":["usage (D3)"],"summary":"Get Plan Features Route","description":"Which plan-gated features the caller's plan has: ``{\"teams\": bool}``.\nThe dashboard's team invitation reads it to offer \"Create a team\" or an\nupgrade (decision 01a1dfc3-274d-7a9f-8601-24a1fdbf2b03).","operationId":"get_plan_features_route_api_v2_me_plan_features_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Response Get Plan Features Route Api V2 Me Plan Features Get"}}}}}}},"/api/v2/me/erasure":{"post":{"tags":["account erasure (GDPR)"],"summary":"Request Erasure","description":"Request account deletion: emails a 6-digit code. Nothing is fenced yet.","operationId":"request_erasure_api_v2_me_erasure_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Request Erasure Api V2 Me Erasure Post"}}}}}}},"/api/v2/me/erasure/confirm":{"post":{"tags":["account erasure (GDPR)"],"summary":"Confirm Erasure","description":"Confirm deletion with the emailed code. On match the fence engages + offboard\nis enqueued; 5 wrong codes invalidate the code (re-request required).","operationId":"confirm_erasure_api_v2_me_erasure_confirm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Confirm Erasure Api V2 Me Erasure Confirm Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/me/erasure/cancel":{"get":{"tags":["account erasure cancel (GDPR)"],"summary":"Confirm Cancel Token","description":"GET-confirm half (SC3): READ-ONLY. Renders whether the link is still valid\n(unknown/expired/used are all surfaced so the confirm page can show an accurate\nmessage) WITHOUT consuming it — safe against email-scanner/proxy prefetch.\nNo get_auth_context: this route's only credential is the token itself.","operationId":"confirm_cancel_token_api_v2_me_erasure_cancel_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Confirm Cancel Token Api V2 Me Erasure Cancel Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["account erasure cancel (GDPR)"],"summary":"Execute Cancel","description":"POST-execute half (SC3): the actual un-freeze. Atomically consumes the token\n(single-use — account_erasure_cancel_consume's UPDATE ... WHERE used_at IS NULL\nlets exactly one concurrent POST win) and, in the SAME transaction, runs\nunfreeze_account() + writes the account.erasure_cancelled audit row.\n\nNo get_auth_context, no WorkOS/OIDC auth SDFs: this route's ONLY authority is\nthe un-freeze action for the token-bound user_id. Constant-time-equivalent\nlookup: token_sha256 is an exact-hash DB-indexed equality match (see the\nmigration's comment on uq_account_erasure_cancel_tokens_hash for why this is\nthe accepted posture for this credential class in this codebase, matching\ningest_refresh_tokens), not a raw string compare of secret material.","operationId":"execute_cancel_api_v2_me_erasure_cancel_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Execute Cancel Api V2 Me Erasure Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/v2/account-offboard":{"post":{"tags":["account offboard (S2S)"],"summary":"Account Offboard","operationId":"account_offboard_internal_v2_account_offboard_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffboardBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Account Offboard Internal V2 Account Offboard Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/teams":{"get":{"tags":["Teams"],"summary":"List Teams Route","operationId":"list_teams_route_api_v2_teams_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Teams Route Api V2 Teams Get"}}}}}},"post":{"tags":["Teams"],"summary":"Create Team Route","operationId":"create_team_route_api_v2_teams_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTeamRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Team Route Api V2 Teams Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/teams/{team_id}":{"get":{"tags":["Teams"],"summary":"Fetch Team Route","operationId":"fetch_team_route_api_v2_teams__team_id__get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}},{"name":"include_inactive","in":"query","required":false,"schema":{"type":"boolean","description":"Also return revoked (inactive) members in the roster. Default False (active members only).","default":false,"title":"Include Inactive"},"description":"Also return revoked (inactive) members in the roster. Default False (active members only)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Fetch Team Route Api V2 Teams  Team Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/teams/{team_id}/invite":{"post":{"tags":["Teams"],"summary":"Rotate Invite Route","description":"Mint a fresh code for ONE role (member | co_owner, default member). The\nprevious code for that role stops working at once (Owner or Co-owner).","operationId":"rotate_invite_route_api_v2_teams__team_id__invite_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/InviteRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rotate Invite Route Api V2 Teams  Team Id  Invite Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/teams/{team_id}/invite/{role}":{"get":{"tags":["Teams"],"summary":"Ensure Invite Route","description":"The CURRENT live code for one role, minted only when none is live\n(missing, revoked or expired). Never rotates (Owner or Co-owner).","operationId":"ensure_invite_route_api_v2_teams__team_id__invite__role__get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}},{"name":"role","in":"path","required":true,"schema":{"type":"string","title":"Role"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Ensure Invite Route Api V2 Teams  Team Id  Invite  Role  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Teams"],"summary":"Revoke Invite Route","description":"Stop the live code for one role without issuing a new one (Owner or Co-owner).","operationId":"revoke_invite_route_api_v2_teams__team_id__invite__role__delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}},{"name":"role","in":"path","required":true,"schema":{"type":"string","title":"Role"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revoke Invite Route Api V2 Teams  Team Id  Invite  Role  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/teams/{team_id}/invite-email":{"post":{"tags":["Teams"],"summary":"Invite Email Route","description":"Queue an invite email carrying the team's current code for `role`\n(Owner or Co-owner). Responds \"queued\" (delivery is asynchronous).","operationId":"invite_email_route_api_v2_teams__team_id__invite_email_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteEmailRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Invite Email Route Api V2 Teams  Team Id  Invite Email Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/teams/join":{"post":{"tags":["Teams"],"summary":"Join Team Route","operationId":"join_team_route_api_v2_teams_join_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinTeamRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Join Team Route Api V2 Teams Join Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/teams/{team_id}/leave":{"post":{"tags":["Teams"],"summary":"Leave Team Route","description":"The caller leaves the team (enterprise_0102). Any member but the Owner,\nwho transfers ownership first; the last Co-owner may leave. Not plan-gated:\na downgraded user must always be able to leave.","operationId":"leave_team_route_api_v2_teams__team_id__leave_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Leave Team Route Api V2 Teams  Team Id  Leave Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/teams/{team_id}/members/{user_id}":{"delete":{"tags":["Teams"],"summary":"Remove Member Route","operationId":"remove_member_route_api_v2_teams__team_id__members__user_id__delete","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team 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":{"type":"object","additionalProperties":true,"title":"Response Remove Member Route Api V2 Teams  Team Id  Members  User Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Teams"],"summary":"Set Member Role Route","description":"Promote or demote a member (enterprise_0086/0090): Owner and Co-owner\nalike may set Co-owner / Member / Viewer on any non-Owner target. Owner\nitself is assigned only by transfer-ownership. enterprise_0102: the team's\nonly Co-owner cannot be demoted (409 cannot_demote_last_co_owner).","operationId":"set_member_role_route_api_v2_teams__team_id__members__user_id__patch","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team 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/SetMemberRoleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Member Role Route Api V2 Teams  Team Id  Members  User Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/teams/{team_id}/transfer-ownership":{"post":{"tags":["Teams"],"summary":"Transfer Ownership Route","description":"Hand canonical ownership to a current team member (Owner-only).\n\n`scope` is unused directly here (the repo resolves the caller\nserver-side — see `ITeamRepository.transfer_ownership`) but the\ndependency must stay: `get_scope` -> `get_auth_context` is what binds\nthe RLS-context caller identity the repo reads for the best-effort\nownership-change notification.","operationId":"transfer_ownership_route_api_v2_teams__team_id__transfer_ownership_post","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferOwnershipRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Transfer Ownership Route Api V2 Teams  Team Id  Transfer Ownership Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/projects/{project_id}/people":{"get":{"tags":["Teams"],"summary":"Project People Route","description":"Everyone with access to the project through a team, grouped by that\nteam, with each person's role on it and what they wrote here in ``days``\n(7, 30 or 90; else 30). Visible to anyone who can see the project (decision\n01a1e1f8-d9f2-7a55-abbc-612ffa7c6573); not visible = no people, from the\ndatabase function itself (enterprise_0109, project_people()).","operationId":"project_people_route_api_v2_projects__project_id__people_get","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Project People Route Api V2 Projects  Project Id  People Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/teams/{team_id}/activity":{"get":{"tags":["Teams"],"summary":"Team Member Activity Route","description":"Per member of the team: what they wrote in the team's projects (owned and\nshared with it) in ``days`` (7, 30 or 90; else 30), and when they last wrote\nthere. Members only, from the database function itself (enterprise_0110,\nteam_member_activity(); design 01a1e709-b04a-76c1-acd7-fa95b1490680): anyone\nelse gets an empty list.","operationId":"team_member_activity_route_api_v2_teams__team_id__activity_get","parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Team Id"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Team Member Activity Route Api V2 Teams  Team Id  Activity Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/projects/{project_id}/move-to-team":{"post":{"tags":["Teams"],"summary":"Move Project To Team Route","description":"Transfer (Mode 2 of design 01a1b636-e82f): ownership of the project moves\nto the team, PERMANENTLY. The SDF enforces: the source is the caller's\npersonal team (409 transfer_source_not_personal — no team → team moves), the\nper-user default never moves (409 cannot_transfer_default_project), and a\nteam with no Co-owner accepts only its Owner moving their own creation (409\nteam_has_no_co_owner).","operationId":"move_project_to_team_route_api_v2_projects__project_id__move_to_team_post","parameters":[{"name":"project_id","in":"path","required":true,"schema":{"type":"string","title":"Project Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveToTeamRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Move Project To Team Route Api V2 Projects  Project Id  Move To Team Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memories/{memory_uuid}/promote":{"post":{"tags":["Memory Sharing"],"summary":"Promote Memory Route","operationId":"promote_memory_route_api_v2_memories__memory_uuid__promote_post","parameters":[{"name":"memory_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Memory Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Promote Memory Route Api V2 Memories  Memory Uuid  Promote Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memories/{memory_uuid}/demote":{"post":{"tags":["Memory Sharing"],"summary":"Demote Memory Route","operationId":"demote_memory_route_api_v2_memories__memory_uuid__demote_post","parameters":[{"name":"memory_uuid","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Memory Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Demote Memory Route Api V2 Memories  Memory Uuid  Demote Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memories/bulk-promote":{"post":{"tags":["Memory Sharing"],"summary":"Bulk Promote Memories Route","operationId":"bulk_promote_memories_route_api_v2_memories_bulk_promote_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkPromoteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Bulk Promote Memories Route Api V2 Memories Bulk Promote Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/memories/bulk-demote":{"post":{"tags":["Memory Sharing"],"summary":"Bulk Demote Memories Route","operationId":"bulk_demote_memories_route_api_v2_memories_bulk_demote_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDemoteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Bulk Demote Memories Route Api V2 Memories Bulk Demote Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/imports/upload-url":{"post":{"tags":["data-imports"],"summary":"Create Upload Url","description":"Record a new import and return a signed PUT for its ZIP.","operationId":"create_upload_url_api_data_imports_upload_url_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadUrlRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Upload Url Api Data Imports Upload Url Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/imports/{import_id}/start":{"post":{"tags":["data-imports"],"summary":"Start Import","description":"Queue an uploaded import for the worker, with the project mapping the\nuser chose in the preview (optional). Idempotent: a row already past\nawaiting_upload is returned as it stands (a mapping sent then is ignored).","operationId":"start_import_api_data_imports__import_id__start_post","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string","title":"Import Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/StartImportRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Start Import Api Data Imports  Import Id  Start Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/imports/{import_id}/analyze":{"post":{"tags":["data-imports"],"summary":"Analyze Upload","description":"Preview an uploaded export for the project-mapping step, in\nDataImportService.analyze_import's response shape. Reads the ZIP in place\n(range reads); a good file leaves the row awaiting_upload. A file that can\nnever import (missing, empty, over the cap, not a valid export) fails the\nrow so it shows in History; a read failure leaves it retryable.","operationId":"analyze_upload_api_data_imports__import_id__analyze_post","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string","title":"Import Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Analyze Upload Api Data Imports  Import Id  Analyze Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/imports/{import_id}/cancel":{"post":{"tags":["data-imports"],"summary":"Cancel Import","description":"Abandon an upload that was never started: the row becomes cancelled\nand its ZIP is deleted at once. Idempotent, and it never stops a real\nimport: a row past awaiting_upload is returned as it stands. A cancelled\nrow whose delete failed earlier is retried.","operationId":"cancel_import_api_data_imports__import_id__cancel_post","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string","title":"Import Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel Import Api Data Imports  Import Id  Cancel Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/imports/{import_id}/heartbeat":{"post":{"tags":["data-imports"],"summary":"Heartbeat Import","description":"The open dialog's once-a-minute ping for an un-started upload: stamps\nlast_seen_at, so import_file_sweep leaves the row alone while the user\nis still uploading or reading the preview. Returns the row's status (a\nrow the sweep already cancelled answers 'cancelled').","operationId":"heartbeat_import_api_data_imports__import_id__heartbeat_post","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string","title":"Import Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Heartbeat Import Api Data Imports  Import Id  Heartbeat Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/imports":{"get":{"tags":["data-imports"],"summary":"List Imports","description":"The caller's imports, newest first, with a count summary of each report.","operationId":"list_imports_api_data_imports_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Imports Api Data Imports Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/data/imports/{import_id}":{"get":{"tags":["data-imports"],"summary":"Get Import","description":"One of the caller's imports, with its full report.","operationId":"get_import_api_data_imports__import_id__get","parameters":[{"name":"import_id","in":"path","required":true,"schema":{"type":"string","title":"Import Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Import Api Data Imports  Import Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/pilot/activate":{"post":{"tags":["Pilot"],"summary":"Pilot Activate","description":"Flip a live invite (pending/sent/activating) -> activating, bind a fresh activation\nnonce, and return the raw nonce + invited email. 404 if the token is not a live invite.\n\nThe invite token is a 256-bit CSPRNG value (infeasible to guess), so brute force is not\nthe threat model; a per-IP rate limit here is a defense-in-depth follow-up.","operationId":"pilot_activate_api_v2_pilot_activate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PilotActivateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Pilot Activate Api V2 Pilot Activate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/pilot/codes/check":{"post":{"tags":["Pilot"],"summary":"Pilot Code Check","description":"Pre-sign-in probe for a shareable pilot code. 400 when the string is not a code at\nall; 404 when it is well-formed but not redeemable right now (unknown, revoked,\nexpired, exhausted). 200 returns the NORMALIZED code — the value the web stores in\nthe activation cookie and the provider hashes, so it must be byte-identical to what\nthe admin console hashed at mint time.","operationId":"pilot_code_check_api_v2_pilot_codes_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PilotCodeCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Pilot Code Check Api V2 Pilot Codes Check Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/pilot/redeem":{"post":{"tags":["Pilot"],"summary":"Pilot Redeem","description":"Redemption runs inside get_auth_context (the provider consumes the\nX-Pilot-Activation-Nonce header and runs pilot_redeem_workos). A brand-new identity\nwith no redeemable invite is already rejected with 403 before this body runs.\n\nAuthentication succeeding does NOT by itself prove a grant happened — a returning user\n(bad/expired nonce) or an open-signup free account authenticates fine but is not a pilot\nPro. So report the AUTHORITATIVE outcome (does the caller now hold an active pilot\ngrant?), so the web callback never mistakes 'authenticated' for 'redeemed'.","operationId":"pilot_redeem_api_v2_pilot_redeem_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Pilot Redeem Api V2 Pilot Redeem Post"}}}}}}},"/api/v2/referrals":{"get":{"tags":["Referrals"],"summary":"Get Referrals","operationId":"get_referrals_api_v2_referrals_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Referrals Api V2 Referrals Get"}}}}}}},"/api/v2/referrals/attribute":{"post":{"tags":["Referrals"],"summary":"Attribute Referral","operationId":"attribute_referral_api_v2_referrals_attribute_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttributeBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Attribute Referral Api V2 Referrals Attribute Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/billing/checkout":{"post":{"tags":["Billing"],"summary":"Create Checkout Session","description":"Create a Stripe hosted-checkout session for `{plan}` ('starter' | 'pro';\nno body → 'pro').\n\nRuns the Stripe core in-process with the RESTRICTED STRIPE_SECRET_KEY (Phase 5 —\nno S2S forward). own-account is `auth.user_id` from get_auth_context; the customer\npath stays recallium_serve own-account only. `_require_config` fails closed (503)\nwhen the restricted key / URLs are absent; a plan with no active price is 503\n`plan_unavailable`.","operationId":"create_checkout_session_api_v2_billing_checkout_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CheckoutBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Create Checkout Session Api V2 Billing Checkout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/billing/change-plan":{"post":{"tags":["Billing"],"summary":"Change Plan","description":"Move the member's live personal subscription to `{plan}` (Starter plan\nD6/D7, decision 01a1691c-7d17): an upgrade is invoiced now with the prorated\ndifference, a downgrade lands at the renewal (the tier is held until then),\na pending downgrade can only be reverted. The Stripe call is the worker's\n(`billing_change_plan`, enqueued by the SDF) — 202 with the op; the Billing\ntab polls the overview's `plan_change`. 409 plan_unchanged /\noperation_in_progress / no_live_subscription / cancel_scheduled, 503\nplan_unavailable, 403 for an org-managed member, 503 while billing is dark.\n\nenterprise_0100 (decision 01a1857a, Manuj): plan switching is ADMIN-ONLY — an\nadmin changes the subscription's price in the Stripe Dashboard and the webhook\nmaps the price to the tier. This member-facing route answers 403 admin_only\nand the Billing tab no longer shows its buttons; the SDF and the worker job\nstay for the admin path.","operationId":"change_plan_api_v2_billing_change_plan_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePlanBody"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Change Plan Api V2 Billing Change Plan Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/billing/move-to-free":{"post":{"tags":["Billing"],"summary":"Move To Free","description":"The member leaves their locked (past_due / unpaid) or still-trialing\nsubscription for Free now (trial-end lock, decision 01a17d7a-7776). The SDF\n`billing_move_to_free` (enterprise_0097) queues the worker's existing\nbilling_cancel job with the void-open-invoices flag; the cancel lands through\nthe subscription-deleted webhook (apply_terminal_exit → Free, account\nre-enabled). 202 with the subscription the job targets; the Billing tab\npolls the overview until the binding is gone. 409 no_live_subscription /\nplan_active (an active paid period cancels through the portal) /\noperation_in_progress, 403 for an org-managed member, 503 while billing is\ndark. A retry answers 202 again — the SDF confirms its own queued job.\n\nenterprise_0100: open while only the trials run too (a paused trial is locked\nand must be able to leave before payments open); the cancel is the worker's,\nso no Stripe key is needed here — 503 only when neither switch is on.","operationId":"move_to_free_api_v2_billing_move_to_free_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Move To Free Api V2 Billing Move To Free Post"}}}}}}},"/api/v2/billing/overview":{"get":{"tags":["Billing"],"summary":"Billing Overview","description":"Combined billing read for the Profile → Billing tab.\n\nPlan/tier is DB-sourced + LOCAL so the plan chip renders even in a full Stripe\noutage. Free users (no ``stripe_customer_id``) short-circuit with ZERO Stripe\naccount reads. The Stripe enrichment runs in-process (Phase 5 — customer +\ncombined alike) with the RESTRICTED STRIPE_SECRET_KEY (read-only\nsubscription/customer/invoice reads), degrading to null/[] on failure so a single\ndead call never blanks the tab. enterprise_0094 adds the plan catalogue\n(`plans[]`, amounts from Stripe only when billing is on) and the purchased-vs-\neffective state (`_plan_state`); enterprise_0096 the delivery state\n(`open_checkout`, `next_bill_free`, `plan_change`, the downgrade hold) and the\nnext bill's preview (`next_bill_amount` / `next_bill_currency`).","operationId":"billing_overview_api_v2_billing_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Billing Overview Api V2 Billing Overview Get"}}}}}}},"/api/v2/billing/portal":{"post":{"tags":["Billing"],"summary":"Create Portal Session","description":"Stripe hosted Customer Portal session — update card / change plan / cancel.\nFree users (no customer id) get 409; the UI shows Upgrade and never reaches here.\nAn optional `{flow}` body opens one screen (the card screen for a locked member).\n\nRuns in-process with the RESTRICTED STRIPE_SECRET_KEY (Phase 5 — no S2S forward);\nown-account is `auth.user_id` from get_auth_context (recallium_serve own-account\nonly).","operationId":"create_portal_session_api_v2_billing_portal_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PortalBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Create Portal Session Api V2 Billing Portal Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/billing/webhook":{"post":{"tags":["Billing"],"summary":"Stripe Webhook","description":"Stripe webhook RECEIVER (transition-200 amendment, Phase 4 T2).\n\nNO signature verification here — this process holds NO `whsec_` (design\n200 §3/§6 SEC-C1: authoritative verify happens on the internal Go worker,\nover these SAME stored bytes). NO processing — the full state machine\n(dedup + watermark + per-event branching) has moved to\n`saas-background-worker/internal/webhook`.\n\nONE txn (recallium_serve, no worker pool): durably store the raw event +\nenqueue a single `stripe_webhook` worker_jobs row, then return 200 fast\n(stays inside Stripe's ack window). Rate-limited (SEC-recv) since an\nunauthenticated public endpoint doing a DB write per request must not be\nan open spam/DoS vector on the inbox — a forged/flooded enqueue is\notherwise inert (design 200 §3): the Go worker's authoritative verify +\nthe stripe_events PK dedup make a fabricated event_id/job a no-op.","operationId":"stripe_webhook_api_v2_billing_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/billing/pools":{"get":{"tags":["Billing"],"summary":"List Pools","description":"The caller's pools with their active seats (RLS: owner only), plus\n`enabled` — whether this deployment accepts buy/assign/quantity right now (the\nUI hides those and keeps revoke when it is false). Revoke needs only WorkOS,\nso that gate stays on the read too: without it the whole surface is 503.","operationId":"list_pools_api_v2_billing_pools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Pools Api V2 Billing Pools Get"}}}}}}},"/api/v2/billing/pools/checkout":{"post":{"tags":["Billing"],"summary":"Create Pool Checkout","description":"Hosted Checkout for a seat pool (D5 one live pool per purchaser, D8 seat\nprice, D9 quantity adjustable in Checkout, D21 card only). The pool row is\ncreated by the Go webhook from the subscription's metadata.","operationId":"create_pool_checkout_api_v2_billing_pools_checkout_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/PoolCheckoutBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Create Pool Checkout Api V2 Billing Pools Checkout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/billing/pools/{pool_id}":{"patch":{"tags":["Billing"],"summary":"Request Pool Quantity","description":"Record ONE pending quantity operation; the worker applies it to Stripe and\nthe webhook confirms it (D7/D14). 202 = confirming.","operationId":"request_pool_quantity_api_v2_billing_pools__pool_id__patch","parameters":[{"name":"pool_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pool Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PoolQuantityBody"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Request Pool Quantity Api V2 Billing Pools  Pool Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/billing/pools/{pool_id}/seats":{"post":{"tags":["Billing"],"summary":"Assign Seat","description":"Assign a seat by email (never bound at assignment — D13), then queue the\n`seat_assigned` invite (best-effort, capped per purchaser — D12).","operationId":"assign_seat_api_v2_billing_pools__pool_id__seats_post","parameters":[{"name":"pool_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pool Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeatAssignBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Assign Seat Api V2 Billing Pools  Pool Id  Seats Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/billing/pools/{pool_id}/seats/{seat_id}":{"delete":{"tags":["Billing"],"summary":"Revoke Seat","description":"Revoke one of the caller's seats; the holder's Pro converges off through\nthe enqueued entitlement_reconcile (seconds).","operationId":"revoke_seat_api_v2_billing_pools__pool_id__seats__seat_id__delete","parameters":[{"name":"pool_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Pool Id"}},{"name":"seat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Seat Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revoke Seat Api V2 Billing Pools  Pool Id  Seats  Seat Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/webhooks/workos":{"post":{"tags":["Webhooks"],"summary":"Workos Webhook","description":"WorkOS webhook — signature is the ONLY auth (no auth dependency).\n\nOn ``session.revoked``, revokes every ingest install bound to the\nrevoked WorkOS session id. Every other (subscribed or not) event type\nis acknowledged 200 without any DB effect.","operationId":"workos_webhook_api_v2_webhooks_workos_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ingest/v1/refresh":{"post":{"tags":["ingest"],"summary":"Refresh","description":"R-AUTH-04: rotate-every-use refresh. Replay of an already-rotated\ntoken revokes the entire family (installs.tokens_invalid_before, C-H5).","operationId":"refresh_ingest_v1_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ingest/v1/events":{"post":{"tags":["ingest"],"summary":"Events","description":"G.9: verify -> resolve project -> assign window -> hygiene -> insert.\n\nR-AUTH-05 hard caps (500 events/req, 256KB body) are enforced BEFORE any\nRedis call, parsed from the raw body — a request that fails either cap\nnever reaches quota checking or JSON parsing of the full payload.","operationId":"events_ingest_v1_events_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/enroll/bind":{"post":{"tags":["enroll"],"summary":"Enroll Bind","description":"{cid, ics} -> minted credential | 401 | 409 (S-only, design 01a0872d).\n\nResponse shapes:\n  200 {\"access_token\", \"refresh_token\", \"install_id\"} -- minted directly\n      from the sensor login (S) alone; no host stamp, order-independent,\n      zero Claude Code restart.\n  401 -- token contract fail (bad signature/aud/exp) OR SHA256(ics) != cid.\n  409 {\"error\": \"ticket_conflict\", \"detail\": ...} -- the cid is already\n      claimed by a DIFFERENT sensor identity (write-once), or is a legacy\n      terminal ticket (refused/expired) from the old two-channel machine.","operationId":"enroll_bind_enroll_bind_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollBindRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/enroll/revoke":{"post":{"tags":["enroll"],"summary":"Enroll Revoke","description":"DUMMY sensor-token revoke (decision 01a08628 — client-side authoritative).\n\nThe client's ``recallium logout`` best-effort broadcasts here per enrolled\nhost, authenticated by the ingest token being revoked. The client's LOCAL\nwipe is what actually logs the machine out, so this endpoint's only job\nTODAY is to acknowledge with 200 and prove the wiring end-to-end.\n\nReal revocation (a revoked-sessions store keyed by cid/session, honored\nwithin the ingest-token TTL) is task 01a08200 — deliberately NOT built here\n(no tables). The bearer is intentionally NOT verified yet for the same\nreason: this is a stub, picked up later. The client treats any non-200 as a\nnon-fatal broadcast failure, so a stub that always 200s keeps the happy\npath honest without pretending a revoke it cannot yet back.","operationId":"enroll_revoke_enroll_revoke_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrollRevokeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AddThoughtRequest":{"properties":{"content":{"type":"string","minLength":1,"title":"Content"},"thought_type":{"type":"string","title":"Thought Type","default":"reasoning"},"confidence_level":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Confidence Level"},"next_thought_needed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Next Thought Needed"}},"type":"object","required":["content"],"title":"AddThoughtRequest"},"ApproveDenyRequest":{"properties":{"user_code_hash":{"type":"string","title":"User Code Hash"}},"type":"object","required":["user_code_hash"],"title":"ApproveDenyRequest"},"AttributeBody":{"properties":{"code":{"type":"string","maxLength":64,"minLength":1,"title":"Code"}},"type":"object","required":["code"],"title":"AttributeBody","description":"`{code}` as typed or pasted: case, spaces and dashes are forgiven; the\nresult must be a well-formed code (the lenient-input rule)."},"AuthorizeRequest":{"properties":{"container_fingerprint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Container Fingerprint"},"container_user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Container User Agent"}},"type":"object","title":"AuthorizeRequest"},"AuthorizeResponse":{"properties":{"device_code":{"type":"string","title":"Device Code"},"user_code":{"type":"string","title":"User Code"},"verification_uri":{"type":"string","title":"Verification Uri"},"verification_uri_complete":{"type":"string","title":"Verification Uri Complete"},"expires_in":{"type":"integer","title":"Expires In"},"interval":{"type":"integer","title":"Interval"}},"type":"object","required":["device_code","user_code","verification_uri","verification_uri_complete","expires_in","interval"],"title":"AuthorizeResponse"},"Body_bulk_upload_documents_route_api_v2_documents_bulk_post":{"properties":{"project_uuid":{"type":"string","title":"Project Uuid"},"files":{"items":{"type":"string","contentMediaType":"application/octet-stream"},"type":"array","title":"Files"}},"type":"object","required":["project_uuid","files"],"title":"Body_bulk_upload_documents_route_api_v2_documents_bulk_post"},"Body_upload_document_route_api_v2_documents_upload_post":{"properties":{"project_uuid":{"type":"string","title":"Project Uuid"},"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["project_uuid","file"],"title":"Body_upload_document_route_api_v2_documents_upload_post"},"BulkDemoteRequest":{"properties":{"memory_ids":{"items":{"type":"string"},"type":"array","maxItems":100,"minItems":1,"title":"Memory Ids"},"confirm":{"type":"boolean","title":"Confirm","default":false}},"type":"object","required":["memory_ids"],"title":"BulkDemoteRequest"},"BulkPromoteRequest":{"properties":{"memory_ids":{"items":{"type":"string"},"type":"array","maxItems":100,"minItems":1,"title":"Memory Ids"},"team_id":{"type":"string","format":"uuid","title":"Team Id"}},"type":"object","required":["memory_ids","team_id"],"title":"BulkPromoteRequest"},"BulkRequest":{"properties":{"memory_uuids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":100,"title":"Memory Uuids"},"active":{"type":"boolean","title":"Active"}},"type":"object","required":["memory_uuids","active"],"title":"BulkRequest"},"BulkResponse":{"properties":{"succeeded":{"items":{"type":"string"},"type":"array","title":"Succeeded"},"failed":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Failed"}},"type":"object","required":["succeeded","failed"],"title":"BulkResponse"},"CancelBody":{"properties":{"token":{"type":"string","maxLength":512,"minLength":1,"title":"Token"}},"type":"object","required":["token"],"title":"CancelBody"},"ChangePlanBody":{"properties":{"plan":{"type":"string","title":"Plan"}},"type":"object","required":["plan"],"title":"ChangePlanBody","description":"`{plan}` — the plan to move to. Required: a plan change has no default."},"CheckoutBody":{"properties":{"plan":{"type":"string","title":"Plan","default":"pro"}},"type":"object","title":"CheckoutBody","description":"`{plan}` — missing, null or empty → 'pro' (old callers); otherwise a plan\nname, case-insensitive. Anything else (a number, a list, an unknown plan) is\n422 rather than a silent Pro purchase."},"CommentsUpdateRequest":{"properties":{"user_comments":{"type":"string","title":"User Comments"}},"type":"object","required":["user_comments"],"title":"CommentsUpdateRequest"},"CompleteSequenceRequest":{"properties":{"completion_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completion Summary"}},"type":"object","title":"CompleteSequenceRequest"},"ConfirmBody":{"properties":{"code":{"type":"string","maxLength":6,"minLength":6,"pattern":"^\\d{6}$","title":"Code"}},"type":"object","required":["code"],"title":"ConfirmBody"},"CreateLinkRequest":{"properties":{"target_project_uuid":{"type":"string","format":"uuid","title":"Target Project Uuid"},"relationship":{"type":"string","title":"Relationship","default":"sibling"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["target_project_uuid"],"title":"CreateLinkRequest"},"CreateProjectTaskRequest":{"properties":{"content":{"type":"string","minLength":1,"title":"Content"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"}},"type":"object","required":["content"],"title":"CreateProjectTaskRequest"},"CreateRuleRequest":{"properties":{"scope_type":{"type":"string","title":"Scope Type","description":"user | team | project (enterprise); install | project (community)"},"project_uuid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Uuid"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"title":{"type":"string","maxLength":200,"minLength":1,"title":"Title"},"body":{"type":"string","maxLength":20000,"minLength":1,"title":"Body"},"priority":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"null"}],"title":"Priority","default":"normal"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"title":"Tags"}},"type":"object","required":["scope_type","title","body"],"title":"CreateRuleRequest"},"CreateTaskRequest":{"properties":{"description":{"type":"string","minLength":1,"title":"Description"},"project_uuid":{"type":"string","title":"Project Uuid"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"anchor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anchor Id"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"}},"type":"object","required":["description","project_uuid"],"title":"CreateTaskRequest"},"CreateTeamRequest":{"properties":{"name":{"type":"string","minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["name"],"title":"CreateTeamRequest"},"DatabaseStats":{"properties":{"statistics":{"additionalProperties":true,"type":"object","title":"Statistics"},"totalRecords":{"type":"integer","title":"Totalrecords"},"timestamp":{"type":"string","title":"Timestamp"}},"type":"object","required":["statistics","totalRecords","timestamp"],"title":"DatabaseStats","description":"Database statistics"},"DocumentSearchRequest":{"properties":{"project_uuid":{"type":"string","format":"uuid","title":"Project Uuid"},"query":{"type":"string","minLength":1,"title":"Query"},"limit":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Limit","default":20}},"type":"object","required":["project_uuid","query"],"title":"DocumentSearchRequest"},"EnrollBindRequest":{"properties":{"cid":{"type":"string","title":"Cid"},"ics":{"type":"string","title":"Ics"}},"additionalProperties":false,"type":"object","required":["cid","ics"],"title":"EnrollBindRequest"},"EnrollRevokeRequest":{"properties":{"cid":{"type":"string","title":"Cid"}},"additionalProperties":false,"type":"object","required":["cid"],"title":"EnrollRevokeRequest"},"FeedbackUpdateRequest":{"properties":{"user_feedback":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Feedback"}},"type":"object","title":"FeedbackUpdateRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InviteEmailRequest":{"properties":{"invitee_email":{"type":"string","maxLength":254,"minLength":3,"title":"Invitee Email"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role","description":"member (default) | co_owner — the seat the mailed code confers."}},"type":"object","required":["invitee_email"],"title":"InviteEmailRequest"},"InviteRequest":{"properties":{"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role","description":"member (default) | co_owner — the seat the code confers."}},"type":"object","title":"InviteRequest"},"JoinTeamRequest":{"properties":{"invite_code":{"type":"string","minLength":1,"title":"Invite Code"}},"type":"object","required":["invite_code"],"title":"JoinTeamRequest"},"LinkMemoriesRequest":{"properties":{"memory_ids":{"items":{"type":"string"},"type":"array","title":"Memory Ids"}},"type":"object","required":["memory_ids"],"title":"LinkMemoriesRequest"},"MoveToTeamRequest":{"properties":{"team_id":{"type":"string","format":"uuid","title":"Team Id"}},"type":"object","required":["team_id"],"title":"MoveToTeamRequest"},"OffboardBody":{"properties":{"operation_id":{"type":"string","format":"uuid","title":"Operation Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"phase":{"type":"string","enum":["freeze","scrub"],"title":"Phase"}},"type":"object","required":["operation_id","user_id","phase"],"title":"OffboardBody"},"PilotActivateRequest":{"properties":{"token":{"type":"string","maxLength":512,"minLength":1,"title":"Token"}},"type":"object","required":["token"],"title":"PilotActivateRequest"},"PilotCodeCheckRequest":{"properties":{"code":{"type":"string","maxLength":64,"minLength":1,"title":"Code"}},"type":"object","required":["code"],"title":"PilotCodeCheckRequest"},"PoolCheckoutBody":{"properties":{"quantity":{"type":"integer","maximum":500.0,"minimum":1.0,"title":"Quantity","default":5}},"type":"object","title":"PoolCheckoutBody"},"PoolQuantityBody":{"properties":{"quantity":{"type":"integer","maximum":500.0,"minimum":1.0,"title":"Quantity"}},"type":"object","required":["quantity"],"title":"PoolQuantityBody"},"PortalBody":{"properties":{"flow":{"anyOf":[{"type":"string","const":"payment_method_update"},{"type":"null"}],"title":"Flow"}},"type":"object","title":"PortalBody","description":"`{flow}` — where the hosted portal opens. Optional; absent = the portal's\nhome page. `payment_method_update` opens the card screen directly: the\nlocked state's Add / Update card button (enterprise_0097 design)."},"PreviewResult":{"properties":{"success":{"type":"boolean","title":"Success"},"preview":{"additionalProperties":true,"type":"object","title":"Preview"},"warning":{"type":"string","title":"Warning"}},"type":"object","required":["success","preview","warning"],"title":"PreviewResult","description":"Reset preview result."},"PromoteRequest":{"properties":{"team_id":{"type":"string","format":"uuid","title":"Team Id"}},"type":"object","required":["team_id"],"title":"PromoteRequest"},"RefreshRequest":{"properties":{"refresh_token":{"type":"string","maxLength":256,"minLength":16,"title":"Refresh Token"}},"additionalProperties":false,"type":"object","required":["refresh_token"],"title":"RefreshRequest","description":"POST /ingest/v1/refresh body (R-AUTH-04)."},"ResetResult":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"stats":{"additionalProperties":true,"type":"object","title":"Stats"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["success","message","stats"],"title":"ResetResult","description":"Reset operation result.\n\n``error`` carries a machine-readable refusal code (currently only\n``insight_reset_not_owned_here``, W1/PR6) and is absent on success. Without\nthis field declared, ``ResetResult(**result)`` would silently DROP the code\nthe service sets, and the client would see ``success: false`` with no way to\ntell \"refused, nothing changed\" from \"failed midway\"."},"SeatAssignBody":{"properties":{"email":{"type":"string","maxLength":254,"minLength":3,"title":"Email"}},"type":"object","required":["email"],"title":"SeatAssignBody"},"SemanticSearchRequest":{"properties":{"project_uuid":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Project Uuid"},"query":{"type":"string","minLength":1,"title":"Query"},"mode":{"type":"string","title":"Mode","default":"hybrid"},"threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Threshold"},"post_fusion_floor":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Post Fusion Floor"},"memory_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memory Type"},"importance_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Importance Min"},"date_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date From"},"date_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date To"},"limit":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Limit","default":10}},"type":"object","required":["query"],"title":"SemanticSearchRequest"},"SessionCreateRequest":{"properties":{"session_name":{"type":"string","minLength":1,"title":"Session Name"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["session_name"],"title":"SessionCreateRequest"},"SetMemberRoleRequest":{"properties":{"role_id":{"type":"string","format":"uuid","title":"Role Id"}},"type":"object","required":["role_id"],"title":"SetMemberRoleRequest"},"StartImportRequest":{"properties":{"project_mappings":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Project Mappings"}},"type":"object","title":"StartImportRequest"},"StartThinkingRequest":{"properties":{"project_uuid":{"type":"string","title":"Project Uuid"},"goal":{"type":"string","minLength":1,"title":"Goal"},"sequence_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sequence Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["project_uuid","goal"],"title":"StartThinkingRequest"},"StatusUpdateRequest":{"properties":{"is_active":{"type":"boolean","title":"Is Active"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["is_active"],"title":"StatusUpdateRequest"},"StoreDocumentRequest":{"properties":{"project_uuid":{"type":"string","title":"Project Uuid"},"title":{"type":"string","minLength":1,"title":"Title"},"content":{"type":"string","minLength":1,"title":"Content"},"file_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Type"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["project_uuid","title","content"],"title":"StoreDocumentRequest"},"StoreMemoryRequest":{"properties":{"content":{"type":"string","minLength":1,"title":"Content"},"project_uuid":{"type":"string","title":"Project Uuid"},"memory_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memory Type"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"importance_score":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Importance Score"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["content","project_uuid"],"title":"StoreMemoryRequest"},"SummonMode":{"type":"string","enum":["full","refresh"],"title":"SummonMode","description":"Which payload shape a summon renders (Phase 1B)."},"SummonTrigger":{"type":"string","enum":["manual","session_start","session_clear","session_resume","session_compact","git_commit","git_merge","pr_create","pr_merge"],"title":"SummonTrigger","description":"What lifecycle moment asked for the summon (Phase 1B).\n\nDrives the server-rendered lead-in line of refresh mode — the client\nprepends nothing (rendering ownership rule, plan rev 2.x)."},"TokenRequest":{"properties":{"device_code":{"type":"string","title":"Device Code"},"grant_type":{"type":"string","title":"Grant Type","default":"urn:ietf:params:oauth:grant-type:device_code"}},"type":"object","required":["device_code"],"title":"TokenRequest"},"TransferOwnershipRequest":{"properties":{"new_owner_user_id":{"type":"string","format":"uuid","title":"New Owner User Id"}},"type":"object","required":["new_owner_user_id"],"title":"TransferOwnershipRequest"},"UpdateLinkRequest":{"properties":{"relationship":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Relationship"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","title":"UpdateLinkRequest"},"UpdateMeRequest":{"properties":{"display_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Display Name"}},"type":"object","title":"UpdateMeRequest"},"UpdateMemoryRequest":{"properties":{"content":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Content"},"memory_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memory Type"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"importance_score":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Importance Score"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","title":"UpdateMemoryRequest"},"UpdatePreferencesRequest":{"properties":{"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone","description":"IANA timezone name, e.g. 'America/New_York'. null clears it."},"locale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locale","description":"Reserved for a future locale preference. null clears it."},"document_processing":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Processing","description":"'auto' to enrich uploaded documents immediately, or 'hold' to store them and decide later. null = the tier default, which is HOLD on every tier — an upload is chunked and stored, and nothing is spent on it until you ask. Unrecognised values are treated as null rather than rejected."},"processing_order":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Processing Order","description":"'oldest_first' (default) or 'newest_first'. Governs the order parked work comes back in when your allowance renews — it does NOT affect the order new work is processed. null = the default. Unrecognised values are treated as null rather than rejected."}},"type":"object","title":"UpdatePreferencesRequest","description":"PATCH body for the caller's display preferences. Every field is optional;\nonly fields actually present in the request are applied (partial update),\nwhich we detect via ``model_fields_set``. ``timezone`` accepts any IANA name\n(validated + normalised server-side; a non-IANA value is coerced to null =>\nUTC, per rule #2341 — lenient input, never reject). ``null`` explicitly\nclears a field."},"UpdateRuleRequest":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Title"},"body":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}],"title":"Body"},"priority":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"null"}],"title":"Priority"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"string"},{"type":"null"}],"title":"Tags"}},"type":"object","title":"UpdateRuleRequest"},"UpdateStatusRequest":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"UpdateStatusRequest"},"UpdateTaskRequest":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"UpdateTaskRequest"},"UploadUrlRequest":{"properties":{"file_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Name"},"size_bytes":{"type":"integer","title":"Size Bytes"}},"type":"object","required":["size_bytes"],"title":"UploadUrlRequest"},"UpsertProjectRequest":{"properties":{"name":{"type":"string","minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Settings"}},"type":"object","required":["name"],"title":"UpsertProjectRequest"},"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"}}}}