{"openapi":"3.1.0","info":{"title":"Agents API","version":"1.0.0","description":"Unified API for ingestor and integration services"},"tags":[{"name":"Assistants","description":"An assistant is a configured instance of a graph."},{"name":"Threads","description":"A thread contains the accumulated outputs of a group of runs."},{"name":"Thread Runs","description":"A run is an invocation of a graph / assistant on a thread. It updates the state of the thread."},{"name":"Stateless Runs","description":"A run is an invocation of a graph / assistant, with no state or memory persistence."},{"name":"Crons","description":"A cron is a periodic run that recurs on a given schedule. The repeats can be isolated, or share state in a thread"},{"name":"Store","description":"Store is an API for managing persistent key-value store (long-term memory) that is available from any thread."},{"name":"A2A","description":"Agent-to-Agent Protocol related endpoints for exposing assistants as A2A-compliant agents."},{"name":"MCP","description":"Model Context Protocol related endpoints for exposing an agent as an MCP server."},{"name":"System","description":"System endpoints for health checks, metrics, and server information."},{"name":"Streaming","description":"Thread-centric streaming endpoints. Provides a structured command/event surface over SSE+HTTP; WebSocket is also supported at `/threads/{thread_id}/stream/events` (not documented here — OpenAPI 3.1 does not describe WebSocket)."}],"paths":{"/assistants":{"post":{"tags":["Assistants"],"summary":"Create Assistant","description":"Create an assistant.\n\nAn initial version of the assistant will be created and the assistant is set to that version. To change versions, use the `POST /assistants/{assistant_id}/latest` endpoint.","operationId":"create_assistant_assistants_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantCreate"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/assistants/search":{"post":{"tags":["Assistants"],"summary":"Search Assistants","description":"Search for assistants.\n\nThis endpoint also functions as the endpoint to list all assistants.","operationId":"search_assistants_assistants_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantSearchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Assistant"},"type":"array","title":"Response Search Assistants Assistants Search Post"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/assistants/count":{"post":{"tags":["Assistants"],"summary":"Count Assistants","description":"Get the count of assistants matching the specified criteria.","operationId":"count_assistants_assistants_count_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantCountRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"integer","title":"Count"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/assistants/{assistant_id}":{"get":{"tags":["Assistants"],"summary":"Get Assistant","description":"Get an assistant by ID.","operationId":"get_assistant_assistants__assistant_id__get","parameters":[{"description":"The ID of the assistant.","required":true,"schema":{"type":"string","format":"uuid","title":"Assistant ID","description":"The ID of the assistant."},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Assistants"],"summary":"Delete Assistant","description":"Delete an assistant by ID.\n\nAll versions of the assistant will be deleted as well.","operationId":"delete_assistant_assistants__assistant_id__delete","parameters":[{"description":"The ID of the assistant.","required":true,"schema":{"type":"string","format":"uuid","title":"Assistant ID","description":"The ID of the assistant."},"name":"assistant_id","in":"path"},{"description":"If true, delete all threads with metadata.assistant_id matching this assistant, along with runs and checkpoints belonging to those threads. Auth filters are applied, so threads not visible to the user will not be deleted.","required":false,"schema":{"type":"boolean","default":false,"title":"Delete Threads"},"name":"delete_threads","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Assistants"],"summary":"Patch Assistant","description":"Update an assistant.","operationId":"patch_assistant_assistants__assistant_id__patch","parameters":[{"description":"The ID of the assistant.","required":true,"schema":{"type":"string","format":"uuid","title":"Assistant ID","description":"The ID of the assistant."},"name":"assistant_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantPatch"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/assistants/{assistant_id}/graph":{"get":{"tags":["Assistants"],"summary":"Get Assistant Graph","description":"Get an assistant by ID.","operationId":"get_assistant_graph_assistants__assistant_id__graph_get","parameters":[{"description":"The ID of the assistant.","required":true,"schema":{"anyOf":[{"type":"string","format":"uuid","title":"Assistant ID","description":"The ID of the assistant."},{"type":"string","title":"Graph ID","description":"The ID of the graph."}]},"name":"assistant_id","in":"path"},{"description":"Include graph representation of subgraphs. If an integer value is provided, only subgraphs with a depth less than or equal to the value will be included.","required":false,"schema":{"oneOf":[{"type":"boolean"},{"type":"integer"}],"title":"Xray","default":false,"description":"Include graph representation of subgraphs. If an integer value is provided, only subgraphs with a depth less than or equal to the value will be included."},"name":"xray","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"additionalProperties":{"items":{"type":"object"},"type":"array"},"type":"object","title":"Response Get Assistant Graph Assistants  Assistant Id  Graph Get"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/assistants/{assistant_id}/subgraphs":{"get":{"tags":["Assistants"],"summary":"Get Assistant Subgraphs","description":"Get an assistant's subgraphs.","operationId":"get_assistant_subgraphs_assistants__assistant_id__subgraphs_get","parameters":[{"description":"The ID of the assistant.","required":true,"schema":{"type":"string","format":"uuid","title":"Assistant Id"},"name":"assistant_id","in":"path"},{"description":"Recursively retrieve subgraphs of subgraphs.","required":false,"schema":{"type":"boolean","title":"Recurse","default":false},"name":"recurse","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subgraphs"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/assistants/{assistant_id}/subgraphs/{namespace}":{"get":{"tags":["Assistants"],"summary":"Get Assistant Subgraphs by Namespace","description":"Get an assistant's subgraphs filtered by namespace.","operationId":"get_assistant_subgraphs_assistants__assistant_id__subgraphs__namespace__get","parameters":[{"description":"The ID of the assistant.","required":true,"schema":{"type":"string","format":"uuid","title":"Assistant Id"},"name":"assistant_id","in":"path"},{"description":"Namespace of the subgraph to filter by.","required":true,"schema":{"type":"string","title":"Namespace"},"name":"namespace","in":"path"},{"description":"Recursively retrieve subgraphs of subgraphs.","required":false,"schema":{"type":"boolean","title":"Recurse","default":false},"name":"recurse","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subgraphs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/assistants/{assistant_id}/schemas":{"get":{"tags":["Assistants"],"summary":"Get Assistant Schemas","description":"Get an assistant by ID.","operationId":"get_assistant_schemas_assistants__assistant_id__schemas_get","parameters":[{"description":"The ID of the assistant.","required":true,"schema":{"type":"string","format":"uuid","title":"Assistant Id","description":"The ID of the assistant."},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GraphSchema"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/assistants/{assistant_id}/versions":{"post":{"tags":["Assistants"],"summary":"Get Assistant Versions","description":"Get all versions of an assistant.","operationId":"get_assistant_versions_assistants__assistant_id__versions_get","parameters":[{"description":"The ID of the assistant.","required":true,"schema":{"type":"string","format":"uuid","title":"Assistant Id","description":"The ID of the assistant."},"name":"assistant_id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Assistant"},"type":"array","title":"Response Search Assistants Assistants Search Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/assistants/{assistant_id}/latest":{"post":{"tags":["Assistants"],"summary":"Set Latest Assistant Version","description":"Set the latest version for an assistant.","operationId":"set_latest_assistant_version_assistants__assistant_id__versions_post","parameters":[{"description":"The ID of the assistant.","required":true,"schema":{"type":"string","format":"uuid","title":"Assistant Id","description":"The ID of the assistant."},"name":"assistant_id","in":"path"},{"description":"The version to change to.","required":true,"schema":{"type":"integer","title":"Version","description":"The version of the assistant to change to."},"name":"version","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assistant"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads":{"post":{"tags":["Threads"],"summary":"Create Thread","description":"Create a thread.","operationId":"create_thread_threads_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadCreate"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/search":{"post":{"tags":["Threads"],"summary":"Search Threads","description":"Search for threads.\n\nThis endpoint also functions as the endpoint to list all threads.","operationId":"search_threads_threads_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadSearchRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Thread"},"type":"array","title":"Response Search Threads Threads Search Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/count":{"post":{"tags":["Threads"],"summary":"Count Threads","description":"Get the count of threads matching the specified criteria.","operationId":"count_threads_threads_count_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadCountRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"integer","title":"Count"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/prune":{"post":{"tags":["Threads"],"summary":"Prune Threads","description":"Prune threads by ID. The 'delete' strategy removes threads entirely. The 'keep_latest' strategy prunes old checkpoints but keeps threads and their latest state.","operationId":"prune_threads_threads_prune_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadPruneRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadPruneResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/state":{"get":{"tags":["Threads"],"summary":"Get Thread State","description":"Get state for a thread.\n\nThe latest state of the thread (i.e. latest checkpoint) is returned.","operationId":"get_latest_thread_state_threads__thread_id__state_get","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"},{"description":"Whether to include subgraphs in the response.","required":false,"schema":{"type":"boolean","title":"Subgraphs","description":"Whether to include subgraphs in the response."},"name":"subgraphs","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Threads"],"summary":"Update Thread State","description":"Add state to a thread.","operationId":"update_thread_state_threads__thread_id__state_post","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadStateUpdate"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadStateUpdateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/state/{checkpoint_id}":{"get":{"tags":["Threads"],"summary":"Get Thread State At Checkpoint","description":"Get state for a thread at a specific checkpoint.","operationId":"get_thread_state_at_checkpoint_threads__thread_id__state__checkpoint_id__get","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"},{"description":"The ID of the checkpoint.","required":true,"schema":{"type":"string","format":"uuid","title":"Checkpoint Id","description":"The ID of the checkpoint."},"name":"checkpoint_id","in":"path"},{"description":"Whether to include subgraphs in the response.","required":false,"schema":{"type":"boolean","title":"Subgraphs","description":"Whether to include subgraphs in the response."},"name":"subgraphs","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/state/checkpoint":{"post":{"tags":["Threads"],"summary":"Get Thread State At Checkpoint","description":"Get state for a thread at a specific checkpoint.","operationId":"post_thread_state_at_checkpoint_threads__thread_id__state__checkpoint_id__get","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadStateCheckpointRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/history":{"get":{"tags":["Threads"],"summary":"Get Thread History","description":"Get all past states for a thread.","operationId":"get_thread_history_threads__thread_id__history_get","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"},{"required":false,"schema":{"type":"integer","title":"Limit","default":10},"name":"limit","in":"query"},{"required":false,"schema":{"type":"string","title":"Before"},"name":"before","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ThreadState"},"type":"array","title":"Response Get Thread History Threads  Thread Id  History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Threads"],"summary":"Get Thread History Post","description":"Get all past states for a thread.","operationId":"get_thread_history_post_threads__thread_id__history_post","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadStateSearch"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ThreadState"},"type":"array","title":"Response Get Thread History Post Threads  Thread Id  History Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/copy":{"post":{"tags":["Threads"],"summary":"Copy Thread","description":"Create a new thread with a copy of the state and checkpoints from an existing thread.","operationId":"copy_thread_post_threads__thread_id__copy_post","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}":{"get":{"tags":["Threads"],"summary":"Get Thread","description":"Get a thread by ID.","operationId":"get_thread_threads__thread_id__get","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"},{"description":"Comma-separated list of additional fields to include. Supported values: ttl","required":false,"schema":{"type":"string","title":"Include","description":"Comma-separated list of additional fields to include."},"name":"include","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Threads"],"summary":"Delete Thread","description":"Delete a thread by ID.","operationId":"delete_thread_threads__thread_id__delete","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Threads"],"summary":"Patch Thread","description":"Update a thread.","operationId":"patch_thread_threads__thread_id__patch","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadPatch"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/stream":{"get":{"tags":["Threads"],"summary":"Join Thread Stream","description":"This endpoint streams output in real-time from a thread. The stream will include the output of each run executed sequentially on the thread and will remain open indefinitely. It is the responsibility of the calling client to close the connection.","operationId":"join_thread_stream_threads__thread_id__stream_get","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"},{"required":false,"schema":{"type":"string","title":"Last Event ID","description":"The ID of the last event received. Used to resume streaming from a specific point. Pass '-' to resume from the beginning."},"name":"Last-Event-ID","in":"header"},{"required":false,"schema":{"anyOf":[{"type":"string","enum":["lifecycle","run_modes","state_update"]},{"type":"array","items":{"type":"string","enum":["lifecycle","run_modes","state_update"]}}],"default":["run_modes"],"title":"Stream Modes","description":"Stream modes to control which events are returned. 'lifecycle' returns only run start/end events, 'run_modes' returns all run events (default behavior), 'state_update' returns only state update events."},"name":"stream_modes","in":"query"}],"responses":{"200":{"description":"Success","content":{"text/event-stream":{"schema":{"type":"string","description":"The server will send a stream of events in SSE format.\n\n**Example event**:\n\nid: 1\n\nevent: message\n\ndata: {}"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/stream/events":{"post":{"tags":["Streaming"],"summary":"Protocol v2 Event Stream (SSE)","description":"Open a connection-scoped SSE event stream for a thread. The request body is a `ProtocolEventStreamRequest` carrying channel and namespace filters; the server replies with `Content-Type: text/event-stream` and pushes matching `ProtocolEvent` frames for the lifetime of the connection. Closing the connection unsubscribes — no state is persisted server-side.\n\nReconnect: clients pass the last `seq` they received as `since` in the body. Buffered events with `seq > since` are replayed before the stream goes live. The endpoint is POST-only, so browser-native `EventSource` auto-resume (`Last-Event-ID`) does not apply — clients drive resume explicitly via the body.","operationId":"protocol_thread_events_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread to observe."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolEventStreamRequest"}}}},"responses":{"200":{"description":"SSE event stream","content":{"text/event-stream":{"schema":{"type":"string","description":"Stream of `ProtocolEvent` frames. Each SSE frame uses the event's `method` as the `event:` field and a JSON-encoded `ProtocolEvent` as the `data:` field; `id:` is set to the event's `seq`.\n\n**Example frame:**\n\nid: 42\n\nevent: messages\n\ndata: {\"type\":\"event\",\"event_id\":\"42\",\"seq\":42,\"method\":\"messages\",\"params\":{\"namespace\":[],\"timestamp\":1700000000000,\"data\":{...}}}"}}}},"400":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/runs":{"get":{"tags":["Thread Runs"],"summary":"List Runs","description":"List runs for a thread.","operationId":"list_runs_http_threads__thread_id__runs_get","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"},{"required":false,"schema":{"type":"integer","title":"Limit","default":10},"name":"limit","in":"query"},{"required":false,"schema":{"type":"integer","title":"Offset","default":0},"name":"offset","in":"query"},{"required":false,"schema":{"type":"string","enum":["pending","running","error","success","timeout","interrupted"]},"name":"status","in":"query"},{"required":false,"schema":{"type":"array","items":{"type":"string","enum":["run_id","thread_id","assistant_id","created_at","updated_at","status","metadata","kwargs","multitask_strategy","langsmith_session_name"]},"title":"Select","description":"Specify which fields to return. If not provided, all fields are returned."},"name":"select","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Run"},"type":"array"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"tags":["Thread Runs"],"summary":"Create Background Run","description":"Create a run in existing thread, return the run ID immediately. Don't wait for the final run output.","operationId":"create_run_threads__thread_id__runs_post","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreateStateful"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}},"headers":{"Content-Location":{"description":"The URL of the run that was created. Can be used to later join the stream.","schema":{"type":"string"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/runs/crons":{"post":{"tags":["Crons"],"summary":"Create Thread Cron","description":"Create a cron to schedule runs on a thread.","operationId":"create_thread_cron_threads__thread_id__runs_crons_post","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadCronCreate"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cron"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/runs/stream":{"post":{"tags":["Thread Runs"],"summary":"Create Run, Stream Output","description":"Create a run in existing thread. Stream the output.","operationId":"stream_run_threads__thread_id__runs_stream_post","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreateStreamingStateful"}}},"required":true},"responses":{"200":{"description":"Success","content":{"text/event-stream":{"schema":{"type":"string","description":"The server will send a stream of events in SSE format.\n\n**Example event**:\n\nid: 1\n\nevent: message\n\ndata: {}"}}},"headers":{"Content-Location":{"description":"The URL of the run that was created. Can be used to later join the stream.","schema":{"type":"string"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/runs/wait":{"post":{"tags":["Thread Runs"],"summary":"Create Run, Wait for Output","description":"Create a run in existing thread. Wait for the final output and then return it.","operationId":"wait_run_threads__thread_id__runs_wait_post","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreateStreamingStateful"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}},"headers":{"Content-Location":{"description":"The URL of the run that was created. Can be used to later join the stream.","schema":{"type":"string"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/runs/{run_id}":{"get":{"tags":["Thread Runs"],"summary":"Get Run","description":"Get a run by ID.","operationId":"get_run_http_threads__thread_id__runs__run_id__get","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"},{"description":"The ID of the run.","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id","description":"The ID of the run."},"name":"run_id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Run"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Thread Runs"],"summary":"Delete Run","description":"Delete a run by ID.","operationId":"delete_run_threads__thread_id__runs__run_id__delete","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"},{"description":"The ID of the run.","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id","description":"The ID of the run."},"name":"run_id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/runs/{run_id}/join":{"get":{"tags":["Thread Runs"],"summary":"Join Run","description":"Wait for a run to finish.","operationId":"join_run_http_threads__thread_id__runs__run_id__join_get","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"},{"description":"The ID of the run.","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id","description":"The ID of the run."},"name":"run_id","in":"path"},{"required":false,"schema":{"type":"boolean","title":"Cancel on Disconnect","description":"If true, the run will be cancelled if the client disconnects.","default":false},"name":"cancel_on_disconnect","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/runs/{run_id}/stream":{"get":{"tags":["Thread Runs"],"summary":"Join Run Stream","description":"Join a run stream. This endpoint streams output in real-time from a run similar to the /threads/__THREAD_ID__/runs/stream endpoint. If the run has been created with `stream_resumable=true`, the stream can be resumed from the last seen event ID.","operationId":"stream_run_http_threads__thread_id__runs__run_id__join_get","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"},{"description":"The ID of the run.","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id","description":"The ID of the run."},"name":"run_id","in":"path"},{"required":false,"schema":{"type":"string","title":"Last Event ID","description":"The ID of the last event received. Set to -1 if you want to stream all events. Requires `stream_resumable=true` to be set when creating the run."},"name":"Last-Event-ID","in":"header"},{"required":false,"schema":{"type":"string","title":"Stream Mode","description":"The mode to stream the run in. If not provided, the default mode will be used."},"name":"stream_mode","in":"query"},{"required":false,"schema":{"type":"boolean","title":"Cancel On Disconnect","description":"If true, the run will be cancelled if the client disconnects.","default":false},"name":"cancel_on_disconnect","in":"query"}],"responses":{"200":{"description":"Success","content":{"text/event-stream":{"schema":{"type":"string","description":"The server will send a stream of events in SSE format.\n\n**Example event**:\n\nid: 1\n\nevent: message\n\ndata: {}"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/runs/{run_id}/cancel":{"post":{"tags":["Thread Runs"],"summary":"Cancel Run","operationId":"cancel_run_http_threads__thread_id__runs__run_id__cancel_post","parameters":[{"description":"The ID of the thread.","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"name":"thread_id","in":"path"},{"description":"The ID of the run.","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id","description":"The ID of the run."},"name":"run_id","in":"path"},{"required":false,"schema":{"type":"boolean","title":"Wait","default":false},"name":"wait","in":"query"},{"description":"Action to take when cancelling the run. Possible values are `interrupt` or `rollback`. `interrupt` will simply cancel the run. `rollback` will cancel the run and delete the run and associated checkpoints afterwards.","required":false,"schema":{"type":"string","enum":["interrupt","rollback"],"title":"Action","default":"interrupt"},"name":"action","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/runs/crons":{"post":{"tags":["Crons"],"summary":"Create Cron","description":"Create a cron to schedule runs on new threads.","operationId":"create_cron_runs_crons_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CronCreate"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cron"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/runs/crons/search":{"post":{"tags":["Crons"],"summary":"Search Crons","description":"Search all active crons","operationId":"search_crons_runs_crons_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CronSearch"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Cron"},"type":"array","title":"Response Search Crons Search Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/runs/crons/count":{"post":{"tags":["Crons"],"summary":"Count Crons","description":"Get the count of crons matching the specified criteria.","operationId":"count_crons_runs_crons_count_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CronCountRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"integer","title":"Count"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/runs/stream":{"post":{"tags":["Stateless Runs"],"summary":"Create Run, Stream Output","description":"Create a run and stream the output.","operationId":"stream_run_stateless_runs_stream_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreateStreamingStateless"}}},"required":true},"responses":{"200":{"description":"Success","content":{"text/event-stream":{"schema":{"type":"string","description":"The server will send a stream of events in SSE format.\n\n**Example event**:\n\nid: 1\n\nevent: message\n\ndata: {}"}}},"headers":{"Content-Location":{"description":"The URL of the run that was created. Can be used to later join the stream.","schema":{"type":"string"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/runs/cancel":{"post":{"tags":["Thread Runs"],"summary":"Cancel Runs","description":"Cancel one or more runs. Can cancel runs by thread ID and run IDs, or by status filter.","operationId":"cancel_runs_post","parameters":[{"description":"Action to take when cancelling the run. Possible values are `interrupt` or `rollback`. `interrupt` will simply cancel the run. `rollback` will cancel the run and delete the run and associated checkpoints afterwards.","required":false,"schema":{"type":"string","enum":["interrupt","rollback"],"title":"Action","default":"interrupt"},"name":"action","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunsCancel"}}},"required":true},"responses":{"204":{"description":"Success - Runs cancelled"},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/runs/wait":{"post":{"tags":["Stateless Runs"],"summary":"Create Run, Wait for Output","description":"Create a run, wait for the final output and then return it.","operationId":"wait_run_stateless_runs_wait_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreateStreamingStateless"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}},"headers":{"Content-Location":{"description":"The URL of the run that was created. Can be used to later join the stream.","schema":{"type":"string"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/runs":{"post":{"tags":["Stateless Runs"],"summary":"Create Background Run","description":"Create a run and return the run ID immediately. Don't wait for the final run output.","operationId":"run_stateless_runs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreateStateless"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}},"headers":{"Content-Location":{"description":"The URL of the run that was created. Can be used to later join the stream.","schema":{"type":"string"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/runs/batch":{"post":{"tags":["Stateless Runs"],"summary":"Create Run Batch","description":"Create a batch of runs and return immediately.","operationId":"run_batch_stateless_runs_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunBatchCreate"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/runs/crons/{cron_id}":{"get":{"tags":["Crons"],"summary":"Get Cron","description":"Get a cron by ID.","operationId":"get_cron_runs_crons__cron_id__get","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"Cron Id"},"name":"cron_id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cron"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"tags":["Crons"],"summary":"Update Cron","description":"Update a cron job by ID.","operationId":"patch_cron_runs_crons__cron_id__patch","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"Cron Id"},"name":"cron_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CronPatch"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Cron"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Crons"],"summary":"Delete Cron","description":"Delete a cron by ID.","operationId":"delete_cron_runs_crons__cron_id__delete","parameters":[{"required":true,"schema":{"type":"string","format":"uuid","title":"Cron Id"},"name":"cron_id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/store/items":{"put":{"tags":["Store"],"summary":"Store or update an item.","operationId":"put_item","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorePutRequest"}}}},"responses":{"204":{"description":"Success"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"tags":["Store"],"summary":"Delete an item.","operationId":"delete_item","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreDeleteRequest"}}}},"responses":{"204":{"description":"Success"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["Store"],"summary":"Retrieve a single item.","operationId":"get_item","parameters":[{"name":"key","in":"query","required":true,"schema":{"type":"string"}},{"name":"namespace","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"refresh_ttl","in":"query","required":false,"schema":{"type":"boolean"},"description":"Whether to refresh the TTL on this read operation. If not provided, uses the store's default behavior."}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Item"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/store/items/search":{"post":{"tags":["Store"],"summary":"Search or list items within a namespace prefix.","description":"Lists items ordered by last updated time. If a `query` is provided, performs a natural language search instead. Supports pagination via `limit` and `offset`, and filtering via `filter`.","operationId":"search_items","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreSearchRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchItemsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/store/namespaces":{"post":{"tags":["Store"],"summary":"List namespaces with optional match conditions.","operationId":"list_namespaces","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreListNamespacesRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListNamespaceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/a2a/{assistant_id}":{"post":{"operationId":"post_a2a","summary":"A2A JSON-RPC","description":"Communicate with an assistant using the Agent-to-Agent (A2A) Protocol over JSON-RPC 2.0.\nThis endpoint accepts a JSON-RPC envelope and dispatches based on `method`.\n\n**Supported Methods:**\n- `message/send`: Send a message and wait for the final Task result.\n- `message/stream`: Send a message and receive Server-Sent Events (SSE) JSON-RPC responses.\n- `tasks/get`: Fetch the current state of a Task by ID.\n- `tasks/cancel`: Request cancellation (currently not supported; returns an error).\n\n**LangGraph Mapping:**\n- `message.contextId` maps to LangGraph `thread_id`.\n\n**Notes:**\n- Only `text` and `data` parts are supported; `file` parts are not.\n- If `message.contextId` is omitted, a new context is created.\n- Text parts require the assistant input schema to include a `messages` field.\n","parameters":[{"name":"assistant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"The ID of the assistant to communicate with"},{"name":"Accept","in":"header","required":true,"schema":{"type":"string"},"description":"For `message/stream`, must include `text/event-stream`. For all other methods, use `application/json`."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"],"description":"JSON-RPC version"},"id":{"type":"string","description":"Request identifier"},"method":{"type":"string","enum":["message/send","message/stream","tasks/get","tasks/cancel"],"description":"The method to invoke"},"params":{"type":"object","description":"Method parameters; shape depends on the method.","oneOf":[{"title":"Message Send/Stream Parameters","type":"object","properties":{"message":{"type":"object","properties":{"role":{"type":"string","enum":["user","agent"],"description":"A2A role for the message sender."},"parts":{"type":"array","items":{"oneOf":[{"title":"Text Part","type":"object","properties":{"kind":{"type":"string","enum":["text"]},"text":{"type":"string","description":"Text content."}},"required":["kind","text"]},{"title":"Data Part","type":"object","properties":{"kind":{"type":"string","enum":["data"]},"data":{"type":"object","description":"Structured JSON merged into the assistant input."}},"required":["kind","data"]}]},"description":"Message parts (text/data only)."},"messageId":{"type":"string","description":"Client-generated message identifier."},"contextId":{"type":"string","description":"Conversation context ID; maps to LangGraph thread_id."},"taskId":{"type":"string","description":"Optional task ID. Currently ignored by this implementation."}},"required":["role","parts","messageId"]}},"required":["message"]},{"title":"Task Get Parameters","type":"object","properties":{"id":{"type":"string","description":"Task (run) identifier to retrieve."},"contextId":{"type":"string","description":"Context identifier (thread_id) for the task."},"historyLength":{"type":"integer","minimum":0,"maximum":10,"description":"Maximum number of history messages to include."}},"required":["id","contextId"]},{"title":"Task Cancel Parameters","type":"object","properties":{"id":{"type":"string","description":"Task (run) identifier to cancel."},"contextId":{"type":"string","description":"Context identifier (thread_id) for the task."}},"required":["id","contextId"]}]}},"required":["jsonrpc","id","method"]},"examples":{"message_send":{"summary":"Send a message (synchronous)","value":{"jsonrpc":"2.0","id":"1","method":"message/send","params":{"message":{"role":"user","parts":[{"kind":"text","text":"Hello from A2A"},{"kind":"data","data":{"locale":"en-US"}}],"messageId":"msg-1","contextId":"f5bd2a40-74b6-4f7a-b649-ea3f09890003"}}}},"message_stream":{"summary":"Send a message (streaming)","value":{"jsonrpc":"2.0","id":"2","method":"message/stream","params":{"message":{"role":"user","parts":[{"kind":"text","text":"Stream this response"}],"messageId":"msg-2","contextId":"f5bd2a40-74b6-4f7a-b649-ea3f09890003"}}}},"tasks_get":{"summary":"Get a task","value":{"jsonrpc":"2.0","id":"3","method":"tasks/get","params":{"id":"run-uuid","contextId":"f5bd2a40-74b6-4f7a-b649-ea3f09890003","historyLength":10}}},"tasks_cancel":{"summary":"Cancel a task (currently unsupported)","value":{"jsonrpc":"2.0","id":"4","method":"tasks/cancel","params":{"id":"run-uuid","contextId":"f5bd2a40-74b6-4f7a-b649-ea3f09890003"}}},"message_stream_with_context":{"summary":"Stream multi-turn messages using the same contextId","description":"Send a streaming message; reuse the same contextId for subsequent turns to keep conversation state.","value":{"jsonrpc":"2.0","id":"1","method":"message/stream","params":{"message":{"role":"user","contextId":"thread-123","parts":[{"kind":"text","text":"Hello!"}],"messageId":"msg-1"}}}},"interrupt_resume_text":{"summary":"Resume an interrupted task with a text reply","description":"When a task is in input-required state, send a normal text part with the same contextId and taskId to resume.","value":{"jsonrpc":"2.0","id":"2","method":"message/send","params":{"message":{"role":"user","contextId":"thread-123","parts":[{"kind":"text","text":"Here is the info you asked for."}],"messageId":"msg-2","taskId":"thread-123:run-456"}}}},"interrupt_resume_data_parallel":{"summary":"Resume parallel interrupts with a data part","description":"Advanced: if your agent supports parallel interrupts, provide a structured resume payload in a data part with the same contextId and taskId.","value":{"jsonrpc":"2.0","id":"3","method":"message/send","params":{"message":{"role":"user","contextId":"thread-123","parts":[{"kind":"data","data":{"resume":[{"id":"interrupt-1","value":{"choice":"A"}},{"id":"interrupt-2","value":{"choice":"B"}}]}}],"messageId":"msg-3","taskId":"thread-123:run-456"}}}}}}}},"responses":{"200":{"description":"JSON-RPC response for non-streaming methods. For `message/stream`, the response is an SSE stream of JSON-RPC envelopes.","content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{"type":"string"},"result":{"type":"object","description":"Success result containing task information or task details"},"error":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}},"description":"Error information if request failed"}},"required":["jsonrpc","id"]},"examples":{"task_result":{"summary":"Task result (message/send)","value":{"jsonrpc":"2.0","id":"1","result":{"kind":"task","id":"run-uuid","contextId":"f5bd2a40-74b6-4f7a-b649-ea3f09890003","status":{"state":"completed"},"artifacts":[{"artifactId":"artifact-uuid","name":"Assistant Response","parts":[{"kind":"text","text":"Hello back"}]}]}}},"error_result":{"summary":"Error response","value":{"jsonrpc":"2.0","id":"1","error":{"code":-32602,"message":"Invalid request: Missing required parameter: contextId"}}}}},"text/event-stream":{"schema":{"type":"string","description":"SSE stream of JSON-RPC response objects."},"examples":{"stream_event":{"summary":"SSE data chunk (JSON-RPC)","value":"data: {\"jsonrpc\":\"2.0\",\"id\":\"2\",\"result\":{\"kind\":\"status-update\",\"taskId\":\"run-uuid\",\"contextId\":\"f5bd2a40-74b6-4f7a-b649-ea3f09890003\",\"status\":{\"state\":\"working\"},\"final\":false}}\n\n"}}}}},"400":{"description":"Bad Request (invalid JSON-RPC, invalid params, or missing Accept header)."},"404":{"description":"Assistant not found"},"500":{"description":"Internal server error"}},"tags":["A2A"]}},"/mcp/":{"post":{"operationId":"post_mcp","summary":"MCP Post","description":"Implemented according to the Streamable HTTP Transport specification.\nSends a JSON-RPC 2.0 message to the server.\n\n- **Request**: Provide an object with `jsonrpc`, `id`, `method`, and optional `params`.\n- **Response**: Returns a JSON-RPC response or acknowledgment.\n\n**Notes:**\n- Stateless: Sessions are not persisted across requests.\n","parameters":[{"name":"Accept","in":"header","required":true,"schema":{"type":"string","enum":["application/json, text/event-stream"]},"description":"Accept header must include both 'application/json' and 'text/event-stream' media types."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"A JSON-RPC 2.0 request, notification, or response object."},"example":{"jsonrpc":"2.0","id":"1","method":"initialize","params":{"clientInfo":{"name":"test_client","version":"1.0.0"},"protocolVersion":"2024-11-05","capabilities":{}}}}}},"responses":{"200":{"description":"Successful JSON-RPC response.","content":{"application/json":{"schema":{"type":"object"}}}},"202":{"description":"Notification or response accepted; no content body."},"400":{"description":"Bad request: invalid JSON or message format, or unacceptable Accept header."},"405":{"description":"HTTP method not allowed."},"500":{"description":"Internal server error or unexpected failure."}},"tags":["MCP"]},"get":{"operationId":"get_mcp","summary":"MCP Get","description":"Implemented according to the Streamable HTTP Transport specification.","responses":{"405":{"description":"GET method not allowed; streaming not supported."}},"tags":["MCP"]},"delete":{"operationId":"delete_mcp","summary":"Terminate Session","description":"Implemented according to the Streamable HTTP Transport specification.\nTerminate an MCP session. The server implementation is stateless, so this is a no-op.\n\n","responses":{"404":{"description":"Session not found"}},"tags":["MCP"]}},"/info":{"get":{"tags":["System"],"summary":"Server Information","description":"Get server version information, feature flags, and metadata.","operationId":"server_info_info_get","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","title":"Version","description":"LangGraph API version"},"langgraph_py_version":{"type":"string","title":"LangGraph Python Version","description":"LangGraph Python library version"},"flags":{"type":"object","title":"Feature Flags","description":"Enabled features and capabilities"},"metadata":{"type":"object","title":"Metadata","description":"Server deployment metadata"}},"required":["version","langgraph_py_version","flags","metadata"],"title":"ServerInfo"}}}}}}},"/metrics":{"get":{"tags":["System"],"summary":"System Metrics","description":"Get system metrics in Prometheus or JSON format for monitoring and observability.","operationId":"system_metrics_metrics_get","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["prometheus","json"],"default":"prometheus","title":"Output Format","description":"Response format: prometheus (default) or json"}}],"responses":{"200":{"description":"Success","content":{"text/plain":{"schema":{"type":"string","title":"Prometheus Metrics","description":"Metrics in Prometheus exposition format"}},"application/json":{"schema":{"type":"object","title":"JSON Metrics","description":"Metrics in JSON format including queue stats, worker stats, and HTTP metrics"}}}}}}},"/docs":{"get":{"tags":["System"],"summary":"API Documentation","description":"A local reference to the Agent Server API documentation.","operationId":"docs_get","responses":{"200":{"description":"Success","content":{"text/html":{}}}}}},"/ok":{"get":{"tags":["System"],"summary":"Health Check","description":"Check the health status of the server. Optionally check database connectivity.","operationId":"health_check_ok_get","parameters":[{"name":"check_db","in":"query","required":false,"schema":{"type":"integer","enum":[0,1],"default":0,"title":"Check Database","description":"Whether to check database connectivity (0=false, 1=true)"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","const":true,"title":"OK","description":"Indicates the server is healthy"}},"required":["ok"],"title":"HealthResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/threads/{thread_id}/commands":{"post":{"tags":["Streaming"],"summary":"Protocol v2 Command","description":"Send a single protocol command scoped to a thread. The request body is a `ProtocolCommand` envelope with a `method` (e.g. `run.start`, `input.respond`, `agent.getTree`) and method-specific `params`. The response is either a `ProtocolSuccess` (with method-specific `result`) or a `ProtocolError`.\n\nCommands that create runs (`run.start`, `input.respond`) leave the run executing in the background on the worker queue. Event streaming for that run is observed via a concurrent `POST /threads/{thread_id}/stream/events` connection.\n\nWebSocket clients use the same command envelope in-band on `/threads/{thread_id}/stream/events` and additionally have access to `subscription.subscribe` / `subscription.unsubscribe` over the same connection.","operationId":"protocol_thread_command_post","parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread the command applies to."}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolCommand"}}}},"responses":{"200":{"description":"Protocol response — either `ProtocolSuccess` or `ProtocolError`.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ProtocolSuccess"},{"$ref":"#/components/schemas/ProtocolError"}]}}}},"400":{"description":"Malformed command envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProtocolError"}}}}}}},"/token":{"post":{"summary":"Get Access Token","description":"OAuth2 token endpoint for client credentials flow","operationId":"get_access_token_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_get_access_token_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health Check","description":"Lightweight liveness probe: checks if the process is responsive.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ready":{"get":{"summary":"Readiness Check","description":"Comprehensive readiness probe - verifies both database connections.\n\nChecks:\n- agents_db: Application tables via db_manager (POSTGRES_DATABASE_URI /\n  langgraph_user at runtime; AGENTS_DB_URI fallback)\n- langgraph_db: LangGraph database via POSTGRES_DATABASE_URI (langgraph_user)\n- store: LangGraph store health (uses POSTGRES_DATABASE_URI)","operationId":"readiness_check_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ingestor/health":{"get":{"tags":["ingestor"],"summary":"Health Check","description":"Health check endpoint for K8s liveness/readiness probes.\n\nReturns minimal status info. Operational metrics are available\nvia authenticated endpoints only (e.g., /alerts/queue/stats).","operationId":"health_check_ingestor_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/alerts/dlq":{"get":{"tags":["alerts"],"summary":"Get Dlq Items","description":"Get items from the Dead Letter Queue.\n\nReturns alerts that failed processing after all retry attempts.\nOnly returns items belonging to the user's organization.\nFetches iteratively to ensure 'limit' items are returned if available.","operationId":"get_dlq_items_alerts_dlq_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get Dlq Items Alerts Dlq Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/alerts/dlq/{message_id}/replay":{"post":{"tags":["alerts"],"summary":"Replay Dlq Item","description":"Replay a failed alert from the DLQ.\n\nMoves the alert back to the pending queue with retry count reset to 0.\nOnly allows replay of items belonging to user's organization.","operationId":"replay_dlq_item_alerts_dlq__message_id__replay_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Replay Dlq Item Alerts Dlq  Message Id  Replay Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/alerts/dlq/{message_id}":{"delete":{"tags":["alerts"],"summary":"Delete Dlq Item","description":"Delete an item from the DLQ.\n\nPermanently removes the failed alert. Use with caution.\nOnly allows deletion of items belonging to user's organization.","operationId":"delete_dlq_item_alerts_dlq__message_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Dlq Item Alerts Dlq  Message Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/alerts/queue/stats":{"get":{"tags":["alerts"],"summary":"Get Queue Stats","description":"Get alert queue statistics for the current user's organization.\n\nReturns organization-specific DLQ count and general queue health info.\nGlobal processing metrics are not exposed to prevent information disclosure.","operationId":"get_queue_stats_alerts_queue_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Queue Stats Alerts Queue Stats Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/webhooks/ingestor/events":{"post":{"tags":["webhooks","ingestor"],"summary":"Receive Alert","description":"Universal webhook endpoint for receiving events from monitoring systems.\n\n**Webhook URL**: `POST /webhooks/ingestor/events`\n\n**Authentication**: Requires valid JWT token (Bearer authentication)\n\n**Payload**: Accepts webhooks forwarded from RO service with:\n- webhook_id: UUID for correlation with RO audit logs\n- organization_id: Organization ID\n- provider: Monitoring provider (datadog, google, newrelic, pagerduty)\n- payload: Raw webhook JSON from monitoring system\n- marshalled_event: Pre-marshalled StructuredEvent (required — RO is the sole marshaller)\n\nThe webhook_id is stored in LangGraph thread metadata for correlation.\n\n**Cross-tenant guard**: only the internal marshaller (the RO service\naccount, ``auth_source == \"internal\"``) may target an arbitrary\norganization via the payload. An external caller may submit events only\nfor its own organization — otherwise any authenticated customer could\nlaunch an investigation under another tenant's cloud context (and receive\nthat tenant's HITL notifications) simply by setting ``organization_id`` in\nthe body.\n\n**Example from RO**:\n```json\n{\n  \"webhook_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n  \"organization_id\": \"org-123\",\n  \"provider\": \"datadog\",\n  \"payload\": {...},\n  \"marshalled_event\": {\n    \"title\": \"High CPU Usage\",\n    \"id\": \"alert-123\",\n    \"content\": \"**CPU usage** exceeded 90%...\",\n    \"severity\": \"critical\",\n    \"time\": \"2024-01-15T14:30:00Z\",\n    \"transition\": \"triggered\",\n    \"external_links\": [],\n    \"update\": \"false\"\n  }\n}\n```","operationId":"receive_alert_webhooks_ingestor_events_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Event"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/webhooks/auth/users":{"post":{"tags":["webhooks","auth"],"summary":"Sync User Webhook","description":"Webhook endpoint for synchronizing user data from Landing/Auth app.\n\nThis endpoint is secured with an internal API key and allows the Landing/Auth app\nto notify this service about user lifecycle events (created, updated, deleted).\n\n**Webhook URL**: `POST /webhooks/auth/users`\n\n**Headers**:\n- `x-api-key`: Internal API key for authentication\n\n**Payload**:\n```json\n{\n    \"action\": \"created|updated|deleted\",\n    \"user_id\": \"external-user-id\",\n    \"user_data\": {\n        \"external_id\": \"external-user-id\",\n        \"username\": \"username\",\n        \"email\": \"email@example.com\",\n        \"full_name\": \"Full Name\",\n        \"organization_id\": \"org-uuid\",\n        \"roles\": [\"user\", \"admin\"],\n        \"is_active\": true,\n        \"updated_at\": \"2025-10-09T15:00:00Z\"\n    },\n    \"timestamp\": \"2025-10-09T15:00:00Z\"\n}\n```","operationId":"sync_user_webhook_webhooks_auth_users_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSyncPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSyncResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/auth/users/{external_id}":{"delete":{"tags":["webhooks","auth"],"summary":"Rollback User Creation","description":"Rollback user creation (delete user after failed onboarding).\n\nThis endpoint allows Landing Page to maintain atomicity by rolling back\nuser creation in Agents App if the overall onboarding flow fails.\n\n**Use Case:**\n1. Landing Page creates Auth0 user\n2. Landing Page calls Agents App to sync user\n3. If sync fails, Landing Page deletes Auth0 user\n4. Landing Page calls this endpoint to delete user from Agents App\n\n**Subscription Protection**: If the user has a REVENUE-BEARING subscription\n(active / past_due / unpaid), deletion is prevented (returns 400) and routed\nto support to prevent revenue loss. Non-paying states (trialing / incomplete)\nare allowed and their Stripe subscriptions are cancelled after the DB commit.\n\n**Rollback Window**: Destructive rollback is allowed only during the first\nfive minutes after user creation. Older accounts must go through support.\n\n**Idempotent**: Returns 200 even if user not found (already deleted).\n\n**Example:**\n```\nDELETE /webhooks/auth/users/OofTF1jvX5UQ4R3cRCDYwHXBtz43\nHeaders:\n  x-api-key: <internal-api-key>\n```","operationId":"rollback_user_creation_webhooks_auth_users__external_id__delete","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string","title":"External Id"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Rollback User Creation Webhooks Auth Users  External Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me/devices":{"post":{"tags":["devices"],"summary":"Register Device","description":"Idempotent upsert of the caller's device token.","operationId":"register_device_users_me_devices_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceRegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceToken"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/users/me/devices/{token}":{"delete":{"tags":["devices"],"summary":"Unregister Device","description":"Drop one of the caller's device tokens (idempotent).","operationId":"unregister_device_users_me_devices__token__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users":{"post":{"tags":["users"],"summary":"Create User","description":"Create a new user (admin only).\n\nCreates an \"internal\" user who authenticates with username/password.\nFor users from external OAuth/SSO systems, they are created automatically\nvia JWT authentication or webhook sync.\n\nOnly superusers can create new users.","operationId":"create_user_users_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["users"],"summary":"List Users","description":"List users with optional filters.\n\n- Superusers can list all users\n- Regular users can only list users in their organization","operationId":"list_users_users_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me":{"get":{"tags":["users"],"summary":"Get Current User Details","description":"Get current user's details.","operationId":"get_current_user_details_users_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/users/{user_id}":{"get":{"tags":["users"],"summary":"Get User","description":"Get user details by UUID.\n\n- Superusers can get any user\n- Regular users can get themselves or users in their organization","operationId":"get_user_users__user_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["users"],"summary":"Update User","description":"Update user details.\n\n- Superusers can update any user\n- Regular users can only update themselves (limited fields)","operationId":"update_user_users__user_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["users"],"summary":"Deactivate User","description":"Deactivate user (admin only).\n\nThis doesn't delete the user, just sets is_active=False.","operationId":"deactivate_user_users__user_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/users/me/password":{"patch":{"tags":["users"],"summary":"Change Own Password","description":"Change current user's password.\n\nOnly works for internal users (with username/password auth).\nExternal users (OAuth/SSO) cannot change password here.","operationId":"change_own_password_users_me_password_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordUpdate"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/users/{external_id}/subscription":{"get":{"tags":["users"],"summary":"Get User Subscription Status","description":"Get subscription status for a user by external_id (Auth0 User ID).\n\nThis endpoint is called by Landing Page to check subscription status.\nRequires authentication (internal service account or external user JWT).\n\nReturns subscription status with race condition handling for webhook delays.","operationId":"get_user_subscription_status_users__external_id__subscription_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string","title":"External Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get User Subscription Status Users  External Id  Subscription Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations":{"get":{"tags":["organizations"],"summary":"List Organizations","description":"List all organizations the current user belongs to.\n\nReturns an empty array if the user doesn't belong to any organizations.","operationId":"list_organizations_organizations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Organization"},"type":"array","title":"Response List Organizations Organizations Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["organizations"],"summary":"Create Organization","description":"Create a new organization.\n\nThe current user will automatically be added as the owner of the organization.","operationId":"create_organization_organizations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/organizations/{organization_id}":{"get":{"tags":["organizations"],"summary":"Get Organization","description":"Get details of a specific organization.\n\nUser must be a member of the organization to view it.","operationId":"get_organization_organizations__organization_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["organizations"],"summary":"Update Organization","description":"Update organization details.\n\nUser must be an owner or admin of the organization to update it.","operationId":"update_organization_organizations__organization_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["organizations"],"summary":"Delete Organization","description":"Delete an organization.\n\nUser must be the owner of the organization to delete it.\nAll teams and members will be removed when the organization is deleted.","operationId":"delete_organization_organizations__organization_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/admin-view":{"get":{"tags":["organizations"],"summary":"Get Admin View","description":"Read the calling user's admin-view toggle state in this org.\n\nNo role check — any member can query their own state (it's a\nper-membership flag). Non-members get 404.","operationId":"get_admin_view_organizations__organization_id__admin_view_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminViewState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["organizations"],"summary":"Set Admin View","description":"Toggle org-admin-view for the calling user in this org.\n\nWhen enabled AND the caller's role is 'owner' or 'admin', the auth\nfilter switches from owner+team scoping to\n``{\"organization_id\": ...}`` for this user's queries — they see\nevery thread in the org. Reversible at any time; D3 should show a\npersistent banner while ON so the elevated state is visible to the\noperator. Only owners/admins can flip the toggle (defense in depth\neven though a stored ``True`` on a member row is also ignored by\nthe auth filter's role re-check).","operationId":"set_admin_view_organizations__organization_id__admin_view_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminViewUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminViewState"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/members":{"get":{"tags":["organizations"],"summary":"List Organization Members","description":"List all members of an organization.\n\nUser must be a member of the organization to view its members.","operationId":"list_organization_members_organizations__organization_id__members_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrganizationMemberResponse"},"title":"Response List Organization Members Organizations  Organization Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["organizations"],"summary":"Add Organization Member","description":"Add a member to an organization.\n\nUser must be an owner or admin of the organization to add members.","operationId":"add_organization_member_organizations__organization_id__members_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationMemberAdd"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/members/me":{"get":{"tags":["organizations"],"summary":"Get Current Organization Membership","description":"Return the authenticated caller's current database-backed org role.\n\nThe lookup is deliberately bound to ``current_user.id``; callers cannot\nsupply a user identifier or fall back to email matching. A removed or\notherwise non-member caller receives 403 even when a still-valid token\ncarries stale organization claims.","operationId":"get_current_organization_membership_organizations__organization_id__members_me_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentOrganizationMembershipResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/members/{user_id}":{"delete":{"tags":["organizations"],"summary":"Remove Organization Member","description":"Remove a member from an organization.\n\nUser must be an owner or admin of the organization to remove members.\nOwners cannot remove themselves if they are the last owner.","operationId":"remove_organization_member_organizations__organization_id__members__user_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["organizations"],"summary":"Update Member Role","description":"Update an organization member's role.\n\nUser must be an owner of the organization to update member roles.\nCannot demote the last owner.","operationId":"update_member_role_organizations__organization_id__members__user_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationMemberAdd"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/set-primary":{"post":{"tags":["organizations"],"summary":"Set Primary Organization","description":"Set this organization as the user's primary organization.\n\nUser must be a member of the organization to set it as primary.","operationId":"set_primary_organization_organizations__organization_id__set_primary_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Set Primary Organization Organizations  Organization Id  Set Primary Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams":{"get":{"tags":["teams"],"summary":"List Teams","description":"List all teams the current user belongs to.\n\nReturns an empty array if the user doesn't belong to any teams.","operationId":"list_teams_teams_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Team"},"type":"array","title":"Response List Teams Teams Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["teams"],"summary":"Create Team","description":"Create a new team.\n\nThe current user will automatically be added as an admin of the team.\nThe team organization is always derived from the authenticated user.\nA body organization_id is accepted only as a backwards-compatible assertion.","operationId":"create_team_teams_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/teams/{team_id}":{"get":{"tags":["teams"],"summary":"Get Team","description":"Get details of a specific team.\n\nUser must be a member of the team to view it.","operationId":"get_team_teams__team_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["teams"],"summary":"Update Team","description":"Update team details.\n\nUser must be an admin of the team to update it.","operationId":"update_team_teams__team_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Team"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["teams"],"summary":"Delete Team","description":"Delete a team.\n\nUser must be an admin of the team to delete it.\nAll team members will be removed when the team is deleted.","operationId":"delete_team_teams__team_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}/members":{"get":{"tags":["teams"],"summary":"List Team Members","description":"List all members of a team.\n\nUser must be a member of the team to view its members.","operationId":"list_team_members_teams__team_id__members_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TeamMemberResponse"},"title":"Response List Team Members Teams  Team Id  Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["teams"],"summary":"Add Team Member","description":"Add a member to a team.\n\nUser must be an admin of the team to add members.","operationId":"add_team_member_teams__team_id__members_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberAdd"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/teams/{team_id}/members/{user_id}":{"delete":{"tags":["teams"],"summary":"Remove Team Member","description":"Remove a member from a team.\n\nUser must be an admin of the team to remove members.\nAdmins cannot remove themselves if they are the last admin.","operationId":"remove_team_member_teams__team_id__members__user_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["teams"],"summary":"Update Member Role","description":"Update a team member's role.\n\nUser must be an admin of the team to update member roles.\nCannot demote the last admin.","operationId":"update_member_role_teams__team_id__members__user_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"team_id","in":"path","required":true,"schema":{"type":"string","title":"Team Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberAdd"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/teams":{"get":{"tags":["teams"],"summary":"List Org Teams","description":"List teams the current user belongs to within a specific organization.\n\nReturns ``[]`` if the user has no team memberships in this org.\nThe org-access gate rejects requests where the caller isn't a\nmember of the target org (404, not 403, so cross-tenant probes\ncan't enumerate orgs).","operationId":"list_org_teams_organizations__organization_id__teams_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Team"},"title":"Response List Org Teams Organizations  Organization Id  Teams Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment":{"get":{"tags":["agent-environment"],"summary":"Get Environment","description":"Get complete Agent Environment for organization.\n\nReturns cloud providers and Kubernetes clusters configured\nfor service account impersonation.","operationId":"get_environment_organizations__organization_id__environment_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentEnvironmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/validate":{"get":{"tags":["agent-environment"],"summary":"Validate Environment","description":"Validate Agent Environment configuration.\n\nChecks for common issues like:\n- Orphaned clusters (referencing non-existent cloud providers)\n- Missing configuration\n- Invalid provider types","operationId":"validate_environment_organizations__organization_id__environment_validate_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentEnvironmentValidationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers":{"post":{"tags":["agent-environment"],"summary":"Create Cloud Provider","description":"Add cloud provider to Agent Environment.\n\nSupports GCP (service account email), AWS (role ARN), and Azure (managed identity or service principal).\nSensitive fields (Azure SP client_secret) are automatically encrypted.\nRequires admin or owner role.","operationId":"create_cloud_provider_organizations__organization_id__environment_cloud_providers_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudProviderCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudProviderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agent-environment"],"summary":"List Cloud Providers","description":"List all cloud providers for organization.","operationId":"list_cloud_providers_organizations__organization_id__environment_cloud_providers_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudProviderListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}":{"get":{"tags":["agent-environment"],"summary":"Get Cloud Provider","description":"Get cloud provider details.\n\nNote: Sensitive fields (Azure SP client_secret) are excluded from response.","operationId":"get_cloud_provider_organizations__organization_id__environment_cloud_providers__provider_key__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudProviderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["agent-environment"],"summary":"Update Cloud Provider","description":"Update cloud provider configuration or labels. Requires admin or owner role.","operationId":"update_cloud_provider_organizations__organization_id__environment_cloud_providers__provider_key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudProviderUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloudProviderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agent-environment"],"summary":"Delete Cloud Provider","description":"Remove cloud provider from Agent Environment. Requires admin or owner role.\n\nWarning: This will orphan any clusters referencing this provider.","operationId":"delete_cloud_provider_organizations__organization_id__environment_cloud_providers__provider_key__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/test":{"post":{"tags":["agent-environment"],"summary":"Test Cloud Provider","description":"Test existing cloud provider credentials (re-verification).\n\nUseful for \"Test Connection\" button in UI after provider creation.\nTests only cloud provider credentials, NOT Kubernetes cluster access.\n\nReturns:\n    {\"result\": \"success\"|\"failed\", \"message\": \"...\"}","operationId":"test_cloud_provider_organizations__organization_id__environment_cloud_providers__provider_key__test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/import-bucket/probe":{"post":{"tags":["agent-environment"],"summary":"Probe Import Bucket","description":"Verify the provider's import bucket end to end (write/read/delete).\n\nRuns the roundtrip via the impersonated tenant identity and\npersists the result on the provider entry, so the memory-seed\ncapability endpoint can report bulk-import availability without a\nnetwork round-trip. Admin-only: the result gates a data-path\nfeature. Requires ``import_bucket`` in the provider config.","operationId":"probe_import_bucket_organizations__organization_id__environment_cloud_providers__provider_key__import_bucket_probe_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/media-bucket/probe":{"post":{"tags":["agent-environment"],"summary":"Probe Media Bucket","description":"Verify the provider's media bucket end to end (write/read/delete).\n\nMirror of the import-bucket probe for the durable-attachments bucket\n(a separate consent surface — see the config schema). The persisted\nresult gates media residency: uploads route to the org's bucket only\nafter a successful probe. Admin-only.","operationId":"probe_media_bucket_organizations__organization_id__environment_cloud_providers__provider_key__media_bucket_probe_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/media-storage/setup":{"post":{"tags":["agent-environment"],"summary":"Setup Media Storage","description":"Run the whole media-storage connect flow; return the step report.\n\nMedia twin of the memory-seed ``/storage/setup`` route, minus the\nbrowser origin (no CORS: attachment bytes are written server-side).\nBacks the d3 \"Configure storage\" nudge card with the same one-call\nguided experience as the chat action. Admin-only.","operationId":"setup_media_storage_organizations__organization_id__environment_media_storage_setup_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_MediaStorageSetupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Setup Media Storage Organizations  Organization Id  Environment Media Storage Setup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/discover-clusters":{"get":{"tags":["agent-environment"],"summary":"Discover Clusters","description":"Discover GKE clusters in cloud provider's GCP project.\n\nReturns comprehensive result with error handling for permission issues.\nEnables users to select clusters from a dropdown instead of manually typing names.\n\nCurrently supports GCP (GKE) only. Returns 400 for other provider types.\n\nReturns:\n    ClusterDiscoveryResult with success status, clusters list, and error information","operationId":"discover_clusters_organizations__organization_id__environment_cloud_providers__provider_key__discover_clusters_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterDiscoveryResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/clusters":{"post":{"tags":["agent-environment"],"summary":"Create Clusters","description":"Add Kubernetes cluster(s) to Agent Environment (hierarchical - nested under provider).\n\nAccepts one or more clusters in a single request. All clusters are added to the\nspecified provider in a single database write operation.\nRequires admin or owner role.\n\nBehavior:\n- Validates all clusters before any writes\n- For GCP providers: Verifies platformpilot-access=enabled label exists (REQUIRED)\n- Skips duplicate clusters (idempotent)\n- Returns detailed per-cluster results\n- Single environment read/write cycle","operationId":"create_clusters_organizations__organization_id__environment_cloud_providers__provider_key__clusters_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterBatchCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterBatchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agent-environment"],"summary":"List Provider Clusters","description":"List all Kubernetes clusters for a specific cloud provider.","operationId":"list_provider_clusters_organizations__organization_id__environment_cloud_providers__provider_key__clusters_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/clusters":{"get":{"tags":["agent-environment"],"summary":"List Clusters","description":"List all Kubernetes clusters for organization (flattened from hierarchical structure - convenience endpoint).","operationId":"list_clusters_organizations__organization_id__environment_clusters_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/clusters/{cluster_name}":{"get":{"tags":["agent-environment"],"summary":"Get Cluster","description":"Get Kubernetes cluster details (hierarchical path).","operationId":"get_cluster_organizations__organization_id__environment_cloud_providers__provider_key__clusters__cluster_name__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"cluster_name","in":"path","required":true,"schema":{"type":"string","title":"Cluster Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["agent-environment"],"summary":"Update Cluster","description":"Update Kubernetes cluster configuration (hierarchical path). Requires admin or owner role.\n\nCurrently only supports updating labels.","operationId":"update_cluster_organizations__organization_id__environment_cloud_providers__provider_key__clusters__cluster_name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"cluster_name","in":"path","required":true,"schema":{"type":"string","title":"Cluster Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KubernetesClusterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agent-environment"],"summary":"Delete Cluster","description":"Remove Kubernetes cluster from Agent Environment (hierarchical path). Requires admin or owner role.","operationId":"delete_cluster_organizations__organization_id__environment_cloud_providers__provider_key__clusters__cluster_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"cluster_name","in":"path","required":true,"schema":{"type":"string","title":"Cluster Name"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/cluster-access":{"post":{"tags":["agent-environment"],"summary":"Verify Cluster Access","description":"Verify access level for specific clusters (Step 4 UI validation).\n\nThis endpoint is called after users grant conditional IAM permissions to validate\nthat PlatformPilot has the expected access level (container.clusterAdmin).\n\nUsed in Step 4 of the UI journey to confirm that:\n1. Service account can get cluster details\n2. Clusters have platformpilot-access=enabled label\n3. Access level is container.clusterAdmin (not just viewer)\n\nReturns detailed verification results per cluster with actionable guidance.","operationId":"verify_cluster_access_organizations__organization_id__environment_cloud_providers__provider_key__cluster_access_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterAccessRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterAccessResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/discover-services":{"get":{"tags":["agent-environment"],"summary":"Discover Services","description":"Discover enabled GCP services in a provider's project.\n\nReturns categorized list of enabled APIs for selection and registration.\nCurrently supports GCP only. Requires admin/owner: this endpoint also\nauto-enables prerequisite APIs (a mutation on the customer's project), so it\nis gated like the other mutating environment endpoints (grant/enable/etc.).","operationId":"discover_services_organizations__organization_id__environment_cloud_providers__provider_key__discover_services_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceDiscoveryResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/services":{"post":{"tags":["agent-environment"],"summary":"Create Services","description":"Batch register GCP services from discovery results. Requires admin role.","operationId":"create_services_organizations__organization_id__environment_cloud_providers__provider_key__services_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GCPServiceBatchCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GCPServiceBatchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agent-environment"],"summary":"List Services","description":"List registered GCP services for a provider.","operationId":"list_services_organizations__organization_id__environment_cloud_providers__provider_key__services_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GCPServiceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/services/{service_name}":{"delete":{"tags":["agent-environment"],"summary":"Delete Service","description":"Deregister a GCP service. Requires admin role.","operationId":"delete_service_organizations__organization_id__environment_cloud_providers__provider_key__services__service_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"service_name","in":"path","required":true,"schema":{"type":"string","title":"Service Name"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/services/{service_name}/enable":{"post":{"tags":["agent-environment"],"summary":"Enable Service","description":"Enable a GCP API in the project. Requires admin role.","operationId":"enable_service_organizations__organization_id__environment_cloud_providers__provider_key__services__service_name__enable_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"service_name","in":"path","required":true,"schema":{"type":"string","title":"Service Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceEnableResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/services/{service_name}/disable":{"post":{"tags":["agent-environment"],"summary":"Disable Service","description":"Disable a GCP API in the project. Requires admin role. Refuses critical services.","operationId":"disable_service_organizations__organization_id__environment_cloud_providers__provider_key__services__service_name__disable_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"service_name","in":"path","required":true,"schema":{"type":"string","title":"Service Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceEnableResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/iam/check":{"get":{"tags":["agent-environment"],"summary":"Check Iam","description":"Check current IAM roles for the tenant SA and get recommendations.","operationId":"check_iam_organizations__organization_id__environment_cloud_providers__provider_key__iam_check_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceIAMCheckResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/iam/grant":{"post":{"tags":["agent-environment"],"summary":"Grant Iam Role","description":"Grant an IAM role to the tenant SA. Requires admin role.","operationId":"grant_iam_role_organizations__organization_id__environment_cloud_providers__provider_key__iam_grant_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAMGrantRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAMGrantResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/iam/revoke":{"post":{"tags":["agent-environment"],"summary":"Revoke Iam Role","description":"Revoke an IAM role from the tenant SA. Requires admin role.","operationId":"revoke_iam_role_organizations__organization_id__environment_cloud_providers__provider_key__iam_revoke_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAMRevokeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IAMGrantResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/deny-list":{"get":{"tags":["agent-environment"],"summary":"Get Provider Deny List","description":"Get command deny list for a cloud provider.","operationId":"get_provider_deny_list_organizations__organization_id__environment_cloud_providers__provider_key__deny_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["agent-environment"],"summary":"Update Provider Deny List","description":"Replace command deny list for a cloud provider. Requires admin role.","operationId":"update_provider_deny_list_organizations__organization_id__environment_cloud_providers__provider_key__deny_list_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/deny-list/reset":{"post":{"tags":["agent-environment"],"summary":"Reset Provider Deny List","description":"Reset provider deny list to built-in defaults. Requires admin role.","operationId":"reset_provider_deny_list_organizations__organization_id__environment_cloud_providers__provider_key__deny_list_reset_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/clusters/{cluster_name}/deny-list":{"get":{"tags":["agent-environment"],"summary":"Get Cluster Deny List","description":"Get command deny list for a Kubernetes cluster.","operationId":"get_cluster_deny_list_organizations__organization_id__environment_cloud_providers__provider_key__clusters__cluster_name__deny_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"cluster_name","in":"path","required":true,"schema":{"type":"string","title":"Cluster Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["agent-environment"],"summary":"Update Cluster Deny List","description":"Replace command deny list for a Kubernetes cluster. Requires admin role.","operationId":"update_cluster_deny_list_organizations__organization_id__environment_cloud_providers__provider_key__clusters__cluster_name__deny_list_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"cluster_name","in":"path","required":true,"schema":{"type":"string","title":"Cluster Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/clusters/{cluster_name}/deny-list/reset":{"post":{"tags":["agent-environment"],"summary":"Reset Cluster Deny List","description":"Reset cluster deny list to built-in kubectl defaults. Requires admin role.","operationId":"reset_cluster_deny_list_organizations__organization_id__environment_cloud_providers__provider_key__clusters__cluster_name__deny_list_reset_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"cluster_name","in":"path","required":true,"schema":{"type":"string","title":"Cluster Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/memory-db":{"post":{"tags":["agent-environment","memory-db"],"summary":"Configure Memory Db","description":"Create or replace the BYO Memory DB config under a provider.\n\nIdempotent on repeat: a second POST with the same body re-writes\nthe same blob and returns 201 (the route is treated as a \"set\"\noperation, mirroring the cloud-providers POST upsert behavior).\n\nAuth chain: admin role → paid plan (402) → memory_enabled\n(422) → gcp provider (422) → at-most-one (409). The order matters:\nwe don't want to leak organization plan info to a non-admin, so\nrole gate runs first.","operationId":"configure_memory_db_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryDbConfigCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryDbConfigResponse"}}}},"402":{"description":"Paid plan required","content":{"application/problem+json":{}}},"409":{"description":"Another provider already has memory_db configured"},"422":{"description":"memory_enabled=False or non-gcp provider"},"429":{"description":"Per-org admin rate limit exhausted (``_enforce_admin_rate_limit``). ``Retry-After`` header carries the wait in seconds."},"502":{"description":"Cloud SQL Admin API call to fetch TLS metadata (``fetch_cloud_sql_tls_metadata``) failed and the config could not be persisted in a CA-pinned shape. Returns RFC 9457 problem-details.","content":{"application/problem+json":{}}}}},"get":{"tags":["agent-environment","memory-db"],"summary":"Get Memory Db","description":"Return the current memory-db config + last health for the provider.\n\nAdmin-only AND paid-plan-only, consistent with the sibling\n``/stats``, ``/events``, POST/PUT/DELETE/test/migrate routes.\nThe record exposes the customer's ``instance_connection_name``,\n``iam_user``, ``public_ip`` and ``instance_dns_name``; a non-\nadmin OR unentitled org shouldn't be able to introspect the\nBYO topology + health any more than they can the pool/breaker\nstate. Without the plan gate a downgraded tenant's admin\ncould still read back the routing surface their plan no longer\nentitles them to. No secrets are stored on the record (IAM auth\nmeans we never keep a password; the server CA PEM is\nintentionally not echoed — only ``server_ca_pinned``).","operationId":"get_memory_db_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryDbConfigResponse"}}}},"402":{"description":"Paid plan required (RFC 9457 problem-details). The BYO surface — including read access to the topology fields exposed by this endpoint, is gated to paid plans to keep entitlement consistent across POST/GET/PUT/DELETE/test/migrate after a downgrade."},"404":{"description":"No memory-db configured under this provider"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agent-environment","memory-db"],"summary":"Delete Memory Db","description":"Remove the memory-db config from a provider (revert to platform).\n\nData on the customer's Cloud SQL instance is **NOT** deleted —\nonly the routing config. Customers wanting their rows gone must\nrun the reverse-migration job (Phase 5). The response body\nintentionally surfaces this in the No-Content path via a\n``Warning`` header.\n\nUX safeguard, opt-in: if ``BYO_DELETE_CONFIRM_REQUIRED=true``,\nthe caller MUST supply the ``X-Confirm-Delete`` header set to the\nURL's ``provider_key`` or the request returns 412 Precondition\nFailed. Default is ``false`` for backwards compatibility — when\nthe env flag is off, a missing header logs a warning and proceeds\nso operators can dry-run the requirement before turning it on.\n\n``X-Confirm-Delete`` is a UX safeguard, NOT a security control.\nIt carries no replay-protection (no nonce, no timestamp, no\nsignature) — a copy of the header replays exactly like the\noriginal. The admin-role check + the paid-plan gate are the\nsecurity boundary; the header just forces the caller to spell\nout the resource being deleted.\n\nNo ``?confirm=<provider_key>`` query fallback: query params land\nin HTTP access logs (proxy, CDN, gh-actions); headers don't.\nHeader-only keeps the confirmation gesture out of those log\ndestinations.\n\n``memory_enabled=False`` precondition — mirrors the\n``truncate_memory_db`` route. Deleting a routing config while\n``memory_enabled=True`` lets in-flight ops drain to the BYO store\nwhile new ops in the next ~30s race the routing flip and land in\nEITHER tenant store OR the platform default — split data residency.\nReturns 409 with Problem Details unless ``?force=true`` is passed\n(emergency override; logs WARNING).","operationId":"delete_memory_db_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","description":"Emergency override of the memory_enabled=False precondition. Setting force=true allows DELETE while memory_enabled=True; logs a WARNING so the override is auditable. Use only when the standard 'flip memory_enabled=False, then delete' sequence is impractical (e.g., customer-side outage).","default":false,"title":"Force"},"description":"Emergency override of the memory_enabled=False precondition. Setting force=true allows DELETE while memory_enabled=True; logs a WARNING so the override is auditable. Use only when the standard 'flip memory_enabled=False, then delete' sequence is impractical (e.g., customer-side outage)."},{"name":"X-Confirm-Delete","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Confirm-Delete"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"No memory-db configured under this provider"},"409":{"description":"``memory_enabled=True`` precondition violated. Flip memory_enabled to False before deleting the routing config, or pass ``?force=true`` for an emergency override."},"412":{"description":"``X-Confirm-Delete`` header did not match the URL's provider_key (only when ``BYO_DELETE_CONFIRM_REQUIRED=true``)."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/memory-db/test":{"post":{"tags":["agent-environment","memory-db"],"summary":"Test Memory Db","description":"Run the 8-check health probe against the configured BYO instance.\n\nOpens a one-shot psycopg connection (NOT through the registry's\npool — we deliberately exercise the cold path so the probe\nreflects what a fresh runtime replica would see) and runs each\ncheck.  Persists the outcome to ``last_health_status`` and, when\nthe overall report passes AND ``provisioning_state == \"pending\"``,\ntransitions to ``active`` so the dispatcher starts routing memory\nops to the customer's instance.\n\nAlways returns 200 with the per-check report — the operator\nwants to see every failure at once, not one-at-a-time via\ncascading non-200s.\n\nRe-asserts the paid-plan gate: this route transitions\n``pending -> active`` (starts routing memory ops to the customer\ninstance), so a downgraded org must not be able to re-activate\nBYO through it after losing the entitlement. ``memory_enabled``\nis intentionally NOT required for the PROBE itself, operators\nlegitimately probe connectivity before flipping A-Mem on. The\nACTIVATION flip is separately gated by ``ensure_safe_to_activate``:\nan org with existing platform memory rows and memory_enabled=True\nis refused (probe report still returned) so the routing cutover\ncannot open a split-brain window ahead of migration.","operationId":"test_memory_db_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Probe ran; check ``overall`` for pass/fail.","content":{"application/json":{"schema":{}}}},"402":{"description":"Paid plan required","content":{"application/problem+json":{}}},"404":{"description":"No memory-db configured under this provider."},"422":{"description":"memory-db config exists but is missing public_ip (onboarding not yet complete)."},"429":{"description":"Per-org admin rate limit exhausted. ``Retry-After`` header carries the wait in seconds."},"502":{"description":"Cloud SQL Admin API call (``byo_connect`` / ``fetch_cloud_sql_tls_metadata``) failed. Returns RFC 9457 problem-details.","content":{"application/problem+json":{}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/memory-db/stats":{"get":{"tags":["agent-environment","memory-db"],"summary":"Get Memory Db Stats","description":"Return the BYO pool registry's observability snapshot.\n\nAdmin-only AND paid-plan-only, surfaces per-org breaker state,\nwhich a non-admin member shouldn't be able to introspect (it\ncould leak signal about the org's BYO health to people without\noperational responsibility). Plan gate is symmetric with\n``GET /memory-db``, a downgraded org's admin must not\nretain polling access to BYO topology their plan no longer\nentitles them to.\n\nThe global counters (``pool_count``, ``total_opens``,\n``total_evictions``, ``total_invalidations``,\n``total_probe_failures``) are PROCESS-WIDE rather than per-org —\na single replica's view, not aggregated across replicas.  Wire\nthem into LangSmith / Prometheus by polling each replica.","operationId":"get_memory_db_stats_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_stats_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Registry observability snapshot. ``breakers`` and ``last_op_at`` are filtered to the calling org; global counters (pool_count, total_opens, etc.) are process-wide.","content":{"application/json":{"schema":{}}}},"402":{"description":"Paid plan required (RFC 9457 problem-details). Observability surface kept symmetric with GET /memory-db a downgraded org's admin must not retain polling access to BYO topology."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/memory-db/events":{"get":{"tags":["agent-environment","memory-db"],"summary":"Get Memory Db Events","description":"Dump the most recent pool events for ``organization_id``.\n\nAdmin-only — events carry breaker state and probe-failure detail\nthat a non-admin member shouldn't be able to introspect (it could\nleak signal about the org's BYO health to people without\noperational responsibility, mirroring ``/stats``).\n\nEach event row carries:\n\n* ``ts`` — ISO-utc timestamp.\n* ``replica_id`` — process-stable tag for the replica that produced\n  the event. Multi-replica deployments grep by this to group events\n  from one replica's view of the world; without it, a customer\n  report of \"my pool keeps reopening\" can't be traced to a single\n  replica's breaker storm vs a multi-replica problem.\n* ``org_id`` — always equal to the path-param ``organization_id``\n  (the route filters via ``TenantStoreRegistry.get_events``).\n* ``event_type`` — one of the documented event types.\n* ``detail`` — optional event-specific context (drift fingerprint\n  diff, breaker count, exception class).\n\n``limit`` slices from the most-recent end of the buffer; capped at\n``MAX_RING_EVENTS`` so a hostile / sloppy caller can't ask for\nstate outside the ring's actual retention.\n\nLike ``/stats``, the output is PROCESS-LOCAL — querying a single\nreplica returns only that replica's view. Wire into a log\naggregator (Cloud Logging, Datadog) by polling each replica and\nde-duplicating by ``(ts, replica_id, org_id, event_type)``.","operationId":"get_memory_db_events_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_events_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Per-replica append-only ring of pool events for this org (open / close / evict / drift / breaker trip + reset / invalidate / probe failure). Process-local — polling is per-replica, same caveat as ``/stats``.","content":{"application/json":{"schema":{}}}},"402":{"description":"Paid plan required (RFC 9457 problem-details). Event ring carries probe-failure detail + breaker state — kept symmetric with ``/stats`` and ``GET /memory-db`` so a downgrade closes the whole observability surface, not just half of it."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/memory-db/migrate":{"post":{"tags":["agent-environment","memory-db"],"summary":"Migrate To Memory Db","description":"Kick off platform→BYO (or BYO→platform) migration as a background job.\n\nReturns 202 immediately; the actual copy runs in a FastAPI\nbackground task and stamps ``last_health_status`` on the\nmemory_db record when it finishes.  Operators monitor via logs\nor by polling GET /memory-db (the ``last_health_check`` /\n``last_health_status`` fields).\n\nThe cutover contract is the operator's responsibility:\n\n  1. Flip memory_enabled=False (PUT /agent/settings).\n  2. POST /memory-db/migrate.\n  3. Wait for last_health_check to update (or grep logs for the\n     \"BYO memory-db config mutation: ... action=migrate_done\" line).\n  4. Flip memory_enabled=True only if the run verified clean:\n     errors==0 AND reconciliation passed (payload digests, key\n     parity, vector coverage, counter monotonicity, redirect\n     parity; ``ok=True`` on the migrate_done log line).\n\nFor larger corpora (>10k records) prefer\n``scripts/migrate_memories_to_byo.py`` so progress lands on the\noperator's terminal rather than the server log.\n\nRe-asserts the paid-plan gate: a downgraded org must not be\nable to copy the corpus into a customer instance via this route\nafter losing the BYO entitlement. ``memory_enabled`` is NOT\nasserted here — migration deliberately requires it to be *False*\n(see ``_ensure_memory_disabled_for_migration`` below); the two\nchecks would contradict each other.","operationId":"migrate_to_memory_db_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_migrate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}},{"name":"reverse","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Reverse"}}],"responses":{"202":{"description":"Migration kicked off as a background job.","content":{"application/json":{"schema":{}}}},"402":{"description":"Paid plan required","content":{"application/problem+json":{}}},"404":{"description":"No memory-db configured under this provider."},"409":{"description":"A migration is already in progress for this organization (rapid double-click on /migrate). Wait for the in-flight job to land its terminal log line, then retry."},"422":{"description":"memory_enabled=True (must be False during migration), or memory-db is in pending/failed state, or public_ip missing."},"429":{"description":"Per-org admin rate limit exhausted. ``Retry-After`` header carries the wait in seconds."},"502":{"description":"Cloud SQL Admin API call failed during pre-migrate TLS metadata fetch. Returns RFC 9457 problem-details.","content":{"application/problem+json":{}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/memory-db/truncate":{"post":{"tags":["agent-environment","memory-db"],"summary":"Truncate Memory Db","description":"Wipe BYO memory-DB rows for this org (admin + memory-disabled).\n\nPreconditions (all strict):\n\n  * caller is org admin/owner\n  * org has a paid plan (re-asserted: a downgrade must not be\n    able to nuke the BYO corpus from this route)\n  * per-org admin rate limit not exhausted (429 otherwise)\n  * no migration or truncate in flight (409 otherwise, deleting\n    rows a concurrent forward copy is writing, or vice versa,\n    leaves a silent partial corpus)\n  * ``memory_enabled`` is **False** (409 otherwise — the truncate\n    is non-atomic and live writes would race the delete loop)\n  * a memory-db config is registered on the named provider with\n    a resolved ``public_ip`` and ``provisioning_state == active``\n\nDefaults to ``dry_run=True`` — operators see the per-namespace\nrow counts without writes. Pass ``dry_run=False`` only after\nreviewing the dry-run output.","operationId":"truncate_memory_db_organizations__organization_id__environment_cloud_providers__provider_key__memory_db_truncate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TruncateRequest"}}}},"responses":{"200":{"description":"Truncate report (counts + per-namespace status).","content":{"application/json":{"schema":{}}}},"402":{"description":"Paid plan required","content":{"application/problem+json":{}}},"404":{"description":"No memory-db configured under this provider."},"409":{"description":"memory_enabled=True — flip to False first."},"422":{"description":"memory-db not active or public_ip missing."},"429":{"description":"Per-org admin rate limit exhausted. ``Retry-After`` header carries the wait in seconds."},"502":{"description":"Cloud SQL Admin API call failed during pre-truncate TLS metadata fetch. Returns RFC 9457 problem-details.","content":{"application/problem+json":{}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/encryption":{"post":{"tags":["agent-environment","encryption"],"summary":"Register Encryption","description":"Register a per-org KMS key (BYOK T1 / T2).\n\nIdempotent re-POST of the *identical* ``key_resource`` returns\n200 with the existing record (no mutation). A different\n``key_resource`` returns 409 — use PUT to rotate.\n\nProvisioning_state starts ``pending``. The admin should follow\nup with ``POST .../test`` to verify our SA can call ``encrypt``\non the resource before relying on the BYOK config for production\nwrites (encrypt path falls back to the platform default until\nstate flips to ``active``).","operationId":"register_encryption_organizations__organization_id__environment_cloud_providers__provider_key__encryption_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionConfigCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionConfigResponse"}}}},"200":{"description":"Idempotent re-POST of the same key_resource — existing record returned with no mutation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionConfigResponse"}}}},"402":{"content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionSubscriptionRequiredProblemDetail"}}},"description":"Active paid subscription required"},"409":{"description":"Encryption already configured for this provider"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["agent-environment","encryption"],"summary":"Get Encryption","description":"Read the current encryption config for this provider.\n\nAdmin-only (encryption registration is sensitive operational state).","operationId":"get_encryption_organizations__organization_id__environment_cloud_providers__provider_key__encryption_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionConfigResponse"}}}},"404":{"description":"No encryption config registered"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["agent-environment","encryption"],"summary":"Rotate Encryption","description":"Replace ``key_resource`` (rotation).\n\nExisting ciphertext stays decryptable because the LangGraph SDK\nPERSISTS ``ctx.metadata`` (including ``kms_key_resource``) at\nencrypt time and RESTORES it at decrypt time — verified in\n``langgraph_api/encryption/middleware.py:408``. So an old blob's\npersisted ctx pins the OLD KEK; decrypt later passes the OLD KEK\nto ``_kms_unwrap``, which works as long as the OLD KEK still\nexists in customer KMS. The new KEK only affects writes that\nhappen AFTER this PUT (their ctx is persisted with the new KEK).\n\nNB: this is NOT a GCP-KMS auto-routing property — KMS only\nauto-routes between VERSIONS of the same cryptoKey resource, not\nbetween different cryptoKey resources. Rotation between different\nKEKs works here entirely because of SDK ctx persistence. A future\nrefactor that \"simplifies\" by re-deriving ``kms_key_resource``\nat decrypt time from the current resolver state (instead of using\nthe persisted value) would break decrypt for all pre-rotation\nrows.\n\nResets ``provisioning_state`` to ``pending`` — the admin should\nre-run ``/test`` to verify our SA still has permission on the new\nresource. Also drops the cached active DEK under the OLD KEK so\nwe don't keep encrypting under an obsolete key while the resolver\ncache rolls over.","operationId":"rotate_encryption_organizations__organization_id__environment_cloud_providers__provider_key__encryption_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionConfigCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionConfigResponse"}}}},"402":{"content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionSubscriptionRequiredProblemDetail"}}},"description":"Active paid subscription required"},"404":{"description":"No encryption config to rotate"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["agent-environment","encryption"],"summary":"Delete Encryption","description":"Revert to the platform default KEK.\n\nExisting ciphertext written under the customer's KEK stays\ndecryptable as long as their KEK still exists in customer KMS.\nDeleting THIS config record only tells our encrypt path to stop\nusing the customer's key for FUTURE writes; it does NOT touch\nthe customer's KMS infrastructure.\n\nTo make existing ciphertext irretrievable (GDPR right-to-erasure\npath): the customer deletes/destroys their KMS key in their GCP\nproject AFTER calling DELETE here. The two-step sequence is\nintentional — accidental DELETE here doesn't lose data.\n\nSubscription-gated for parity with POST/PUT/test: an org that\ncancelled its subscription shouldn't be able to delete-then-\nreregister either. Admin-only.","operationId":"delete_encryption_organizations__organization_id__environment_cloud_providers__provider_key__encryption_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"204":{"description":"Successful Response"},"402":{"content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionSubscriptionRequiredProblemDetail"}}},"description":"Active paid subscription required"},"404":{"description":"No encryption config to delete"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/environment/cloud-providers/{provider_key}/encryption/test":{"post":{"tags":["agent-environment","encryption"],"summary":"Test Encryption","description":"Run a KMS encrypt probe against the registered KEK.\n\nVerifies that:\n1. The KEK resource exists in GCP KMS.\n2. Our platform SA has\n   ``roles/cloudkms.cryptoKeyEncrypterDecrypter`` on it.\n\nFlips ``provisioning_state`` to ``active`` on success or\n``failed`` on permission/availability errors. Stores the error\nmessage (redacted) so the UI / next admin can see why the previous\nprobe failed.\n\nSubscription-gated: a probe flipping state to ``active`` makes\nthe encryption handlers start routing the org's encrypts through\nthat KEK — so an org that cancelled its subscription running\n``/test`` would re-activate BYOK on a lapsed sub. Mirrors POST/PUT.","operationId":"test_encryption_organizations__organization_id__environment_cloud_providers__provider_key__encryption_test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider_key","in":"path","required":true,"schema":{"type":"string","title":"Provider Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestProbeResult"}}}},"402":{"content":{"application/problem+json":{},"application/json":{"schema":{"$ref":"#/components/schemas/EncryptionSubscriptionRequiredProblemDetail"}}},"description":"Active paid subscription required"},"404":{"description":"No encryption config to test"},"409":{"description":"encryption.key_resource was rotated by a concurrent PUT/DELETE between the probe and the state write. Retry /test against the new state."},"503":{"description":"Both the KMS probe and the state persistence failed. Retry — a transient state-write failure does not lose the probe outcome."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/settings/agent":{"get":{"tags":["organization-settings"],"summary":"Get Agent Settings","description":"Get agent settings for an organization.\n\nReturns default settings if not configured. User must belong to the\norganization. The response body carries a monotonic ``revision`` that a\nclient echoes back via ``If-Match`` on a subsequent write to detect a\nconcurrent edit (see ``format_agent_settings_etag`` for the token shape).","operationId":"get_agent_settings_organizations__organization_id__settings_agent_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["organization-settings"],"summary":"Update Agent Settings","description":"Update agent settings for an organization.\n\nOnly updates provided fields, preserves others. Requires admin or owner role.\n\nOptimistic concurrency: build an ``If-Match`` ETag from the ``revision`` in a\nprior GET's response body (``format_agent_settings_etag`` gives the token\nshape) and pass it here; the write is rejected with ``412 Precondition\nFailed`` (carrying the current snapshot + an ``ETag`` header) if another\nwriter changed the settings in the meantime. A missing or non-canonical\nvalidator is rejected with ``428 Precondition Required``; on lock contention\nthe write returns a retryable ``503``.","operationId":"update_agent_settings_organizations__organization_id__settings_agent_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSettingsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["organization-settings"],"summary":"Reset Agent Settings","description":"Reset agent settings to defaults for an organization.\n\nRequires admin or owner role. Reset is a mutation of the same resource as\nthe PUT, so it carries the identical optimistic-concurrency contract: a\ncanonical ``If-Match`` is required (``428`` otherwise), a stale validator is\nrejected with ``412`` plus the current snapshot and ``ETag``, and contention\nreturns a retryable ``503``.\n\nThe defaults are WRITTEN as ``revision + 1`` rather than the row being\ndeleted, so an ancient validator can never become valid again. The response\nhas no body (``204``), but it carries the new ``ETag`` so the client can\nkeep writing without a re-read.","operationId":"reset_agent_settings_organizations__organization_id__settings_agent_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/settings/agent/deny-list":{"get":{"tags":["organization-settings"],"summary":"Get Deny List","description":"Get the command deny list for an organization.\n\nReturns the current deny list (or defaults if not configured), the settings\n``revision`` it belongs to, and the matching ``ETag`` — an editor echoes\nthat token back via ``If-Match`` so its full replacement cannot silently\nerase a concurrent guardrail change.","operationId":"get_deny_list_organizations__organization_id__settings_agent_deny_list_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["organization-settings"],"summary":"Update Deny List","description":"Replace the command deny list for an organization.\n\nRequires admin or owner role. The entire deny list is replaced (not merged),\nso this is exactly the mutation that loses a concurrent editor's guardrail:\na canonical ``If-Match`` from the prior GET is required (``428`` otherwise)\nand a stale one is rejected with ``412`` plus the current snapshot and\n``ETag``. The deny list is a projection of the org's agent settings, so the\nvalidator, the conflict payload and the revision line are the settings ones.","operationId":"update_deny_list_organizations__organization_id__settings_agent_deny_list_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DenyListUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/settings/agent/deny-list/reset":{"post":{"tags":["organization-settings"],"summary":"Reset Deny List","description":"Reset the org-level command deny list to built-in defaults (general patterns).\n\nResets only the org-level deny list (general patterns like rm, chmod, dd).\nProvider-level and cluster-level deny lists are managed via the environment API.\nRequires admin or owner role.\n\nA reset discards every org-authored guardrail, so it carries the same\noptimistic-concurrency contract as the deny-list PUT: canonical ``If-Match``\nrequired (``428``), stale validator rejected with ``412`` plus the current\nsnapshot and ``ETag``, contention returns a retryable ``503``.","operationId":"reset_deny_list_organizations__organization_id__settings_agent_deny_list_reset_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"If-Match","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"If-Match"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DenyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/domains":{"get":{"tags":["domains"],"summary":"List Domains","description":"List all domains (built-in + custom) for an organization.","operationId":"list_domains_organizations__organization_id__domains_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DomainResponse"},"title":"Response List Domains Organizations  Organization Id  Domains Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["domains"],"summary":"Create Domain","description":"Create a custom memory domain for an organization.","operationId":"create_domain_organizations__organization_id__domains_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/domains/metadata":{"get":{"tags":["domains"],"summary":"Get Domain Metadata","description":"Return available orchestration graphs and executor types.","operationId":"get_domain_metadata_organizations__organization_id__domains_metadata_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainMetadataResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/domains/{name}":{"get":{"tags":["domains"],"summary":"Get Domain","description":"Get a single domain by name.","operationId":"get_domain_organizations__organization_id__domains__name__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["domains"],"summary":"Update Domain","description":"Update a custom domain (built-in domains cannot be modified).","operationId":"update_domain_organizations__organization_id__domains__name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["domains"],"summary":"Delete Domain","description":"Delete a custom domain (built-in domains cannot be deleted).\n\nBlocked if any custom profile references this domain as its base_domain.","operationId":"delete_domain_organizations__organization_id__domains__name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/defaults":{"get":{"tags":["profiles"],"summary":"Get Profile Defaults","description":"Return current platform defaults for profile prompt fields.\n\nThe frontend calls this to pre-fill the creation form without baking\ndefaults into the stored profile config (which would prevent future\ndefault evolution).","operationId":"get_profile_defaults_organizations__organization_id__profiles_defaults_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileDefaultsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles":{"get":{"tags":["profiles"],"summary":"List Profiles","description":"List all profiles (built-in + custom) for an organization.","operationId":"list_profiles_organizations__organization_id__profiles_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ProfileResponse"},"title":"Response List Profiles Organizations  Organization Id  Profiles Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["profiles"],"summary":"Create Profile","description":"Create a custom profile for an organization.","operationId":"create_profile_organizations__organization_id__profiles_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{name}":{"get":{"tags":["profiles"],"summary":"Get Profile Endpoint","description":"Get a single profile by name.","operationId":"get_profile_endpoint_organizations__organization_id__profiles__name__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["profiles"],"summary":"Update Profile","description":"Update a custom profile (built-in profiles cannot be modified).\n\nAccepts ``PUT`` and ``PATCH`` on the same handler: the update is already\na partial merge (``model_dump(exclude_unset=True)`` below sends only the\nfields the caller set), so ``PATCH`` is the REST-correct verb and ``PUT``\nis kept for back-compat. Per-section editor saves PATCH only their own\nfields, so concurrent edits to other sections are not clobbered.","operationId":"update_profile_organizations__organization_id__profiles__name__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["profiles"],"summary":"Update Profile","description":"Update a custom profile (built-in profiles cannot be modified).\n\nAccepts ``PUT`` and ``PATCH`` on the same handler: the update is already\na partial merge (``model_dump(exclude_unset=True)`` below sends only the\nfields the caller set), so ``PATCH`` is the REST-correct verb and ``PUT``\nis kept for back-compat. Per-section editor saves PATCH only their own\nfields, so concurrent edits to other sections are not clobbered.","operationId":"update_profile_organizations__organization_id__profiles__name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["profiles"],"summary":"Delete Profile","description":"Delete a custom profile (built-in profiles cannot be deleted).","operationId":"delete_profile_organizations__organization_id__profiles__name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics":{"get":{"tags":["rubrics"],"summary":"List Rubrics","description":"List every rubric persisted for the org.\n\nAdmin-only — rubrics encode ICP/scoring rules customers may\nconsider sensitive.","operationId":"list_rubrics_organizations__organization_id__rubrics_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["rubrics"],"summary":"Create Rubric","description":"Create a new rubric (or overwrite an existing one with the same id).\n\nPer the \"customer edits win\" + \"in-place mutation\" choices, this\nendpoint does NOT 409 on existing — POSTing the same ``rubric_id``\ntwice is well-defined behavior (the second wins). To prevent\naccidental overwrite the UI can read first and confirm.","operationId":"create_rubric_organizations__organization_id__rubrics_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rubric"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}":{"get":{"tags":["rubrics"],"summary":"Get Rubric","description":"Read one rubric by id.\n\nReturns 404 if the row doesn't exist (no auto-seed at the API\nlayer — that only happens during a DR run via ``_load_rubric``).","operationId":"get_rubric_organizations__organization_id__rubrics__rubric_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["rubrics"],"summary":"Replace Rubric","description":"Full replace of an existing rubric (PUT).\n\nReturns:\n    - 422 if the path ``rubric_id`` doesn't match body's ``rubric_id`` —\n      refusing to silently rewrite the path prevents typos that would\n      otherwise create a new row under a different id.\n    - 404 if the rubric doesn't exist — PUT is \"replace existing\", not\n      \"upsert\" (use POST for create-or-replace). M-2 fix: previously\n      this silently created the row, making PUT and POST identical\n      and contradicting the docstring's \"Full replace of an existing\n      rubric\" claim.\n\nRace note (Adversarial-pass-2 M-D): the existence check and the\nwrite are non-atomic. Between the ``get_rubric`` pre-check and the\n``replace_rubric`` write, a concurrent DELETE can land — in which\ncase the PUT will recreate the just-deleted row. Acceptable\ntrade-off vs the prior silent-upsert behavior; clients with strict\n\"must already exist\" needs need to either retry-on-404 after the\nresponse or wait for ``Rubric.version`` CAS support (see\n``rubric_store.py`` module docstring — not yet implemented).","operationId":"replace_rubric_organizations__organization_id__rubrics__rubric_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rubric"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["rubrics"],"summary":"Delete Rubric","description":"Delete a rubric.\n\nAfter delete, the next DR run with ``rubric_id`` auto-seeds from\nthe platform's starter factory (if one is registered for that id).\nThis is the documented \"reset to factory default\" UX.\n\nReturns 204 on success, 404 if the row didn't exist.","operationId":"delete_rubric_organizations__organization_id__rubrics__rubric_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/patterns":{"post":{"tags":["rubrics"],"summary":"Upsert Pattern","description":"Add a new disqualifier pattern (or replace by ``Pattern.name``).\n\nSub-resource POST returns 200 + the full updated rubric (rather\nthan 201) so the UI can re-render the whole rubric without a\nfollow-up GET.","operationId":"upsert_pattern_organizations__organization_id__rubrics__rubric_id__patterns_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pattern"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/patterns/{pattern_name}":{"put":{"tags":["rubrics"],"summary":"Replace Pattern","description":"Replace one pattern by name. Body's ``name`` MUST match the path.\n\nRefusing the rename here keeps the URL stable — to rename a\npattern, the client deletes the old one and POSTs the new one.","operationId":"replace_pattern_organizations__organization_id__rubrics__rubric_id__patterns__pattern_name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"pattern_name","in":"path","required":true,"schema":{"type":"string","title":"Pattern Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pattern"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["rubrics"],"summary":"Delete Pattern","description":"Remove one pattern by name.\n\nReturns the full updated rubric so the UI can re-render after\ndeletion. Idempotent: deleting a pattern that's already gone\nsucceeds silently (the rubric is still returned unchanged) — the\nclient's intent (\"this pattern should not exist\") is satisfied\neither way.","operationId":"delete_pattern_organizations__organization_id__rubrics__rubric_id__patterns__pattern_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"pattern_name","in":"path","required":true,"schema":{"type":"string","title":"Pattern Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/factors":{"post":{"tags":["rubrics"],"summary":"Upsert Factor","description":"Add a new ranking factor (or replace by ``RankingFactor.name``).","operationId":"upsert_factor_organizations__organization_id__rubrics__rubric_id__factors_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RankingFactor"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/factors/{factor_name}":{"put":{"tags":["rubrics"],"summary":"Replace Factor","description":"Replace one factor by name. Body's ``name`` MUST match the path.","operationId":"replace_factor_organizations__organization_id__rubrics__rubric_id__factors__factor_name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"factor_name","in":"path","required":true,"schema":{"type":"string","title":"Factor Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RankingFactor"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["rubrics"],"summary":"Delete Factor","description":"Remove one factor by name (idempotent on missing).","operationId":"delete_factor_organizations__organization_id__rubrics__rubric_id__factors__factor_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"factor_name","in":"path","required":true,"schema":{"type":"string","title":"Factor Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/disqualifiers":{"patch":{"tags":["rubrics"],"summary":"Patch Disqualifiers Metadata","description":"Update top-level ``Disqualifiers`` metadata.\n\nOnly updates fields that the body sets non-``None``; the patterns\nlist is untouched. Use the patterns sub-resource to edit individual\nrules.","operationId":"patch_disqualifiers_metadata_organizations__organization_id__rubrics__rubric_id__disqualifiers_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DisqualifiersMetadataPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/scoring":{"patch":{"tags":["rubrics"],"summary":"Patch Scoring Metadata","description":"Update top-level ``Scoring`` metadata.\n\nOnly updates fields that the body sets non-``None``; the factors\nlist is untouched.","operationId":"patch_scoring_metadata_organizations__organization_id__rubrics__rubric_id__scoring_patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ScoringMetadataPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/output":{"put":{"tags":["rubrics"],"summary":"Replace Output","description":"Full replace of the ``Output`` sub-pack (template + metadata).\n\nOutput has no nested sub-resources, so a full PUT is the right\ngranularity.","operationId":"replace_output_organizations__organization_id__rubrics__rubric_id__output_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Output"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/test":{"post":{"tags":["rubrics"],"summary":"Start Rubric Test","description":"Run authored scenarios through this rubric and grade the outcomes.\n\nEach scenario is one full evaluation run on the normal metered run\npath, so the batch size is capped. Execution is asynchronous; poll\nthe returned test via ``GET .../test/{test_id}``.","operationId":"start_rubric_test_organizations__organization_id__rubrics__rubric_id__test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricTestRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricTestStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/replay":{"post":{"tags":["rubrics"],"summary":"Replay Rubric Cases","description":"Re-evaluate captured real cases against the current rubric (item 4b).\n\nSamples captured run inputs by outcome diversity and re-runs them as\nscenarios expecting the ORIGINAL outcome, so a failed final_status\ncheck means the edited rubric changed the verdict for that case.\nEach sampled case is a full evaluation run; the sample size is\ndeliberately small. Requires opt-in input capture\n(``dr_input_capture_enabled`` in agent settings) with accumulated runs.","operationId":"replay_rubric_cases_organizations__organization_id__rubrics__rubric_id__replay_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ReplayRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RubricTestStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/test/{test_id}":{"get":{"tags":["rubrics"],"summary":"Get Rubric Test","description":"Read one test run's status and (when done) graded results.\n\nA run that stopped reporting (replica restart mid-run) is surfaced\nas ``lost`` once it exceeds twice the per-scenario timeout, so\nclients never poll a zombie forever.","operationId":"get_rubric_test_organizations__organization_id__rubrics__rubric_id__test__test_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"test_id","in":"path","required":true,"schema":{"type":"string","title":"Test Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Rubric Test Organizations  Organization Id  Rubrics  Rubric Id  Test  Test Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/drafts":{"get":{"tags":["rubrics"],"summary":"List Rubric Drafts","description":"List staged induction drafts (admin).\n\nDrafts exist only for the playbook-gate rubric today; the listing\nfilters by the path's rubric_id so the route stays honest if that\never widens.","operationId":"list_rubric_drafts_organizations__organization_id__rubrics__rubric_id__drafts_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"include_resolved","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Resolved"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DraftListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/drafts/{draft_key}":{"get":{"tags":["rubrics"],"summary":"Get Rubric Draft","description":"One staged draft with its full patch (admin).","operationId":"get_rubric_draft_organizations__organization_id__rubrics__rubric_id__drafts__draft_key__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"draft_key","in":"path","required":true,"schema":{"type":"string","title":"Draft Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DraftDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/drafts/induce":{"post":{"tags":["rubrics"],"summary":"Induce Rubric Draft","description":"Run induction and stage a draft (admin; metered as Rubric induction).\n\nNever touches the active rubric. 409 for any rubric other than the\nplaybook gate: the harvest source is gate adjudications, so inducing\n\"for\" another rubric would silently produce gate content.","operationId":"induce_rubric_draft_organizations__organization_id__rubrics__rubric_id__drafts_induce_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/_DraftInduceRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DraftInduceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/drafts/{draft_key}/apply":{"post":{"tags":["rubrics"],"summary":"Apply Rubric Draft","description":"Promote SELECTED names from a staged draft into the active rubric.\n\nThe commit contract: names must reference the persisted draft;\n404 unknown draft, 409 already resolved, 422 unknown names or an\nempty selection.","operationId":"apply_rubric_draft_organizations__organization_id__rubrics__rubric_id__drafts__draft_key__apply_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"draft_key","in":"path","required":true,"schema":{"type":"string","title":"Draft Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DraftApplyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_DraftApplyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/rubrics/{rubric_id}/drafts/{draft_key}/dismiss":{"post":{"tags":["rubrics"],"summary":"Dismiss Rubric Draft","description":"Retire a staged draft without applying it (admin).\n\n404 unknown draft, 409 already resolved.","operationId":"dismiss_rubric_draft_organizations__organization_id__rubrics__rubric_id__drafts__draft_key__dismiss_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"rubric_id","in":"path","required":true,"schema":{"type":"string","title":"Rubric Id"}},{"name":"draft_key","in":"path","required":true,"schema":{"type":"string","title":"Draft Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Dismiss Rubric Draft Organizations  Organization Id  Rubrics  Rubric Id  Drafts  Draft Key  Dismiss Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks":{"get":{"tags":["playbooks"],"summary":"List Playbooks","description":"List every learned/authored playbook for this (org, profile).","operationId":"list_playbooks_organizations__organization_id__profiles__profile_name__playbooks_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["playbooks"],"summary":"Create Playbook","description":"Hand-author a playbook.\n\nWritten ``created_by=\"admin\"`` so the autonomous lifecycle loop\nwill NEVER auto-stale/archive it (the Hermes bundled-skill analog).\nRouted through ``process_and_store_memory`` so it gets the ``_amem``\nenvelope + embedding and is therefore injectable like any learned\nplaybook.","operationId":"create_playbook_organizations__organization_id__profiles__profile_name__playbooks_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_CreatePlaybook"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks/{slug}":{"get":{"tags":["playbooks"],"summary":"Get Playbook","description":"Fetch a single playbook by slug.","operationId":"get_playbook_organizations__organization_id__profiles__profile_name__playbooks__slug__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["playbooks"],"summary":"Archive Playbook","description":"Soft-delete a playbook by archiving it (recoverable).\n\nNever a hard delete — the row persists and ``restore`` brings it\nback. An archived row is excluded from injection (the resolver\nonly surfaces ``active`` rows). B2: archiving a row the gate had\nescalated (``gate_status == \"escalated_admin\"``) is an admin\nrejection — it resolves the escalation (``→ \"rejected_admin\"``) so\nthe row leaves the ``needs_review`` tally. Non-escalated archives\nkeep their gate audit untouched.","operationId":"archive_playbook_organizations__organization_id__profiles__profile_name__playbooks__slug__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks/{slug}/pin":{"post":{"tags":["playbooks"],"summary":"Pin Playbook","description":"Pin a playbook — exempt it from the loop's auto stale/archive.","operationId":"pin_playbook_organizations__organization_id__profiles__profile_name__playbooks__slug__pin_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks/{slug}/unpin":{"post":{"tags":["playbooks"],"summary":"Unpin Playbook","description":"Unpin a playbook — re-subject it to the lifecycle loop.","operationId":"unpin_playbook_organizations__organization_id__profiles__profile_name__playbooks__slug__unpin_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks/{slug}/restore":{"post":{"tags":["playbooks"],"summary":"Restore Playbook","description":"Restore an ARCHIVED playbook back to ``active`` (recoverability).\n\nRejects non-``archived`` rows with 409: ``restore`` un-archives; it\nis NOT an approve. Promoting a ``proposed`` playbook is ``approve``\n— keeping the two verbs disjoint removes the overload ``restore``\npreviously carried (a ``proposed`` row could be silently promoted\nthrough it).\n\nFinding-2: a proposed escalation the admin ignores is GC-archived\nafter ``_PLAYBOOK_PROPOSED_GC_DAYS`` with ``gate_status`` still\n``\"escalated_admin\"``. Restoring such a row IS an implicit approve,\nso it routes through ``_apply_admin_lifecycle`` (not bare\n``_set_fields``): the escalation is resolved (``→ \"approved_admin\"``)\nso the restored row does not go live while still flagged for\nreview. A normal archived row (non-escalated ``gate_status``) is\nuntouched by the surgical re-stamp — identical to the prior\nbehavior.","operationId":"restore_playbook_organizations__organization_id__profiles__profile_name__playbooks__slug__restore_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks/{slug}/approve":{"post":{"tags":["playbooks"],"summary":"Approve Playbook","description":"Approve a ``proposed`` playbook — the human-review safety net.\n\nB1: the dedicated promote verb the escalation flow needs. The gate\nescalates a low-confidence proposal as ``gate_status =\n\"escalated_admin\"`` and leaves it ``proposed`` (NOT injected — the\nresolver serves only ``active``). This promotes it to ``active``\nand, via ``_apply_admin_lifecycle``, resolves the escalation\n(``→ \"approved_admin\"``) so it leaves ``needs_review`` (B2).\n\nRejects non-``proposed`` rows with 409 so ``approve`` cannot itself\nbecome an overloaded verb (the failure mode that motivated splitting\nit from ``restore``). A ``proposed`` row the gate merely held\n(not escalated) is still promotable here; its gate audit is left\nuntouched (only an ``escalated_admin`` status is re-stamped).","operationId":"approve_playbook_organizations__organization_id__profiles__profile_name__playbooks__slug__approve_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/playbooks/{slug}/attachments/{att_name}":{"put":{"tags":["playbooks"],"summary":"Upsert Attachment","description":"Add or replace a playbook attachment (reference/template/script).\n\nLazy by design — never inlined into the injected prompt; the\nformatter surfaces only the name. ``index=False``: attachments are\nnot embedded (see ``Playbook.__embed_fields__``).\n\nL6 — concurrency: this is an unconditional read-modify-write of the\nwhole row (no compare-and-set in the langgraph store), the same\naccepted race as ``_set_fields`` but with a LARGER blast radius —\nit rewrites the ``attachments`` content array, so two concurrent\nattachment edits (or a racing pin/lifecycle write) can silently\ndrop one side's change. Accepted, not locked: attachments are\nadmin-managed and recoverable (re-PUT), and a lock here would not\ncompose with the other RMW seams on the same key.","operationId":"upsert_attachment_organizations__organization_id__profiles__profile_name__playbooks__slug__attachments__att_name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"att_name","in":"path","required":true,"schema":{"type":"string","title":"Att Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_Attachment"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["playbooks"],"summary":"Delete Attachment","description":"Remove a playbook attachment by name.\n\n404 if the playbook or the named attachment is absent.\n\nL6 — concurrency: same accepted unconditional row read-modify-write\nas ``upsert_attachment`` / ``_set_fields`` (no store CAS), with the\nlarger attachment-array blast radius. Accepted, not locked —\nadmin-managed + recoverable.","operationId":"delete_attachment_organizations__organization_id__profiles__profile_name__playbooks__slug__attachments__att_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}},{"name":"att_name","in":"path","required":true,"schema":{"type":"string","title":"Att Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PlaybookResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/reflect-now":{"post":{"tags":["playbooks"],"summary":"Reflect Now","description":"Force a reflection pass now, bypassing the drift gate.\n\nBypasses cold-start / threshold / debounce but NOT the scope guard\n(custom HD only) nor the ≥3-citation guard — it's a manual \"look\nnow\", not a way to fabricate playbooks. Runs inline and is wholly\nfailure-isolated inside ``maybe_reflect_on_profile``.","operationId":"reflect_now_organizations__organization_id__profiles__profile_name__reflect_now_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ReflectNowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/reflections":{"get":{"tags":["playbooks"],"summary":"List Reflections","description":"Audit ledger: what the autonomous loop did, newest first.\n\nScoped to this profile. The recoverable analog of Hermes' per-run\ncurator report (design §7.2).","operationId":"list_reflections_organizations__organization_id__profiles__profile_name__reflections_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ReflectionAuditList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/reflections/{run_id}":{"get":{"tags":["playbooks"],"summary":"Get Reflection","description":"Fetch one reflection-run audit record by id.","operationId":"get_reflection_organizations__organization_id__profiles__profile_name__reflections__run_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_ReflectionAudit"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/profiles/{profile_name}/reflections/{run_id}/revert":{"post":{"tags":["playbooks"],"summary":"Revert Reflection","description":"Batch-revert a reflection run (recoverable).\n\nArchives every playbook it touched; admin/pinned rows are skipped.\nThe recoverable analog of Hermes' `curator rollback` (design §7.2).","operationId":"revert_reflection_organizations__organization_id__profiles__profile_name__reflections__run_id__revert_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"path","required":true,"schema":{"type":"string","title":"Profile Name"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_RevertResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/playbooks":{"get":{"tags":["playbooks"],"summary":"List Org Playbooks","description":"Org-wide playbook lifecycle + gate-decision visibility.\n\nAdmin-gated, consistent with the per-profile router. The optional\n``profile_name`` / ``lifecycle_state`` / ``gate_status`` filters\nnarrow the returned list, but ``summary`` is ALWAYS computed over\nthe full org set — so ``needs_review`` is a truthful escalation\ncount, not a side effect of the caller's filter.","operationId":"list_org_playbooks_organizations__organization_id__playbooks_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"profile_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Name"}},{"name":"lifecycle_state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lifecycle State"}},{"name":"gate_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gate Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_OrgPlaybookListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/webhook-sources":{"get":{"tags":["webhook-sources"],"summary":"List Webhook Sources","description":"List all webhook sources for an organization.","operationId":"list_webhook_sources_organizations__organization_id__webhook_sources_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WebhookSourceResponse"},"title":"Response List Webhook Sources Organizations  Organization Id  Webhook Sources Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["webhook-sources"],"summary":"Create Webhook Source","description":"Create a webhook source (upserts if provider already exists).","operationId":"create_webhook_source_organizations__organization_id__webhook_sources_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSourceCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSourceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/webhook-sources/{provider}":{"get":{"tags":["webhook-sources"],"summary":"Get Webhook Source","description":"Get a single webhook source by provider.","operationId":"get_webhook_source_organizations__organization_id__webhook_sources__provider__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSourceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["webhook-sources"],"summary":"Update Webhook Source","description":"Update a webhook source.","operationId":"update_webhook_source_organizations__organization_id__webhook_sources__provider__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSourceUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSourceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["webhook-sources"],"summary":"Delete Webhook Source","description":"Delete a webhook source.","operationId":"delete_webhook_source_organizations__organization_id__webhook_sources__provider__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities":{"get":{"tags":["channel-identities"],"summary":"List Channel Identities","description":"List all linked channel identities for an organization.","operationId":"list_channel_identities_organizations__organization_id__channel_identities_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelIdentityResponse"},"title":"Response List Channel Identities Organizations  Organization Id  Channel Identities Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["channel-identities"],"summary":"Create Channel Identity","description":"Link a channel sender to a PlatformPilot user.\n\nLinking a sender to somebody else's user_id requires admin/owner, and so\ndoes taking over a sender another user already holds; members can only bind\nan unclaimed sender to their own account.","operationId":"create_channel_identity_organizations__organization_id__channel_identities_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/by-user/{user_id}":{"get":{"tags":["channel-identities"],"summary":"List User Channel Identities","description":"List all channel identities linked to a specific user.","operationId":"list_user_channel_identities_organizations__organization_id__channel_identities_by_user__user_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelIdentityResponse"},"title":"Response List User Channel Identities Organizations  Organization Id  Channel Identities By User  User Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/{channel_id}/{sender_id}":{"get":{"tags":["channel-identities"],"summary":"Get Channel Identity","description":"Get a specific channel identity link.","operationId":"get_channel_identity_organizations__organization_id__channel_identities__channel_id___sender_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"sender_id","in":"path","required":true,"schema":{"type":"string","title":"Sender Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["channel-identities"],"summary":"Delete Channel Identity","description":"Remove a channel identity link.\n\nThe target is whoever the link currently points at, so removing somebody\nelse's link requires admin/owner; members can unlink their own.","operationId":"delete_channel_identity_organizations__organization_id__channel_identities__channel_id___sender_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"sender_id","in":"path","required":true,"schema":{"type":"string","title":"Sender Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/pending":{"get":{"tags":["channel-identities"],"summary":"List Pending Identities","description":"List all unlinked channel senders waiting for admin review.","operationId":"list_pending_identities_organizations__organization_id__channel_identities_pending_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PendingIdentityResponse"},"title":"Response List Pending Identities Organizations  Organization Id  Channel Identities Pending Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/pending/{channel_id}/{sender_id}/link":{"post":{"tags":["channel-identities"],"summary":"Link Pending Identity","description":"Link a pending sender to a PlatformPilot user (clears pending).\n\nSame rule as the direct create route: naming somebody else's user_id or a\nsender another user already holds requires admin/owner. The path sender is\nfree text and is never checked against the pending queue, so this route\nreaches exactly the same write as the create route.","operationId":"link_pending_identity_organizations__organization_id__channel_identities_pending__channel_id___sender_id__link_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"sender_id","in":"path","required":true,"schema":{"type":"string","title":"Sender Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/pending/{channel_id}/{sender_id}":{"delete":{"tags":["channel-identities"],"summary":"Dismiss Pending Identity","description":"Dismiss a pending sender (remove from queue without linking).","operationId":"dismiss_pending_identity_organizations__organization_id__channel_identities_pending__channel_id___sender_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"sender_id","in":"path","required":true,"schema":{"type":"string","title":"Sender Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/self-link":{"post":{"tags":["channel-identities"],"summary":"Self Link Channel Identity","description":"Link the authenticated user's own channel identity.\n\nThe target is forced to the caller, so the only thing left to authorize is\nthe sender: an unclaimed one needs no admin, taking one off another user\ndoes. Without that check this route is the whole attack, since it is the\nmember-accessible way to point somebody else's sender at your own account.","operationId":"self_link_channel_identity_organizations__organization_id__channel_identities_self_link_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelfLinkRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/oauth/discord/authorize":{"get":{"tags":["channel-identities"],"summary":"Discord Profile Authorize","description":"Generate a Discord OAuth URL for profile identity linking.\n\nUses 'identify' scope only — not installing the bot, just capturing\nthe user's Discord ID.","operationId":"discord_profile_authorize_organizations__organization_id__channel_identities_oauth_discord_authorize_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthAuthorizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/oauth/discord/callback":{"post":{"tags":["channel-identities"],"summary":"Discord Profile Callback","description":"Exchange Discord OAuth code and link the user's Discord identity.\n\nThe sender here is whatever Discord says the authorizing account is, not\nsomething the caller can name, so this route is not reachable for the\nsender-takeover attack. It still creates a binding, so it runs the same\ncheck rather than carrying an exception nobody can see from the call site:\na Discord account already linked to a different user moves only by\nadmin/owner.","operationId":"discord_profile_callback_organizations__organization_id__channel_identities_oauth_discord_callback_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthCallbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/invite":{"post":{"tags":["channel-identities"],"summary":"Create Invite","description":"Generate a single-use invite link for channel identity linking.\n\nNaming somebody else as the target stays member-accessible: they still have\nto authenticate to claim it, so it hands them nothing they did not already\nhave. Naming a sender another user holds does not, because a claim ends in\nthe same overwrite as the create route and this is where an attacker would\ngo once that route is guarded.","operationId":"create_invite_organizations__organization_id__channel_identities_invite_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/pending/{channel_id}/{sender_id}/invite":{"post":{"tags":["channel-identities"],"summary":"Create Invite From Pending","description":"Generate an invite link for a pending sender (convenience shortcut).\n\nSame rule as ``/invite``: the path sender is free text and is never checked\nagainst the pending queue, so it can name a sender that is not pending at\nall but linked to somebody else.","operationId":"create_invite_from_pending_organizations__organization_id__channel_identities_pending__channel_id___sender_id__invite_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"sender_id","in":"path","required":true,"schema":{"type":"string","title":"Sender Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channel-identities/claim":{"post":{"tags":["channel-identities"],"summary":"Claim Invite","description":"Claim an invite token to link a channel sender to the authenticated user.\n\nThe claim is the write, so the sender check lives here too and not only at\nmint time: a member can mint an invite for a sender that is unclaimed right\nnow and claim it after its real owner appears. An invite may still hand\nover a binding that predates it, which is how an admin moves a sender to a\nnew owner without unlinking it first.","operationId":"claim_invite_organizations__organization_id__channel_identities_claim_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelIdentityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/jobs":{"get":{"tags":["jobs"],"summary":"List Jobs","description":"List all scheduled jobs for an organization.","operationId":"list_jobs_organizations__organization_id__jobs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":500,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/JobResponse"},"title":"Response List Jobs Organizations  Organization Id  Jobs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["jobs"],"summary":"Create Job","description":"Create a new scheduled job.","operationId":"create_job_organizations__organization_id__jobs_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/jobs/{cron_id}":{"get":{"tags":["jobs"],"summary":"Get Job","description":"Get a single scheduled job by ID.","operationId":"get_job_organizations__organization_id__jobs__cron_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"cron_id","in":"path","required":true,"schema":{"type":"string","title":"Cron Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["jobs"],"summary":"Update Job","description":"Update a scheduled job's schedule, task, or enabled state.","operationId":"update_job_organizations__organization_id__jobs__cron_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"cron_id","in":"path","required":true,"schema":{"type":"string","title":"Cron Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["jobs"],"summary":"Delete Job","description":"Delete a scheduled job.","operationId":"delete_job_organizations__organization_id__jobs__cron_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"cron_id","in":"path","required":true,"schema":{"type":"string","title":"Cron Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/metrics/escalations/stats":{"get":{"tags":["escalations"],"summary":"Get Escalation Stats","description":"Aggregate escalation pair stats.","operationId":"get_escalation_stats_organizations__organization_id__metrics_escalations_stats_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date to filter from (default 30d ago)","title":"Since"},"description":"ISO date to filter from (default 30d ago)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscalationStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/metrics/escalations/events":{"get":{"tags":["escalations"],"summary":"List Escalation Events","description":"List raw escalation events.","operationId":"list_escalation_events_organizations__organization_id__metrics_escalations_events_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":100,"title":"Limit"}},{"name":"from_profile","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Profile"}},{"name":"to_profile","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Profile"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscalationEventsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/metrics/escalations/recommendations":{"get":{"tags":["escalations"],"summary":"Get Escalation Recommendations","description":"Advisory webhook source profile-pin suggestions based on escalation patterns.","operationId":"get_escalation_recommendations_organizations__organization_id__metrics_escalations_recommendations_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"min_threshold","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":3,"title":"Min Threshold"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscalationRecommendationsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/metrics/profiles":{"get":{"tags":["profile-metrics"],"summary":"Get Profile Metrics","description":"Return per-investigation profile metrics for an organization.\n\nReads from the ``(\"profile_metrics\", org_id)`` namespace in the\nruntime store (Go Core gRPC-backed in LangGraph Cloud v0.7+).","operationId":"get_profile_metrics_organizations__organization_id__metrics_profiles_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileMetricsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/autonomy":{"get":{"tags":["autonomy"],"summary":"Get Autonomy","description":"Get autonomy settings and earned-capability progress.\n\nMember-level read. Capability read failures degrade to 0 (the UI\nshows a locked slider rather than a 500) with ``capability_truncated``\nset so the degradation is visible.","operationId":"get_autonomy_organizations__organization_id__autonomy_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["autonomy"],"summary":"Update Autonomy","description":"Update the org's autonomy level (admin/owner only).\n\nThe requested level is clamped to the earned capability rung. A\ncapability read failure is a 503, NOT a clamp-to-0: a transient\nstore blip must never write down the admin's persisted level.","operationId":"update_autonomy_organizations__organization_id__autonomy_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutonomyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities":{"get":{"tags":["entities"],"summary":"List Entities","description":"Return the entity registry + curation queue for the org.","operationId":"list_entities_organizations__organization_id__memory_entities_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitiesOverviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/predicates":{"get":{"tags":["entities"],"summary":"List Predicates","description":"Return the org's predicate vocabulary, aliases, and open proposals.\n\nRead-only curation view for the ontology ladder: vocabulary with row\ncounts (fragmentation watch), active alias mappings, and pending\nreconcile proposals awaiting a ruling.","operationId":"list_predicates_organizations__organization_id__memory_entities_predicates_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Predicates Organizations  Organization Id  Memory Entities Predicates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/predicates/{predicate}/edges":{"get":{"tags":["entities"],"summary":"List Predicate Edges","description":"Return the org's edges for one predicate: the predicate-first query.\n\nThe entity-less relational surface (\"list everything anyone\n`invested in`\"): an equality scan over rel rows served by the\nexisting GIN containment index, never embeddings. The predicate\nresolves through the alias layer, and a miss falls back to a single\nunambiguous vocabulary match (``matched_predicate`` reports what was\nactually queried). Read-only, so not admin-gated.","operationId":"list_predicate_edges_organizations__organization_id__memory_entities_predicates__predicate__edges_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"predicate","in":"path","required":true,"schema":{"type":"string","title":"Predicate"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Predicate Edges Organizations  Organization Id  Memory Entities Predicates  Predicate  Edges Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/predicates/aliases":{"post":{"tags":["entities"],"summary":"Create Predicate Alias","description":"Map a variant predicate to a canonical one (admin).\n\nRedirect semantics, never renames: chains collapse, origins\nre-point, and any matching pending reconcile proposal is marked\nmerged so it never re-mints. Application at edge-write time is\nadditionally gated by ``ENTITY_PREDICATE_ALIASES_ENABLED``.","operationId":"create_predicate_alias_organizations__organization_id__memory_entities_predicates_aliases_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredicateAliasIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Predicate Alias Organizations  Organization Id  Memory Entities Predicates Aliases Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/predicates/proposals/reject":{"post":{"tags":["entities"],"summary":"Reject Predicate Proposal","description":"Rule a reconcile proposal not-the-same (admin); suppresses re-mint.","operationId":"reject_predicate_proposal_organizations__organization_id__memory_entities_predicates_proposals_reject_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PredicateProposalRef"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reject Predicate Proposal Organizations  Organization Id  Memory Entities Predicates Proposals Reject Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/graph":{"get":{"tags":["entities"],"summary":"Get Entity Graph","description":"Bounded org-wide panoramic view: nodes + edges + structure stats.\n\nThe Phase C bulk surface for the knowledge-graph view: one call\nreturns active entities (hubs first when the cap bites), the edges\nbetween them (closed edges included, carrying their interval so the\nUI can style history), per-node degree, connected components, and\nthe top hubs. Analytics stay deliberately minimal: degree and\ncomponents are the primitives the panoramic view needs; anything\nfancier (centrality, paths, communities) waits for a product\nquestion that reduces to it. Read-only, so not admin-gated.\n\nDegree contract: ``degree_in`` / ``degree_out`` report ORG-WIDE\nconnectivity (over all scanned edges between active entities), NOT\nthe rendered subgraph, so a capped view still shows which nodes are\nreal hubs; ``edges_dropped_offview`` quantifies the mismatch a\nrenderer will see. ``stats.scan_truncated`` flags when the\nunderlying scans hit their bound and ranking/counts cover a window\nrather than the whole org.","operationId":"get_entity_graph_organizations__organization_id__memory_entities_graph_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":150,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Entity Graph Organizations  Organization Id  Memory Entities Graph Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/me":{"get":{"tags":["entities"],"summary":"Get Caller Brain","description":"Return what the Brain holds about the CALLER (welcome-screen greeting).\n\nDeclared BEFORE ``/{entity_id}``: that route is a catch-all on this\nprefix and would otherwise swallow ``/me`` and 422 on the key check.\n\nResolves the caller through the same exact-surface, person-only rule the\nchat caller card uses, so the greeting can never claim to know someone\nthe agent itself would not. Every miss (feature flag off, no entity, no\nlinked memories, store trouble) is an EMPTY body, never an error: the UI\nfalls back to an unpersonalized greeting, and a welcome screen must not\nbe able to fail.\n\nTask cards are composed FRESH per request (not from the cached\nsnapshot): a handoff minted a minute ago must show now, and a completed\ntask must leave now — the ledger moves at conversation cadence, not the\nsnapshot's. They outrank the snapshot's suggestions in the merged list\n(an incoming ask beats the caller's own trail).","operationId":"get_caller_brain_organizations__organization_id__memory_entities_me_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerBrainResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}":{"get":{"tags":["entities"],"summary":"Get Entity Detail","description":"Return one entity's registry row, fact sheet, and member sample.\n\nRead-only, so triple-gated but NOT admin-gated (unlike the curation\nmutations). A merged loser key forward-resolves to its survivor and\nreports ``redirected`` so the UI can explain the jump.","operationId":"get_entity_detail_organizations__organization_id__memory_entities__entity_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/merge":{"post":{"tags":["entities"],"summary":"Merge Entity","description":"Merge ``entity_id`` with ``body.other_id`` (admin; revisable).","operationId":"merge_entity_organizations__organization_id__memory_entities__entity_id__merge_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Merge Entity Organizations  Organization Id  Memory Entities  Entity Id  Merge Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/relations":{"delete":{"tags":["entities"],"summary":"Veto Relation","description":"Kill one edge permanently (admin): tombstone + delete.\n\nA bare row delete would resurrect at the subject's next\nre-distillation; the ``rel_veto:`` tombstone is a human ruling the\nwrite path checks first, so the deletion sticks. Requires the edge\n(or an existing veto, for idempotent retries) to exist: a typo must\nnot mint a garbage tombstone.","operationId":"veto_relation_organizations__organization_id__memory_entities__entity_id__relations_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"predicate","in":"query","required":true,"schema":{"type":"string","title":"Predicate"}},{"name":"object_id","in":"query","required":true,"schema":{"type":"string","title":"Object Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Veto Relation Organizations  Organization Id  Memory Entities  Entity Id  Relations Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/facts":{"delete":{"tags":["entities"],"summary":"Veto Fact","description":"Remove one fact's CURRENT value permanently (admin): tombstone + delete.\n\n``rel_veto``'s value-scoped sibling: a bare row delete would\nresurrect the value at the entity's next re-distillation, so the\n``fact_veto:`` tombstone records the removed VALUE and the write\npath skips its re-emission. The address stays open: a genuinely new\nvalue at the same predicate lands normally. This is the \"remove\"\nruling on an unsupported-fact queue item (and works on any fact).","operationId":"veto_fact_organizations__organization_id__memory_entities__entity_id__facts_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"predicate","in":"query","required":true,"schema":{"type":"string","title":"Predicate"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Veto Fact Organizations  Organization Id  Memory Entities  Entity Id  Facts Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/type":{"post":{"tags":["entities"],"summary":"Confirm Entity Type","description":"Confirm or correct one entity's type (item 7, emergent-first).\n\nThe vocabulary stays closed and emergent (no upfront schema\nauthoring): this verb only lets a human snap an entity onto one of\nthe existing types (or back to ``unknown``) and stamps the choice\nas human-confirmed so automatic resolution never silently\nreclassifies it. An off-vocabulary value is a 422, not a new type.","operationId":"confirm_entity_type_organizations__organization_id__memory_entities__entity_id__type_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"entity_type","in":"query","required":true,"schema":{"type":"string","title":"Entity Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Confirm Entity Type Organizations  Organization Id  Memory Entities  Entity Id  Type Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/facts/keep":{"post":{"tags":["entities"],"summary":"Keep Fact","description":"Rule that an unsupported-flagged value stands (admin).\n\nClears the ``unsupported_at`` queue signal and stamps ``kept`` so\nthe grounding backfill neither rescans nor re-stamps the row; the\nruling dissolves automatically when the value changes (a new value\nis a new question).","operationId":"keep_fact_organizations__organization_id__memory_entities__entity_id__facts_keep_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"predicate","in":"query","required":true,"schema":{"type":"string","title":"Predicate"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Keep Fact Organizations  Organization Id  Memory Entities  Entity Id  Facts Keep Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/relations/keep":{"post":{"tags":["entities"],"summary":"Keep Relation","description":"Rule that an evidence-stamped edge stands (admin).\n\nThe edge mirror of ``/facts/keep``: stamps ``kept`` so the evidence\nsweep neither re-stamps nor re-queues the row, and clears a standing\n``ineffective_at`` signal. Never touches the edge's temporal state —\nclosing or vetoing remain separate, explicit actions.","operationId":"keep_relation_organizations__organization_id__memory_entities__entity_id__relations_keep_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"predicate","in":"query","required":true,"schema":{"type":"string","title":"Predicate"}},{"name":"object_id","in":"query","required":true,"schema":{"type":"string","title":"Object Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Keep Relation Organizations  Organization Id  Memory Entities  Entity Id  Relations Keep Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/relations/close":{"post":{"tags":["entities"],"summary":"Close Relation","description":"Close one edge's validity interval (admin): closure rung 3.\n\nDistinct from the veto: closed means the relationship WAS true until\n``valid_to`` (defaulting to now) and the row stays queryable as\nhistory; vetoed means never true / never show. A human closure\nsticks: re-distillation refreshes the row but never reopens it (the\nsame human-beats-machine rule the veto follows). Re-closing updates\nthe interval; latest ruling wins.","operationId":"close_relation_organizations__organization_id__memory_entities__entity_id__relations_close_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}},{"name":"predicate","in":"query","required":true,"schema":{"type":"string","title":"Predicate"}},{"name":"object_id","in":"query","required":true,"schema":{"type":"string","title":"Object Id"}},{"name":"valid_to","in":"query","required":false,"schema":{"type":"string","default":"","title":"Valid To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Close Relation Organizations  Organization Id  Memory Entities  Entity Id  Relations Close Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/{entity_id}/split":{"post":{"tags":["entities"],"summary":"Split Entity","description":"Declare not-same: reverse a merge OR reject a proposal (admin).","operationId":"split_entity_organizations__organization_id__memory_entities__entity_id__split_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PairRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Split Entity Organizations  Organization Id  Memory Entities  Entity Id  Split Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/aliases/{alias_id}/confirm":{"post":{"tags":["entities"],"summary":"Confirm Alias","description":"Promote a pending alias to confirmed (admin curation).","operationId":"confirm_alias_organizations__organization_id__memory_entities_aliases__alias_id__confirm_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"alias_id","in":"path","required":true,"schema":{"type":"string","title":"Alias Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Confirm Alias Organizations  Organization Id  Memory Entities Aliases  Alias Id  Confirm Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/entities/aliases/{alias_id}/reject":{"post":{"tags":["entities"],"summary":"Reject Alias Candidate","description":"Declare that a surface form does NOT mean a candidate (admin).\n\nThe candidate joins the alias's ``rejected`` G-Set: Tier-0 excludes\nit, the Tier-2 applier refuses it, and the surface form re-learns\nthrough the normal escalation path (a future mention mints a fresh\nentity if nothing else matches). This is the alias-level negative\nruling, the counterpart of \"Not the same\" on merge suggestions, and\nit counts toward the earned-autonomy gate's polarity requirement.","operationId":"reject_alias_candidate_organizations__organization_id__memory_entities_aliases__alias_id__reject_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"alias_id","in":"path","required":true,"schema":{"type":"string","title":"Alias Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reject Alias Candidate Organizations  Organization Id  Memory Entities Aliases  Alias Id  Reject Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed":{"post":{"tags":["memory-seed"],"summary":"Start Seed Batch","description":"Import rows through the distiller (async; poll the batch id).\n\nRows land immediately searchable; the deferred evolution pass then\nanalyzes and links each new row once against the complete corpus.\nThe pass's model usage is metered to the organization as\n\"Memory import\".","operationId":"start_seed_batch_organizations__organization_id__memory_seed_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_SeedRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_SeedStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["memory-seed"],"summary":"List Seed Batches","description":"Import history: every batch with status, counts, and metered usage.\n\nPer-row results are stripped (a batch row can carry hundreds of\nentries); fetch one batch by id for those. Newest first.","operationId":"list_seed_batches_organizations__organization_id__memory_seed_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"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":"object","additionalProperties":true,"title":"Response List Seed Batches Organizations  Organization Id  Memory Seed Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/preview":{"post":{"tags":["memory-seed"],"summary":"Preview Seed Batch","description":"Distill raw material into a persisted proposal set (nothing committed).\n\nThe distiller splits the material into self-contained candidate\nmemories, classifies each as a durable fact or a past event, and\nextracts stated dates. Proposals persist server-side under a\n``preview_id``; commit references that id + selected indices, so\nnothing outside this set can be committed. The analysis is metered\nas \"Memory import\" whether or not anything is committed.","operationId":"preview_seed_batch_organizations__organization_id__memory_seed_preview_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PreviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/preview/{preview_id}":{"get":{"tags":["memory-seed"],"summary":"Get Seed Preview Row","description":"Read one persisted preview (proposals + status; survives reload).","operationId":"get_seed_preview_row_organizations__organization_id__memory_seed_preview__preview_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"preview_id","in":"path","required":true,"schema":{"type":"string","title":"Preview Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Seed Preview Row Organizations  Organization Id  Memory Seed Preview  Preview Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/capabilities":{"get":{"tags":["memory-seed"],"summary":"Get Seed Capabilities","description":"Report which import paths this org can use right now.\n\nMember-readable (the chat surface needs it to render \"ask your\nadmin\" for non-admins). Reports stored probe state only — no\nnetwork round-trip; the register step re-verifies for real.","operationId":"get_seed_capabilities_organizations__organization_id__memory_seed_capabilities_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Seed Capabilities Organizations  Organization Id  Memory Seed Capabilities Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/storage/setup":{"post":{"tags":["memory-seed"],"summary":"Setup Import Storage","description":"Run the whole storage-connect flow and return a per-step report.\n\nCreates the bucket when missing, applies the browser-upload CORS\nrule, saves the config, and verifies end to end — everything the\ntenant identity can do itself. Steps a human must finish come back\nwith an exact one-line fix. Safe to re-run any time (idempotent).","operationId":"setup_import_storage_organizations__organization_id__memory_seed_storage_setup_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_StorageSetupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Setup Import Storage Organizations  Organization Id  Memory Seed Storage Setup Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/material":{"post":{"tags":["memory-seed"],"summary":"Request Material Upload","description":"Issue a presigned upload URL into the org's OWN import bucket.\n\nBytes go browser -> bucket directly; PlatformPilot never proxies\nor stores the content. A pending pointer row (TTL-bounded) tracks\nthe material until the client confirms the upload via\n``POST /material/{material_id}/register``.","operationId":"request_material_upload_organizations__organization_id__memory_seed_material_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_MaterialRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Request Material Upload Organizations  Organization Id  Memory Seed Material Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/material/{material_id}/register":{"post":{"tags":["memory-seed"],"summary":"Register Material","description":"Confirm the upload landed and mark the material ready.\n\nServer-side verification via the impersonated tenant identity:\nhead_object proves the object exists and enforces the byte cap (the\nuniversal size gate — presigned length limits are vendor-specific\nbest-effort). Idempotent: re-registering re-verifies.","operationId":"register_material_organizations__organization_id__memory_seed_material__material_id__register_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"material_id","in":"path","required":true,"schema":{"type":"string","title":"Material Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Register Material Organizations  Organization Id  Memory Seed Material  Material Id  Register Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/sources":{"get":{"tags":["memory-seed"],"summary":"List Seed Sources","description":"Import sources: one row per source with its version history.\n\nA source groups every import of the same material (the display\nlabel, folded case/whitespace); versions carry checksum, size,\nfilename, and the batch that recorded them. Newest-imported first.","operationId":"list_seed_sources_organizations__organization_id__memory_seed_sources_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"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 List Seed Sources Organizations  Organization Id  Memory Seed Sources Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/sources/{source_id}":{"get":{"tags":["memory-seed"],"summary":"Get Seed Source Detail","description":"One source row plus a live ``memory_count``.\n\n``memory_count`` is computed with the same two filter passes the\nforget-source deletion uses, so a confirm dialog can show the exact\nblast radius. Kept off the list endpoint deliberately: counting is\nper-source work, and the list would multiply it.","operationId":"get_seed_source_detail_organizations__organization_id__memory_seed_sources__source_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Seed Source Detail Organizations  Organization Id  Memory Seed Sources  Source Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["memory-seed"],"summary":"Forget Seed Source","description":"Forget a source: delete every memory derived from it (async).\n\nThe erasure-by-source lever (data-subject requests, poisoned or\nobsolete imports): removes all rows stamped with this source id\nplus pre-registry rows carrying its label, then the registry entry\nitself. Agent-earned memories are untouched. Deliberately REST-only,\nnever a chat action, same reasoning as BYO delete.","operationId":"forget_seed_source_organizations__organization_id__memory_seed_sources__source_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Forget Seed Source Organizations  Organization Id  Memory Seed Sources  Source Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/seed/{batch_id}":{"get":{"tags":["memory-seed"],"summary":"Get Seed Batch","description":"Read one batch's status, per-row results, and metered usage.","operationId":"get_seed_batch_organizations__organization_id__memory_seed__batch_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Seed Batch Organizations  Organization Id  Memory Seed  Batch Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["memory-seed"],"summary":"Delete Seed Batch","description":"Delete every memory row this batch imported (async).\n\nTargets only rows stamped with this batch id; agent-earned memories\nare untouched. Deletion goes through the canonical path so links on\nneighboring memories are cleaned up.","operationId":"delete_seed_batch_organizations__organization_id__memory_seed__batch_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","title":"Batch Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Seed Batch Organizations  Organization Id  Memory Seed  Batch Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/action-policies":{"get":{"tags":["action-policies"],"summary":"List Action Policies","description":"List every guardrail policy for the org.","operationId":"list_action_policies_organizations__organization_id__action_policies_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PolicyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/action-policies/evidence":{"get":{"tags":["action-policies"],"summary":"Action Policy Evidence","description":"Summarize per-graduation-key exposure plus per-policy re-earning.\n\nExposure, not agreement: shadow mode produces no human\ncounterfactual, so these fields say how much real traffic a policy\nhas seen and how varied it was, never whether anyone agreed with it.\nCallers must not render these as approval or correctness rates.\n\nTWO SOURCES, deliberately distinguished. ``keys`` is a summary of the\naction log, which is a capped sample by construction. ``policies`` is\nthe per-policy counter rows, which are exact and are what readiness\nactually fires on. Returning only the former would leave the console\nshowing one set of numbers while the Brain proposed on another.","operationId":"action_policy_evidence_organizations__organization_id__action_policies_evidence_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":1,"default":500,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Action Policy Evidence Organizations  Organization Id  Action Policies Evidence Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/action-policies/{policy_id}":{"put":{"tags":["action-policies"],"summary":"Upsert Action Policy","description":"Create or replace one policy.\n\nValidated through the same ``ActionPolicy`` model the interceptor\nenforces, so a row that stores is a row that matches.","operationId":"upsert_action_policy_organizations__organization_id__action_policies__policy_id__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/_PolicyBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Upsert Action Policy Organizations  Organization Id  Action Policies  Policy Id  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["action-policies"],"summary":"Delete Action Policy","description":"Delete one policy (404 if absent).","operationId":"delete_action_policy_organizations__organization_id__action_policies__policy_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/action-policies/{policy_id}/readiness/dismiss":{"post":{"tags":["action-policies"],"summary":"Dismiss Policy Readiness","description":"Mark ONE readiness generation reviewed without promoting.\n\n\"Reviewed, declining for now.\" Without this, an admin who looks at the\nevidence and decides against enforcement has no way to say so, and the\nproposal re-surfaces at every dream.\n\nDeliberately does not touch ``enforce``: dismissing is not a verdict on\nthe policy, and promotion stays a separate deliberate action.\n\nStatus mapping: 404 when there is no such policy evidence, 409 when the\nwindow is already closed or the caller named a generation that is no\nlonger current (a card composed before a profile sweep). A repeat\ndismissal of the same generation is idempotent, not an error, and does\nnot re-emit the analytics event.","operationId":"dismiss_policy_readiness_organizations__organization_id__action_policies__policy_id__readiness_dismiss_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"policy_id","in":"path","required":true,"schema":{"type":"string","title":"Policy Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/_DismissBody"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Dismiss Policy Readiness Organizations  Organization Id  Action Policies  Policy Id  Readiness Dismiss Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/action-log":{"get":{"tags":["action-policies"],"summary":"List Action Log","description":"Most recent action/proposal log rows (newest first).","operationId":"list_action_log_organizations__organization_id__action_log_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"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 List Action Log Organizations  Organization Id  Action Log Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/tasks":{"get":{"tags":["tasks"],"summary":"List Tasks","description":"List tasks visible to the caller (admins: all org tasks).\n\n``mine_only`` narrows the visible set to tasks FOR the caller (their\nresolved ``assignee_user_id``, or their email-authorized person\nentity) — the supervision surfaces' filter, so \"your agent finished\"\ncopy is only ever attached to the caller's own work. It narrows even\nthe admin recovery view: \"mine\" means mine for admins too.","operationId":"list_tasks_organizations__organization_id__tasks_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"enum":["open","working","needs_review","done","dropped"],"type":"string"},{"type":"null"}],"title":"Status Filter"}},{"name":"mine_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Mine Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tasks"],"summary":"Create Task","description":"Create a task (scope authorization enforced here).","operationId":"create_task_organizations__organization_id__tasks_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskRecord"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/tasks/{task_id}":{"get":{"tags":["tasks"],"summary":"Get Task","description":"Read one visible task.","operationId":"get_task_organizations__organization_id__tasks__task_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskRecord"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["tasks"],"summary":"Patch Task","description":"Update fields and/or rescope (escalation rules enforced).","operationId":"patch_task_organizations__organization_id__tasks__task_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskPatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskRecord"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tasks"],"summary":"Delete Task","description":"Hard-delete a visible task.","operationId":"delete_task_organizations__organization_id__tasks__task_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/tasks/{task_id}/complete":{"post":{"tags":["tasks"],"summary":"Complete Task","description":"Mark a visible task done.","operationId":"complete_task_organizations__organization_id__tasks__task_id__complete_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskRecord"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/dreaming":{"get":{"tags":["dreaming"],"summary":"Get Dreaming Status","description":"Report dream pressure, the gates, and recent runs (admin only).","operationId":"get_dreaming_status_organizations__organization_id__memory_dreaming_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"reports_limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Reports Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DreamingStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/dreaming/runs":{"post":{"tags":["dreaming"],"summary":"Start Dreaming Run","description":"Start one dreaming pass now (admin only).\n\nPre-checks mirror the gates the graph re-applies, so a refusal is an\nexplanatory error rather than a run that quietly ends at its first\nnode. The trigger-side daily BURST ceiling is deliberately not\nenforced here: that brake exists to damp automatic self-excitation,\nand an admin pressing the button is explicit demand. The graph's\ntotal daily bound still applies and is checked below, so a manual\nrun can never exceed the day's cost envelope.","operationId":"start_dreaming_run_organizations__organization_id__memory_dreaming_runs_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DreamRunRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DreamRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/graph":{"get":{"tags":["memory-graph"],"summary":"Get Memory Graph","description":"Return A-mem memories as a D3.js-compatible force graph.","operationId":"get_memory_graph_organizations__organization_id__memory_graph_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"namespace","in":"query","required":false,"schema":{"enum":["episodes","knowledge","all"],"type":"string","description":"Which namespace(s) to include","default":"all","title":"Namespace"},"description":"Which namespace(s) to include"},{"name":"max_nodes","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":1,"description":"Maximum number of nodes to return","default":500,"title":"Max Nodes"},"description":"Maximum number of nodes to return"},{"name":"time_start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO start bound for temporal filtering","title":"Time Start"},"description":"ISO start bound for temporal filtering"},{"name":"time_end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO end bound for temporal filtering","title":"Time End"},"description":"ISO end bound for temporal filtering"},{"name":"time_bucket","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Month filter, e.g. '2026-03'","title":"Time Bucket"},"description":"Month filter, e.g. '2026-03'"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryGraphResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/ontology":{"get":{"tags":["memory-graph"],"summary":"Get Ontology Overview","description":"Return curated-vocabulary adoption + emergent categories, read-only.\n\nCounts categories over LIVE rows only (superseded/absorbed rows are\nexcluded by :func:`collect_category_labels`, the same population the\ndream reconcile surveys), so this panel and the reconcile agree about\nwhich categories exist. Matching against the curated vocabulary is\ncase-insensitive with the curated spelling winning display — the same\nnormalization rule the §P3 seeding path uses — so a spelling variant\ncan never show up as both a dead curated term and a hot emergent one.\n\nThe vocabulary is read from the canonical ``reference_vocabulary`` row\n(not the per-term ``vocab_term:`` projection, which exists for kNN and\ncan transiently drift during re-seeding). Reads are fail-soft: an\nunseeded org gets ``vocabulary_size=0`` and an emergent-only list.","operationId":"get_ontology_overview_organizations__organization_id__memory_ontology_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OntologyOverviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/{namespace}/{memory_key}":{"get":{"tags":["memory-graph"],"summary":"Get Memory Node Detail","description":"Return the heavy per-memory fields for a single node, on demand.\n\nThe graph projection (:func:`get_memory_graph`) is lean — it omits\n``context``/``keywords``/``tags`` to keep the whole-graph payload small.\nThe detail panel fetches them here for the ONE node the user selected.\n\nSame plan/settings/namespace gates as :func:`delete_memory_node`,\nbut org-member auth: reading a memory the org already shares is not\nthe destructive operation, so only the DELETE is admin-gated.\nA single ``store.aget`` read on the happy\npath; on a miss it follows the ``_amem_redirects`` chain (via\n:func:`resolve_redirects`) to the surviving memory a citation was merged\ninto, echoing the original key back as ``resolved_from``. 404 only when the\nmemory truly doesn't exist (deleted with no redirect, or never existed).","operationId":"get_memory_node_detail_organizations__organization_id__memory__namespace___memory_key__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"namespace","in":"path","required":true,"schema":{"enum":["episodes","knowledge"],"type":"string","title":"Namespace"}},{"name":"memory_key","in":"path","required":true,"schema":{"type":"string","title":"Memory Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryNodeDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["memory-graph"],"summary":"Delete Memory Node","description":"Delete a single memory node from the graph.\n\n**Admin/owner only.** This is a hard, cascading delete of shared org\nmemory: it removes the node and rewrites every neighbor's\n``_amem.links`` / ``_amem.link_strengths``. Memories are org-scoped\nwith no per-user owner, so an org-membership check would let any\nmember destroy the whole org's knowledge one key at a time. Every\nsibling surface over this substrate is admin-gated —\n``resources/entities.py`` requires admin even to *veto* a single\nfact (a soft, reversible suppression), and rubrics / playbooks /\nprofiles / domains / memory_db do the same.\n\nAddressable namespaces are only the user-facing memory ones\n(``episodes``, ``knowledge``); internal namespaces cannot be named\ndirectly. The delete is an ERASURE, though — the canonical\n``manage_memory(action=\"delete\")`` path cascades into the entity\nlayer, so the blast radius can exceed the one node:\n\n  - Strip the deleted key from each neighbor's ``_amem.links`` and\n    ``_amem.link_strengths`` map; sweep redirects pointing AT it.\n  - Remove the memory's entity link rows. An entity whose ONLY live\n    link was this memory is deleted along with its facts and\n    relations; its alias rows are pruned (a current member's email\n    alias is demoted, never deleted); the org-map digest and the\n    task ledger are scrubbed of the erased names.\n\nA cascade that removed durable rows is logged at WARNING by the\ndelete path (counts only, never content). Audit-trail fields\n(``evolution_history``) on neighbors are intentionally preserved —\nthey record what happened at the time even if the referenced memory\nis later deleted.\n\nReturns 204 No Content on success, 404 if the memory doesn't exist.","operationId":"delete_memory_node_organizations__organization_id__memory__namespace___memory_key__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"namespace","in":"path","required":true,"schema":{"enum":["episodes","knowledge"],"type":"string","title":"Namespace"}},{"name":"memory_key","in":"path","required":true,"schema":{"type":"string","title":"Memory Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/{namespace}/{memory_key}/media/{media_id}":{"get":{"tags":["memory-graph"],"summary":"Get Memory Node Media","description":"Serve the bytes of ONE attachment on one memory.\n\nSame four gates as :func:`get_memory_node_detail`, at org-member level:\nreading an attachment on a memory the org already shares is not a\ndestructive operation, so this is deliberately not admin-gated.\n\nDeliberately NOT gated on ``MEMORY_MEDIA_ENABLED``. That switch stops\ncapturing new attachments; it does not un-retain the objects records\nalready reference, and gating reads on it would retroactively blank\nimages in memories that still legitimately point at them.\n\n``media_id`` is the keyed derivation of the entry's checksum\n(:func:`media_url_id`), never an address: the object key comes from the\nmatched entry, and a caller cannot name one. The raw checksum stays off\nthe wire entirely — including out of the ``ETag``, which reaches strictly\nMORE places than the URL does (devtools, HAR exports, the browser cache,\nand every revalidation's ``If-None-Match``).","operationId":"get_memory_node_media_organizations__organization_id__memory__namespace___memory_key__media__media_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"namespace","in":"path","required":true,"schema":{"enum":["episodes","knowledge"],"type":"string","title":"Namespace"}},{"name":"memory_key","in":"path","required":true,"schema":{"type":"string","title":"Memory Key"}},{"name":"media_id","in":"path","required":true,"schema":{"type":"string","title":"Media Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/{namespace}/{memory_key}/media/{media_id}/poster":{"get":{"tags":["memory-graph"],"summary":"Get Memory Node Media Poster","description":"Serve a rendered first-page poster for ONE document attachment.\n\nA document's bytes are deliberately NOT servable (see\n``SERVABLE_MEDIA_MIMES``): a PDF rendered inline from our own origin is\nan active-content surface. A poster is the safe inversion — the\nuntrusted bytes are parsed here, in-process and sandboxed by ceilings,\nand only a flat image ever reaches a browser. It is also the only\nrepresentation of a document that is portable to a chat channel.\n\nSame gates and same tenant bind as the byte route, via the shared\nresolver. Refusals are 404/415, never a placeholder image: a caller\nthat cannot see the memory must not learn that a document exists on it.","operationId":"get_memory_node_media_poster_organizations__organization_id__memory__namespace___memory_key__media__media_id__poster_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"namespace","in":"path","required":true,"schema":{"enum":["episodes","knowledge"],"type":"string","title":"Namespace"}},{"name":"memory_key","in":"path","required":true,"schema":{"type":"string","title":"Memory Key"}},{"name":"media_id","in":"path","required":true,"schema":{"type":"string","title":"Media Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/memory/links/ruling":{"post":{"tags":["memory-graph"],"summary":"Rule On Link","description":"Record a reviewer's verdict on one connection between two memories.\n\n**Admin/owner only**, matching every other write over this shared\nsubstrate (node delete, entity fact veto, rubrics, playbooks). A ruling\nchanges what the agent trusts org-wide, so it is not a per-member action.\n\nThe verdict is stamped on BOTH stored directions of the edge, so the\ncollapsed display tier is the same whichever endpoint a reader visits.\nWrites go through ``atomic_amem_merge`` (row lock), so two reviewers\nruling at once serialize and the last ruling wins, which is the intended\nsemantics for confirm-then-dispute-then-reconfirm.\n\nThis is metadata only. Nothing is deleted, no content changes, and no\nre-embedding happens: a dispute marks a connection as rejected rather\nthan removing it, so the record of the review survives.\n\nReturns 404 when either memory is missing or the two are not linked.","operationId":"rule_on_link_organizations__organization_id__memory_links_ruling_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkRulingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkRulingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/integration/google/test":{"post":{"tags":["google-integration"],"summary":"Test Google Integration","description":"Test Google Cloud service account impersonation.\n\nArgs:\n    request: Request containing the projectID to test\n\nReturns:\n    IntegrationTestResponse with result and message\n\nRaises:\n    HTTPException: If there's an error processing the request","operationId":"test_google_integration_integration_google_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleTestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/organizations/{organization_id}/mcp/servers":{"get":{"tags":["MCP Configuration"],"summary":"List Servers","description":"List all MCP server configurations accessible to the user.","operationId":"list_servers_organizations__organization_id__mcp_servers_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}":{"get":{"tags":["MCP Configuration"],"summary":"Get Server","description":"Get configuration for a specific MCP server.","operationId":"get_server_organizations__organization_id__mcp_servers__server_name__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["MCP Configuration"],"summary":"Create Server","description":"Create a new MCP server configuration. Requires admin or owner role.","operationId":"create_server_organizations__organization_id__mcp_servers__server_name__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPServerConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["MCP Configuration"],"summary":"Update Server","description":"Replace an existing MCP server configuration (full replacement). Requires admin or owner role.","operationId":"update_server_organizations__organization_id__mcp_servers__server_name__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MCPServerConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["MCP Configuration"],"summary":"Delete Server","description":"Delete an MCP server configuration. Requires admin or owner role.","operationId":"delete_server_organizations__organization_id__mcp_servers__server_name__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/active":{"get":{"tags":["MCP Configuration"],"summary":"Get Active Servers","description":"Get list of actually connected/working MCP servers with exclusion info.\n\nReturns active servers and information about any excluded servers,\nincluding the reason for exclusion (e.g., OAuth token missing,\nconnection timeout, unsupported transport).","operationId":"get_active_servers_organizations__organization_id__mcp_active_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveServersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/health":{"get":{"tags":["MCP Configuration"],"summary":"Mcp Health Check","description":"MCP Configuration service health check.","operationId":"mcp_health_check_organizations__organization_id__mcp_health_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/discover":{"post":{"tags":["MCP OAuth"],"summary":"Discover Oauth","description":"Discover OAuth endpoints from MCP server and persist to config.\n\nFetches OAuth metadata from the server's .well-known endpoints and\nautomatically updates the server's OAuth configuration with discovered\nendpoints. This saves users from manually configuring endpoints.","operationId":"discover_oauth_organizations__organization_id__mcp_servers__server_name__oauth_discover_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthDiscoveryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/setup":{"post":{"tags":["MCP OAuth"],"summary":"Setup Oauth","description":"One-click OAuth setup: discover, register, and get authorization URL.\n\nThis endpoint handles the complete OAuth setup flow:\n1. Discovers OAuth endpoints from the MCP server\n2. Registers a client dynamically (if dynamic_registration is enabled)\n3. Returns authorization URL (for authorization_code) or acquires token (for client_credentials)\n\nRequires admin role.","operationId":"setup_oauth_organizations__organization_id__mcp_servers__server_name__oauth_setup_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthSetupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/register":{"post":{"tags":["MCP OAuth"],"summary":"Register Oauth Client","description":"Register OAuth client dynamically (RFC 7591).\n\nRequires admin role. Uses the server's registration_endpoint from OAuth config.","operationId":"register_oauth_client_organizations__organization_id__mcp_servers__server_name__oauth_register_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ClientRegistrationRequest"},{"type":"null"}],"title":"Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientRegistrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/authorize/start":{"get":{"tags":["MCP OAuth"],"summary":"Start Authorization","description":"Start OAuth authorization code flow with PKCE.\n\nReturns an authorization URL for the user to visit.","operationId":"start_authorization_organizations__organization_id__mcp_servers__server_name__oauth_authorize_start_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationStartResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/authorize/callback":{"post":{"tags":["MCP OAuth"],"summary":"Complete Authorization","description":"Complete OAuth authorization code flow.\n\nExchanges the authorization code for tokens.","operationId":"complete_authorization_organizations__organization_id__mcp_servers__server_name__oauth_authorize_callback_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizationCallbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/token":{"post":{"tags":["MCP OAuth"],"summary":"Acquire Token","description":"Acquire OAuth token using client_credentials grant.\n\nNo user interaction required. Uses stored client credentials.","operationId":"acquire_token_organizations__organization_id__mcp_servers__server_name__oauth_token_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/refresh":{"post":{"tags":["MCP OAuth"],"summary":"Refresh Token","description":"Refresh OAuth access token.\n\nUses the stored refresh token to get a new access token.","operationId":"refresh_token_organizations__organization_id__mcp_servers__server_name__oauth_refresh_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/status":{"get":{"tags":["MCP OAuth"],"summary":"Get Token Status","description":"Get OAuth token status for an MCP server.\n\nReturns information about the current token state.","operationId":"get_token_status_organizations__organization_id__mcp_servers__server_name__oauth_status_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/mcp/servers/{server_name}/oauth/tokens":{"delete":{"tags":["MCP OAuth"],"summary":"Revoke Tokens","description":"Revoke and delete OAuth tokens for an MCP server.\n\nRequires admin role. If a revocation_endpoint is configured, attempts to\nrevoke tokens at the authorization server (RFC 7009) before deleting\nlocal copies. Local tokens are always deleted regardless of remote\nrevocation success.","operationId":"revoke_tokens_organizations__organization_id__mcp_servers__server_name__oauth_tokens_delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"server_name","in":"path","required":true,"schema":{"type":"string","title":"Server Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/secrets":{"get":{"tags":["Secrets"],"summary":"List Secrets","description":"List all secrets for an organization (values hidden).\n\nReturns only key names and metadata, not the actual secret values.","operationId":"list_secrets_organizations__organization_id__secrets_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/secrets/{key}":{"post":{"tags":["Secrets"],"summary":"Create Secret","description":"Create a new organization secret.\n\nThe secret value is encrypted at rest. Reference it in MCP configs\nusing ${secrets.KEY_NAME} syntax.","operationId":"create_secret_organizations__organization_id__secrets__key__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Secrets"],"summary":"Update Secret","description":"Create or update (upsert) an organization secret.\n\nPUT is idempotent: it sets the secret regardless of whether it already\nexists, so the first save of a credential does not 404. Use POST when you\nneed create-only semantics (409 on conflict).","operationId":"update_secret_organizations__organization_id__secrets__key__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecretCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Secrets"],"summary":"Delete Secret","description":"Delete an organization secret.\n\nWarning: This will break any MCP configurations that reference this secret.","operationId":"delete_secret_organizations__organization_id__secrets__key__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/secrets/{key}/exists":{"get":{"tags":["Secrets"],"summary":"Check Secret Exists","description":"Check if a secret exists (without revealing its value).","operationId":"check_secret_exists_organizations__organization_id__secrets__key__exists_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/plans":{"get":{"tags":["billing"],"summary":"List Plans","description":"List all available subscription plans.\n\nReturns plan details including pricing and features.\nEnterprise plan shows as contact-sales (no checkout available).","operationId":"list_plans_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PlanResponse"},"type":"array","title":"Response List Plans Billing Plans Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/plans/{plan_id}":{"get":{"tags":["billing"],"summary":"Get Plan","description":"Get details for a specific subscription plan.\n\nArgs:\n    plan_id: Plan identifier (starter, professional, enterprise)\n\nReturns:\n    Plan details","operationId":"get_plan_billing_plans__plan_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"plan_id","in":"path","required":true,"schema":{"$ref":"#/components/schemas/SubscriptionPlan"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/checkout":{"post":{"tags":["billing"],"summary":"Create Checkout","description":"Create a Stripe Checkout session for subscription purchase.\n\nRedirects user to Stripe's hosted checkout page.\nAfter successful payment, user is redirected to success_url.\n\nArgs:\n    request: Checkout creation request with plan_id and optional URLs\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Checkout session with redirect URL\n\nRaises:\n    400: Invalid plan or plan not available for checkout\n    500: Stripe API error","operationId":"create_checkout_billing_checkout_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["billing"],"summary":"List User Checkout Sessions","description":"List checkout sessions for the current user.\n\nArgs:\n    status_filter: Filter by status (pending, completed, expired)\n    limit: Maximum results (default: 10)\n    offset: Pagination offset (default: 0)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    List of checkout sessions","operationId":"list_user_checkout_sessions_billing_checkout_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Filter"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CheckoutSessionResponse"},"title":"Response List User Checkout Sessions Billing Checkout Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/checkout/{session_id}":{"get":{"tags":["billing"],"summary":"Get Checkout Session","description":"Get details of a specific checkout session.\n\nArgs:\n    session_id: Checkout session ID\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Checkout session details\n\nRaises:\n    404: Session not found\n    403: Session belongs to another user","operationId":"get_checkout_session_billing_checkout__session_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/trial":{"post":{"tags":["billing"],"summary":"Start Trial","description":"Start a card-on-file Brain evaluation trial (MCP-only, one month).\n\nOpens a Stripe Checkout redirect so the card is collected up front; the\nsubscription auto-charges at trial end unless the user cancels first. The\ntrial length is read from the anchor price's metadata.trial_period_days in\nStripe, never hard-coded here.\n\nRaises:\n    400: Invalid plan / unknown user / no price configured.\n    403: Caller is not the organization owner.\n    409: A subscription already exists (already_active or subscription_exists).\n    503: Billing not configured for the region.\n    500: Stripe API error.","operationId":"start_trial_billing_trial_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartTrialRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartTrialResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/brain-pass/grant":{"post":{"tags":["billing"],"summary":"Grant Pass","description":"Record (idempotently) a Brain access pass after the wallet charge settles.\n\nIdempotent on ``jti``: a client retry, or the webhook backstop racing the\nclient, returns the existing pass without a duplicate charge or row.\n\nRaises:\n    403: Caller is not an internal service account.\n    400: Unknown SKU.\n    404: Unknown organization (FK).","operationId":"grant_pass_billing_brain_pass_grant_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantBrainPassRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantBrainPassResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/subscriptions/current":{"get":{"tags":["billing"],"summary":"Get Current Subscription","description":"Get the current active subscription for the authenticated user.\n\nReturns None if user has no active subscription.\n\nArgs:\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Current subscription details or None","operationId":"get_current_subscription_billing_subscriptions_current_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SubscriptionResponse"},{"type":"null"}],"title":"Response Get Current Subscription Billing Subscriptions Current Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/subscriptions":{"get":{"tags":["billing"],"summary":"List Subscriptions","description":"List all subscriptions for the authenticated user.\n\nIncludes current and past subscriptions.\n\nArgs:\n    status_filter: Filter by status (active, canceled, etc.)\n    limit: Maximum results (default: 10)\n    offset: Pagination offset (default: 0)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    List of subscriptions","operationId":"list_subscriptions_billing_subscriptions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"status_filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Filter"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SubscriptionResponse"},"title":"Response List Subscriptions Billing Subscriptions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/subscriptions/{subscription_id}":{"get":{"tags":["billing"],"summary":"Get Subscription","description":"Get details of a specific subscription.\n\nArgs:\n    subscription_id: Subscription ID\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Subscription details\n\nRaises:\n    404: Subscription not found\n    403: Subscription belongs to another user","operationId":"get_subscription_billing_subscriptions__subscription_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/subscriptions/{subscription_id}/cancel":{"post":{"tags":["billing"],"summary":"Cancel Subscription","description":"Cancel a subscription.\n\nArgs:\n    subscription_id: Subscription ID\n    request: Cancellation options (cancel_at_period_end)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Updated subscription\n\nRaises:\n    404: Subscription not found\n    403: Subscription belongs to another user\n    500: Stripe API error","operationId":"cancel_subscription_billing_subscriptions__subscription_id__cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionCancelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/subscriptions/{subscription_id}/reactivate":{"post":{"tags":["billing"],"summary":"Reactivate Subscription","description":"Reactivate a subscription marked for cancellation.\n\nOnly works if subscription is marked to cancel at period end.\n\nArgs:\n    subscription_id: Subscription ID\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Updated subscription\n\nRaises:\n    404: Subscription not found\n    403: Subscription belongs to another user\n    400: Subscription not marked for cancellation\n    500: Stripe API error","operationId":"reactivate_subscription_billing_subscriptions__subscription_id__reactivate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"subscription_id","in":"path","required":true,"schema":{"type":"string","title":"Subscription Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/subscriptions/upgrade":{"post":{"tags":["billing"],"summary":"Upgrade Subscription","description":"Upgrade the user's subscription to a higher tier.\n\nUpgrades are processed immediately with prorated charges.\n\nArgs:\n    request: Target plan for upgrade\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Upgrade result with new plan details\n\nRaises:\n    503: Billing not configured\n    400: No active subscription, already on target plan, or invalid upgrade\n    500: Stripe API error","operationId":"upgrade_subscription_billing_subscriptions_upgrade_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/subscriptions/convert-trial":{"post":{"tags":["billing"],"summary":"Convert Trial","description":"End the user's Brain trial now and start the paid subscription immediately.\n\nFor a trialing user who does not want to wait for trial end: ends the trial in\nStripe (``trial_end='now'``), which charges the card on file for their current\nplan and transitions the subscription trialing -> active. Works for ANY\ntrialing user (it is \"start paying now\", not a tier upgrade, so it covers a\nuser already on the top tier too). Credit allocation and the local-row update\nare handled by the existing trialing -> active webhook\n(``customer.subscription.updated``), so this endpoint is a thin trigger and\nnever double-allocates.\n\nRaises:\n    503: Billing not configured for the user's region.\n    400: No trial to convert (no subscription, or it is not trialing).\n    500: Stripe API error.","operationId":"convert_trial_billing_subscriptions_convert_trial_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertTrialResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/subscriptions/downgrade":{"post":{"tags":["billing"],"summary":"Downgrade Subscription","description":"Downgrade the user's subscription to a lower tier.\n\nUses Stripe Subscription Schedules to truly delay the plan change until\nthe billing period ends. User keeps current tier features AND credits\nuntil the scheduled change takes effect.\n\nArgs:\n    request: Target plan for downgrade\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Downgrade result with effective date\n\nRaises:\n    503: Billing not configured\n    400: No active subscription, already on target plan, or invalid downgrade\n    500: Stripe API error","operationId":"downgrade_subscription_billing_subscriptions_downgrade_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DowngradeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DowngradeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["billing"],"summary":"Cancel Scheduled Downgrade","description":"Cancel a scheduled subscription downgrade.\n\nReleases the subscription schedule, keeping the user on their current plan.\nOnly works if there is a pending scheduled downgrade.\n\nArgs:\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Cancellation confirmation\n\nRaises:\n    503: Billing not configured\n    400: No active subscription or no scheduled downgrade\n    500: Stripe API error","operationId":"cancel_scheduled_downgrade_billing_subscriptions_downgrade_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelDowngradeResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/subscriptions/resubscribe":{"post":{"tags":["billing"],"summary":"Resubscribe","description":"Resubscribe after a cancelled or expired subscription.\n\nCreates a Stripe Checkout session for users with no active subscription.\nReturns a checkout URL to redirect the user to Stripe for payment.\n\nArgs:\n    request: Plan to subscribe to (defaults to starter)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Checkout URL for redirect\n\nRaises:\n    400: User already has an active subscription\n    503: Billing not configured\n    500: Stripe API error","operationId":"resubscribe_billing_subscriptions_resubscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResubscribeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/credits/balance":{"get":{"tags":["billing"],"summary":"Get Credit Balance","description":"Get current credit balance and summary for the authenticated user.\n\nReturns current period credits and lifetime totals.\n\nArgs:\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Credit balance summary","operationId":"get_credit_balance_billing_credits_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalanceResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/credits/allocations":{"get":{"tags":["billing"],"summary":"Get Allocation History","description":"Get credit allocation history for the authenticated user.\n\nShows monthly credit grants over time.\n\nArgs:\n    limit: Maximum results (default: 12 months)\n    offset: Pagination offset (default: 0)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    List of credit allocations","operationId":"get_allocation_history_billing_credits_allocations_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":12,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CreditAllocationResponse"},"title":"Response Get Allocation History Billing Credits Allocations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/credits/transactions":{"get":{"tags":["billing"],"summary":"Get Transaction History","description":"Get credit transaction history for the authenticated user.\n\nShows all credit movements (usage, allocations, refunds, adjustments).\n\nArgs:\n    transaction_type: Filter by type (usage, allocation, refund, adjustment)\n    limit: Maximum results (default: 100)\n    offset: Pagination offset (default: 0)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    List of credit transactions","operationId":"get_transaction_history_billing_credits_transactions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"transaction_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CreditTransactionResponse"},"title":"Response Get Transaction History Billing Credits Transactions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/credits/threads/{thread_id}/transactions":{"get":{"tags":["billing"],"summary":"Get Thread Transactions","description":"Get all credit transactions for a specific LangGraph thread.\n\nShows credit usage for a particular conversation/workflow.\n\nArgs:\n    thread_id: LangGraph thread ID\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    List of credit transactions for the thread\n\nNote:\n    Only returns transactions for threads owned by the current user.","operationId":"get_thread_transactions_billing_credits_threads__thread_id__transactions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CreditTransactionResponse"},"title":"Response Get Thread Transactions Billing Credits Threads  Thread Id  Transactions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/credits/deduct":{"post":{"tags":["billing"],"summary":"Deduct Credits","description":"Deduct credits from the authenticated user's balance.\n\nThis endpoint is typically called by internal services (LangGraph workflows)\nto track credit usage.\n\nArgs:\n    request: Credit usage details (amount, reason, thread_id, metadata)\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Credit transaction record\n\nRaises:\n    400: No active allocation or insufficient credits","operationId":"deduct_credits_billing_credits_deduct_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditUsageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditTransactionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/credits/check/{amount}":{"get":{"tags":["billing"],"summary":"Check Sufficient Credits","description":"Check if user has sufficient credits for an operation.\n\nArgs:\n    amount: Credits required\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Dict with sufficient status and current balance","operationId":"check_sufficient_credits_billing_credits_check__amount__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"amount","in":"path","required":true,"schema":{"type":"integer","title":"Amount"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Check Sufficient Credits Billing Credits Check  Amount  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/credits/refund":{"post":{"tags":["billing"],"summary":"Create Refund For Run","description":"Create refund for all refundable transactions in a LangGraph run.\n\nRefunds all credit usage transactions associated with a specific run ID.\nThis is typically used when a LangGraph workflow fails or produces\nunsatisfactory results.\n\nArgs:\n    request: Refund request with run_id, reason, and optional metadata\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Refund creation summary with all refund pairs\n\nRaises:\n    400: No refundable transactions found for the run\n    403: Run does not belong to the authenticated user\n    404: Run not found","operationId":"create_refund_for_run_billing_credits_refund_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundCreateRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/credits/refunds/{run_id}":{"get":{"tags":["billing"],"summary":"Get Refunds For Run","description":"Get all refund transactions for a specific LangGraph run.\n\nShows all refunds that have been issued for a particular run.\n\nArgs:\n    run_id: LangGraph run ID\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    List of refund transactions with total refunded amount\n\nRaises:\n    403: Run does not belong to the authenticated user","operationId":"get_refunds_for_run_billing_credits_refunds__run_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/credits/stream":{"get":{"tags":["billing"],"summary":"Stream Credit Updates","description":"Stream real-time credit balance updates via Server-Sent Events (SSE).\n\nThis endpoint establishes a persistent connection that sends credit updates\nin real-time whenever the user's credit balance changes.\n\nNote: This endpoint requires the SSE feature flag to be enabled.\nSet FEATURE_SSE_ENABLED=true in environment variables.\n\nArgs:\n    current_user: Authenticated user\n\nReturns:\n    StreamingResponse with text/event-stream content type\n\nRaises:\n    503: SSE feature is disabled\n\nExample client usage (JavaScript):\n    ```javascript\n    const eventSource = new EventSource('/billing/credits/stream', {\n        headers: { 'Authorization': 'Bearer <token>' }\n    });\n\n    eventSource.addEventListener('credit_update', (event) => {\n        const data = JSON.parse(event.data);\n        console.log('Balance:', data.current_balance);\n        console.log('Change:', data.change);\n    });\n\n    eventSource.addEventListener('heartbeat', (event) => {\n        console.log('Connection alive');\n    });\n    ```\n\nEvent format:\n    ```\n    event: credit_update\n    data: {\n        \"user_id\": \"user_123\",\n        \"current_balance\": 850,\n        \"change\": -150,\n        \"reason\": \"LangGraph workflow execution\",\n        \"timestamp\": \"2025-10-21T12:34:56Z\"\n    }\n    ```","operationId":"stream_credit_updates_billing_credits_stream_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/webhooks/stripe/us":{"post":{"tags":["billing"],"summary":"Stripe Webhook Us","description":"Handle Stripe webhook events from US account (DynG AI, Inc.).\n\nThis endpoint receives and processes webhook events from the US Stripe account.\nConfigure in US Stripe dashboard:\nhttps://agents.platformpilot.ai/billing/webhooks/stripe/us\n\nSecurity:\n- Verifies Stripe webhook signature using STRIPE_WEBHOOK_SECRET_US\n- No authentication required (webhook signature is the auth)\n\nReturns:\n    Success/error status for Stripe's webhook retry logic","operationId":"stripe_webhook_us_billing_webhooks_stripe_us_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Stripe Webhook Us Billing Webhooks Stripe Us Post"}}}}}}},"/billing/webhooks/stripe/eu":{"post":{"tags":["billing"],"summary":"Stripe Webhook Eu","description":"Handle Stripe webhook events from EU account (PlatformPilot Limited).\n\nThis endpoint receives and processes webhook events from the EU Stripe account.\nConfigure in EU Stripe dashboard:\nhttps://agents.platformpilot.ai/billing/webhooks/stripe/eu\n\nSecurity:\n- Verifies Stripe webhook signature using STRIPE_WEBHOOK_SECRET_EU\n- No authentication required (webhook signature is the auth)\n\nReturns:\n    Success/error status for Stripe's webhook retry logic","operationId":"stripe_webhook_eu_billing_webhooks_stripe_eu_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Stripe Webhook Eu Billing Webhooks Stripe Eu Post"}}}}}}},"/billing/webhooks/stripe":{"post":{"tags":["billing"],"summary":"Stripe Webhook","description":"Handle Stripe webhook events (legacy endpoint - defaults to US).\n\nThis endpoint maintains backwards compatibility with existing webhook\nconfigurations. New deployments should use region-specific endpoints:\n- /webhooks/stripe/us for US account\n- /webhooks/stripe/eu for EU account\n\nEvents handled:\n- checkout.session.completed: Mark checkout as complete\n- checkout.session.expired: Mark checkout as expired\n- customer.subscription.created: Create subscription + allocate credits\n- customer.subscription.updated: Update subscription status\n- customer.subscription.deleted: Cancel subscription\n- invoice.payment_succeeded: Allocate credits on renewal\n- invoice.payment_failed: Log payment failure\n\nSecurity:\n- Verifies Stripe webhook signature to ensure authenticity\n- No authentication required (webhook signature is the auth)\n\nReturns:\n    Success/error status for Stripe's webhook retry logic\n\nRaises:\n    400: Invalid signature or payload\n    500: Processing error","operationId":"stripe_webhook_billing_webhooks_stripe_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Stripe Webhook Billing Webhooks Stripe Post"}}}}}}},"/billing/subscription/status":{"get":{"summary":"Get Subscription Status","description":"Get user's subscription status with race condition handling.\n\nReturns:\n    Structured response with user, subscription, credits, and billing objects.\n    Status can be: \"active\", \"processing\", \"pending_payment\", \"expired\", \"none\"","operationId":"get_subscription_status_billing_subscription_status_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"user_uid","in":"query","required":false,"schema":{"type":"string","description":"User UID from Landing Page (Auth0 User ID)","title":"User Uid"},"description":"User UID from Landing Page (Auth0 User ID)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/invoices":{"get":{"tags":["billing"],"summary":"List Invoices","description":"List invoices for the authenticated user.\n\nReturns paginated list of invoices with caching (5-minute TTL).\nCache is invalidated automatically when invoice webhook events occur.\n\nArgs:\n    limit: Maximum invoices to return (1-100, default: 10)\n    starting_after: Invoice ID for cursor-based pagination\n    status_filter: Filter by invoice status\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Paginated invoice list with total count\n\nRaises:\n    503: If Stripe is not configured\n    502: If Stripe API call fails","operationId":"list_invoices_billing_invoices_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Number of invoices to return","default":10,"title":"Limit"},"description":"Number of invoices to return"},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Invoice ID for pagination (cursor)","title":"Starting After"},"description":"Invoice ID for pagination (cursor)"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status (draft, open, paid, uncollectible, void)","title":"Status"},"description":"Filter by status (draft, open, paid, uncollectible, void)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/portal":{"post":{"tags":["billing"],"summary":"Create Portal Session","description":"Create a Stripe Billing Portal session for the authenticated user.\n\nUses the user's stored stripe_region to route to the correct Stripe account.\n\nThe portal allows customers to:\n- Update payment methods\n- View billing history and download invoices\n- Cancel or update subscriptions\n\nArgs:\n    request: Request with return URL\n    current_user: Authenticated user\n\nReturns:\n    Portal session URL to redirect the user to\n\nRaises:\n    503: Billing not configured for user's region\n    400: User has no Stripe customer ID\n    500: Stripe API error","operationId":"create_portal_session_billing_portal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/extra-usage/settings":{"get":{"tags":["billing"],"summary":"Get Extra Usage Settings","description":"Get extra usage settings for the authenticated user.\n\nReturns the user's current extra usage configuration including:\n- Whether extra usage is enabled\n- Spending cap (if set)\n- Current overage spend this period\n- Plan-specific overage pricing","operationId":"get_extra_usage_settings_billing_extra_usage_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtraUsageSettingsResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"put":{"tags":["billing"],"summary":"Update Extra Usage Settings","description":"Update extra usage settings.\n\nAllows users to:\n- Enable/disable extra usage (overage billing)\n- Set a monthly spending cap\n\nWhen enabling for the first time, this adds the metered price component\nto the user's Stripe subscription for end-of-period billing.","operationId":"update_extra_usage_settings_billing_extra_usage_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtraUsageSettingsUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtraUsageSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/extra-usage/usage":{"get":{"tags":["billing"],"summary":"Get Overage Usage","description":"Get current period overage usage summary.\n\nReturns a detailed breakdown of the current billing period including:\n- Included credits granted and remaining\n- Overage credits consumed\n- Current overage spend\n- Whether the user has hit their spending cap","operationId":"get_overage_usage_billing_extra_usage_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverageUsageResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/credit-packs/checkout":{"post":{"tags":["billing"],"summary":"Create Credit Pack Checkout","description":"Create a Stripe Checkout session for purchasing a credit pack.\n\nCredit packs are one-time purchases that add prepaid credits to the user's\nbalance. These credits never expire and can be used after included credits\nare exhausted.\n\nUses the user's stored stripe_region to route to the correct Stripe account.\n\nArgs:\n    request: Credit pack checkout request with amount_cents\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Checkout session URL and credits to receive\n\nRaises:\n    400: User not on a prepaid plan or invalid amount\n    503: Stripe not configured","operationId":"create_credit_pack_checkout_billing_credit_packs_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditPackCheckoutRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditPackCheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/credit-packs/balance":{"get":{"tags":["billing"],"summary":"Get Credit Pack Balance","description":"Get user's prepaid credit balance and recent purchase history.\n\nArgs:\n    db: Database session\n    current_user: Authenticated user\n\nReturns:\n    Prepaid credit balance and purchase history","operationId":"get_credit_pack_balance_billing_credit_packs_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditPackBalanceResponse"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/billing/status/{organization_id}":{"get":{"tags":["billing"],"summary":"Check Org Billing Status","description":"Get billing status for an organization.\n\nUsed by RO service for pre-flight billing checks before marshalling.\n\nAuthorization:\n    - Internal service accounts (auth_source=\"internal\") can access any org\n    - External users can only access their own organization\n\nArgs:\n    organization_id: Organization ID (slug) to check\n\nReturns:\n    Billing status with can_process_alert flag","operationId":"check_org_billing_status_billing_status__organization_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Check Org Billing Status Billing Status  Organization Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/create":{"post":{"tags":["organizations"],"summary":"Create Organization","description":"Create organization for external user (called by Landing Page during onboarding).\n\n**Call Sequence**:\n1. Landing Page creates user via `POST /webhooks/auth/users`\n2. Landing Page calls this endpoint to create organization\n\n**Prerequisites**: User MUST exist (created via `/webhooks/auth/users` first)\n\n**Behavior**: IDEMPOTENT - Returns existing org if already created for this user\n\n**Authentication**: API key via `x-api-key` header\n\n**Request**:\n```json\n{\n    \"external_id\": \"auth0|abc123\",\n    \"owner_email\": \"user@example.com\",\n    \"owner_name\": \"John Doe\"\n}\n```\n\n**Response**:\n```json\n{\n    \"organization_id\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n    \"organization_name\": \"John Doe's Organization\",\n    \"created_at\": \"2025-11-15T12:00:00Z\"\n}\n```","operationId":"create_organization_organizations_create_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationCreateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/bots/health":{"get":{"tags":["Bot Configuration"],"summary":"Bot Health Check","description":"Bot Configuration service health check.","operationId":"bot_health_check_organizations__organization_id__bots_health_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/bots":{"get":{"tags":["Bot Configuration"],"summary":"List Bots","description":"List all bot configurations for the organization.","operationId":"list_bots_organizations__organization_id__bots_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/bots/{provider}":{"get":{"tags":["Bot Configuration"],"summary":"Get Bot","description":"Get configuration for a specific bot provider.","operationId":"get_bot_organizations__organization_id__bots__provider__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Bot Configuration"],"summary":"Create Bot","description":"Create a new bot configuration. Requires admin or owner role.","operationId":"create_bot_organizations__organization_id__bots__provider__post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotConfigCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Bot Configuration"],"summary":"Update Bot","description":"Update an existing bot configuration. Requires admin or owner role.","operationId":"update_bot_organizations__organization_id__bots__provider__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Bot Configuration"],"summary":"Delete Bot","description":"Delete a bot configuration. Requires admin or owner role.","operationId":"delete_bot_organizations__organization_id__bots__provider__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/bots/{provider}/test":{"post":{"tags":["Bot Configuration"],"summary":"Test Bot","description":"Send a test notification to verify bot configuration.","operationId":"test_bot_organizations__organization_id__bots__provider__test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels":{"get":{"tags":["Channel Configuration"],"summary":"List Channels","description":"List all configured channels with account summaries.","operationId":"list_channels_organizations__organization_id__channels_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/available":{"get":{"tags":["Channel Configuration"],"summary":"List Available Channels","description":"List all registered channel plugins with their capabilities.","operationId":"list_available_channels_organizations__organization_id__channels_available_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailableChannelsListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/health/status":{"get":{"tags":["Channel Configuration"],"summary":"Get Channel Health Status","description":"Return health status for all channel accounts (for dashboard).\n\nIncludes per-account probe results, failure counts, and restart history.","operationId":"get_channel_health_status_organizations__organization_id__channels_health_status_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/bindings":{"get":{"tags":["Channel Configuration"],"summary":"List Channel Bindings","description":"List all configured conversation-to-graph bindings.","operationId":"list_channel_bindings_organizations__organization_id__channels_bindings_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Channel Bindings Organizations  Organization Id  Channels Bindings Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Channel Configuration"],"summary":"Create Channel Binding","description":"Create a conversation-to-graph binding. Requires admin role.","operationId":"create_channel_binding_organizations__organization_id__channels_bindings_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/bindings/{channel_id}/{conversation_id}":{"delete":{"tags":["Channel Configuration"],"summary":"Delete Channel Binding","description":"Delete a conversation-to-graph binding. Requires admin role.","operationId":"delete_channel_binding_organizations__organization_id__channels_bindings__channel_id___conversation_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/accounts":{"get":{"tags":["Channel Configuration"],"summary":"List Channel Accounts","description":"List all accounts for a specific channel.","operationId":"list_channel_accounts_organizations__organization_id__channels__channel_id__accounts_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChannelAccountResponse"},"title":"Response List Channel Accounts Organizations  Organization Id  Channels  Channel Id  Accounts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Channel Configuration"],"summary":"Create Channel Account","description":"Create a new channel account. Requires admin or owner role.","operationId":"create_channel_account_organizations__organization_id__channels__channel_id__accounts_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelAccountCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/accounts/{account_id}":{"get":{"tags":["Channel Configuration"],"summary":"Get Channel Account","description":"Get a specific channel account.","operationId":"get_channel_account_organizations__organization_id__channels__channel_id__accounts__account_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelAccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Channel Configuration"],"summary":"Update Channel Account","description":"Update a channel account. Requires admin or owner role.","operationId":"update_channel_account_organizations__organization_id__channels__channel_id__accounts__account_id__patch","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelAccountUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Channel Configuration"],"summary":"Delete Channel Account","description":"Delete a channel account. Requires admin or owner role.","operationId":"delete_channel_account_organizations__organization_id__channels__channel_id__accounts__account_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/accounts/{account_id}/enable":{"post":{"tags":["Channel Configuration"],"summary":"Enable Channel Account","description":"Enable a channel account. Requires admin or owner role.","operationId":"enable_channel_account_organizations__organization_id__channels__channel_id__accounts__account_id__enable_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/accounts/{account_id}/disable":{"post":{"tags":["Channel Configuration"],"summary":"Disable Channel Account","description":"Disable a channel account. Requires admin or owner role.","operationId":"disable_channel_account_organizations__organization_id__channels__channel_id__accounts__account_id__disable_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/accounts/{account_id}/test":{"post":{"tags":["Channel Configuration"],"summary":"Test Channel Account","description":"Test channel account connectivity via probe.","operationId":"test_channel_account_organizations__organization_id__channels__channel_id__accounts__account_id__test_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}},{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/config-schema":{"get":{"tags":["Channel Configuration"],"summary":"Get Channel Config Schema","description":"Return the config schema for a channel (for frontend form generation).","operationId":"get_channel_config_schema_organizations__organization_id__channels__channel_id__config_schema_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/directory/peers":{"get":{"tags":["Channel Configuration"],"summary":"List Channel Peers","description":"List peers (phone numbers, users) from a channel's directory adapter.","operationId":"list_channel_peers_organizations__organization_id__channels__channel_id__directory_peers_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/commands":{"get":{"tags":["Channel Configuration"],"summary":"Get Channel Commands","description":"List native commands for a channel.","operationId":"get_channel_commands_organizations__organization_id__channels__channel_id__commands_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/oauth/authorize":{"get":{"tags":["Channel Configuration"],"summary":"Channel Oauth Authorize","description":"Generate OAuth authorize URL for channel installation.","operationId":"channel_oauth_authorize_organizations__organization_id__channels__channel_id__oauth_authorize_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelAuthorizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/{channel_id}/oauth/callback":{"post":{"tags":["Channel Configuration"],"summary":"Channel Oauth Callback","description":"Handle OAuth callback — exchange code and store workspace/guild info.","operationId":"channel_oauth_callback_organizations__organization_id__channels__channel_id__oauth_callback_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}},{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelOAuthCallbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChannelOAuthCallbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/{organization_id}/channels/digest":{"get":{"tags":["Channel Configuration"],"summary":"Get Brain Digest Config","description":"Return the org's Brain digest opt-in (defaults when never set).","operationId":"get_brain_digest_config_organizations__organization_id__channels_digest_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainDigestConfig"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Channel Configuration"],"summary":"Put Brain Digest Config","description":"Set the org's Brain digest opt-in (admin).\n\nEnabling requires a real, outbound-capable channel account and the\naudience attestation; disabling needs nothing. The stored row is the\nsingle gate the dream-time sender reads.","operationId":"put_brain_digest_config_organizations__organization_id__channels_digest_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"organization_id","in":"path","required":true,"schema":{"type":"string","title":"Organization Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrainDigestConfig"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/APIResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/channels/googlechat/oauth/callback":{"get":{"tags":["Channel Webhooks"],"summary":"Googlechat Oauth Callback","description":"Direct OAuth callback for Google Chat reactions scope.\n\nGoogle redirects the browser here after the admin authorizes.\nWe exchange the code for tokens, store them, and redirect to D3.\n\nOn success: redirect to D3 with ``?channel_oauth=success&channel=googlechat``\nOn failure: redirect with ``?channel_oauth=error&channel=googlechat&channel_oauth_error=<msg>``","operationId":"googlechat_oauth_callback_webhooks_channels_googlechat_oauth_callback_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/webhooks/channels/{channel_id}":{"get":{"tags":["Channel Webhooks"],"summary":"Verify Channel Webhook","description":"Handle GET-based webhook verification (e.g. Meta's hub.challenge).\n\nUsed by WhatsApp Cloud API and other Meta platforms. Meta sends:\n``GET /webhooks/channels/whatsapp?org_id=X&hub.mode=subscribe&hub.verify_token=T&hub.challenge=C``\n\nThe plugin's inbound adapter verifies the token and returns the challenge.","operationId":"verify_channel_webhook_webhooks_channels__channel_id__get","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Channel Webhooks"],"summary":"Receive Channel Webhook","description":"Handle inbound webhook for a channel.\n\nPipeline:\n1. Rate limit check (per IP).\n2. Signature verification.\n3. Challenge response (Slack URL verification).\n4. Event parsing.\n5. For each message:\n   a. Mention gating (skip unmentioned group messages).\n   b. Ack reaction (fire-and-forget).\n   c. Debounce (batch rapid-fire messages from same sender).","operationId":"receive_channel_webhook_webhooks_channels__channel_id__post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/channels/{channel_id}/interactive":{"post":{"tags":["Channel Webhooks"],"summary":"Receive Channel Interaction","description":"Handle a rich-message interaction callback (button click).\n\nVerifies the platform signature via the plugin's interactivity\nadapter, parses the callback, and acks immediately — the actual\nhandling runs in the background so the platform's ack window\n(Slack: 3s) is never at risk.","operationId":"receive_channel_interaction_webhooks_channels__channel_id__interactive_post","parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string","title":"Channel Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/summaries/threads/{thread_id}":{"get":{"tags":["summaries"],"summary":"Get Summary","description":"Get summary for a thread.\n\nReturns the summary from thread state if available,\nor status \"pending\" if summary hasn't been generated yet.\n\nArgs:\n    thread_id: Thread ID to get summary for\n    current_user: Authenticated user\n    db: Async DB session (team membership for the access check)\n\nReturns:\n    SummaryResponse with status and optional summary data\n\nNote:\n    Summary generation is triggered by the billing_node after\n    workflow completion. This endpoint only fetches existing summaries.","operationId":"get_summary_summaries_threads__thread_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/summaries/threads/{thread_id}/regenerate":{"post":{"tags":["summaries"],"summary":"Regenerate Summary","description":"Trigger (re)generation of a thread summary, idempotently.\n\nIdempotent by default: if the thread already has a summary, or one is\nalready being generated (a fresh pending marker), this skips the expensive\nHaiku call instead of duplicating it. This guards the inbox backfill path,\nwhere many clients (multiple tabs, or every user in an org) can request the\nsame summary-less thread at once. Pass ``force=true`` to force a fresh\nregeneration (an explicit user action), bypassing the idempotency checks.\n\nAsync: the client should listen for the SSE summary_complete event.\n\nArgs:\n    thread_id: Thread ID to (re)generate the summary for\n    force: Bypass idempotency and always regenerate\n    current_user: Authenticated user\n    db: Async DB session (team membership for the access check)\n\nReturns:\n    202 Accepted with thread_id (skipped=True when nothing was started)","operationId":"regenerate_summary_summaries_threads__thread_id__regenerate_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Regenerate Summary Summaries Threads  Thread Id  Regenerate Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/context-window":{"get":{"tags":["context-window"],"summary":"Get Context Window","description":"Return current context-window utilization for the indicator UI.","operationId":"get_context_window_threads__thread_id__context_window_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextWindowResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/steer":{"post":{"tags":["steer"],"summary":"Steer Thread","description":"Queue a mid-turn steer for the thread's live run.","operationId":"steer_thread_threads__thread_id__steer_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SteerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SteerResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["steer"],"summary":"List Steer Queue","description":"List queued-but-not-yet-drained steers (queue UI rendering).","operationId":"list_steer_queue_threads__thread_id__steer_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SteerQueueResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/{thread_id}/steer/{steer_id}":{"delete":{"tags":["steer"],"summary":"Remove Steer Item","description":"Remove one queued steer (queue-item delete before the drain).\n\n404 when the item is gone: already drained into the run, or never\nexisted. Removal races the drain safely (exact-value LREM).","operationId":"remove_steer_item_threads__thread_id__steer__steer_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"thread_id","in":"path","required":true,"schema":{"type":"string","title":"Thread Id"}},{"name":"steer_id","in":"path","required":true,"schema":{"type":"string","title":"Steer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Remove Steer Item Threads  Thread Id  Steer  Steer Id  Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inbox/threads/search":{"post":{"tags":["inbox"],"summary":"Inbox Threads Search","description":"Search the inbox-visible threads for the calling user.\n\nWire-compatible with ``POST /threads/search`` for the body shape d3\nalready sends (``metadata``, ``values``, ``status``, ``limit``,\n``offset``, ``select``). Response is the same list-of-thread shape.","operationId":"inbox_threads_search_inbox_threads_search_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Inbox Threads Search Inbox Threads Search Post"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/eval/locomo/run":{"post":{"tags":["eval"],"summary":"Run Locomo Experiment","description":"Run the LoCoMo benchmark: seed memories, search, generate answers.\n\nReturns Mem0-compatible results JSON. Feed into ``POST /eval/locomo/score``\nto compute BLEU-1, set-F1, and LLM Judge metrics.","operationId":"run_locomo_experiment_eval_locomo_run_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"technique","in":"query","required":false,"schema":{"type":"string","description":"Memory system: 'platformpilot' or 'mem0'","default":"platformpilot","title":"Technique"},"description":"Memory system: 'platformpilot' or 'mem0'"},{"name":"search_limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"description":"(platformpilot only) Results per search query","default":10,"title":"Search Limit"},"description":"(platformpilot only) Results per search query"},{"name":"seed_granularity","in":"query","required":false,"schema":{"enum":["atomic","atomic_evolve","session"],"type":"string","description":"(platformpilot only) Memory ingestion granularity / evolution schedule. 'atomic' (online, default/headline) decomposes each session into fact bullets via extract_facts, one memory per fact, evolving each per-write — matches the product write path. 'atomic_evolve' (batch) seeds the same atoms EMBED-ONLY then runs ONE deferred evolve_namespace_once pass over the complete corpus (no O(N^2) per-insert re-touch). 'session' (legacy) is the whole-session chunk, kept for re-baselining. Numbers are NOT comparable across values (different ingestion).","default":"atomic","title":"Seed Granularity"},"description":"(platformpilot only) Memory ingestion granularity / evolution schedule. 'atomic' (online, default/headline) decomposes each session into fact bullets via extract_facts, one memory per fact, evolving each per-write — matches the product write path. 'atomic_evolve' (batch) seeds the same atoms EMBED-ONLY then runs ONE deferred evolve_namespace_once pass over the complete corpus (no O(N^2) per-insert re-touch). 'session' (legacy) is the whole-session chunk, kept for re-baselining. Numbers are NOT comparable across values (different ingestion)."},{"name":"max_conversations","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":10,"minimum":1},{"type":"null"}],"description":"Max conversations to evaluate (1-10)","default":1,"title":"Max Conversations"},"description":"Max conversations to evaluate (1-10)"},{"name":"mem0_api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"(mem0 only) Mem0 API key","title":"Mem0 Api Key"},"description":"(mem0 only) Mem0 API key"},{"name":"mem0_org_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"(mem0 only) Mem0 organization ID","title":"Mem0 Org Id"},"description":"(mem0 only) Mem0 organization ID"},{"name":"mem0_project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"(mem0 only) Mem0 project ID","title":"Mem0 Project Id"},"description":"(mem0 only) Mem0 project ID"},{"name":"enable_graph","in":"query","required":false,"schema":{"type":"boolean","description":"(mem0 only) Enable graph memory (Mem0+ mode, requires Pro plan)","default":false,"title":"Enable Graph"},"description":"(mem0 only) Enable graph memory (Mem0+ mode, requires Pro plan)"},{"name":"checkpoint_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Optional path to a checkpoint JSON file. When set, per-conversation progress is persisted after every QA pair, and a subsequent run with the same path resumes from the last completed conversation. Required when running large benchmarks with rate-limited tokens.","title":"Checkpoint Path"},"description":"Optional path to a checkpoint JSON file. When set, per-conversation progress is persisted after every QA pair, and a subsequent run with the same path resumes from the last completed conversation. Required when running large benchmarks with rate-limited tokens."},{"name":"pace_seconds","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":120.0,"minimum":0.0},{"type":"null"}],"description":"Seconds to sleep between answer LLM calls. Start with ~10 for Sonnet via OAuth; bump to 15–20 only if 429s persist. Falls back to the EVAL_PACE_SECONDS env var (default 0).","title":"Pace Seconds"},"description":"Seconds to sleep between answer LLM calls. Start with ~10 for Sonnet via OAuth; bump to 15–20 only if 429s persist. Falls back to the EVAL_PACE_SECONDS env var (default 0)."},{"name":"seed_only","in":"query","required":false,"schema":{"type":"boolean","description":"Seed-only: the backend seeds + drains evolution per conversation and stops (no retrieve, no reader, no teardown). Namespaces persist so a client-side reader can retrieve + answer + tear down. A conversation showing was_seeded in the checkpoint means its evolution has fully settled — poll GET /eval/locomo/checkpoint for readiness.","default":false,"title":"Seed Only"},"description":"Seed-only: the backend seeds + drains evolution per conversation and stops (no retrieve, no reader, no teardown). Namespaces persist so a client-side reader can retrieve + answer + tear down. A conversation showing was_seeded in the checkpoint means its evolution has fully settled — poll GET /eval/locomo/checkpoint for readiness."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/locomo/cancel":{"post":{"tags":["eval"],"summary":"Cancel Locomo Run","description":"Cancel an in-flight LoCoMo run on this worker.\n\nRequired because ``/eval/locomo/run`` is synchronous-await and FastAPI\ndoes not cancel handler coroutines when the client disconnects. A\nrunaway run (e.g. 429-storming on rate limits) would otherwise persist\nuntil the worker rotates. This endpoint calls ``task.cancel()`` on the\nregistered asyncio.Task, which propagates ``CancelledError`` into the\nnext ``await`` point in the run loop and unwinds gracefully.\n\nPer-worker scope: the registry is in-process. A run on a different\nworker can't be cancelled from here — but worker rotation kills those\nanyway. In a multi-worker cluster, repeat the cancel call until you hit\nthe right worker (or wait for rotation).","operationId":"cancel_locomo_run_eval_locomo_cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"checkpoint_path","in":"query","required":true,"schema":{"type":"string","description":"The checkpoint_path of the in-flight run to cancel. Must match exactly the path used in the original /run request.","title":"Checkpoint Path"},"description":"The checkpoint_path of the in-flight run to cancel. Must match exactly the path used in the original /run request."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/locomo/score":{"post":{"tags":["eval"],"summary":"Score Locomo Results","description":"Score raw experiment results with BLEU-1, set-F1, and LLM Judge.\n\nAccepts the ``results`` dict from the run phase and returns scored\nresults with per-category and overall summaries.","operationId":"score_locomo_results_eval_locomo_score_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"pace_seconds","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":120.0,"minimum":0.0},{"type":"null"}],"description":"Seconds to sleep between judge LLM calls. ~10s for Sonnet is usually fine. Falls back to EVAL_PACE_SECONDS (default 0).","title":"Pace Seconds"},"description":"Seconds to sleep between judge LLM calls. ~10s for Sonnet is usually fine. Falls back to EVAL_PACE_SECONDS (default 0)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":true}},"description":"Raw results from /eval/locomo/run (Mem0-format JSON)","title":"Results"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/locomo/checkpoint":{"get":{"tags":["eval"],"summary":"Read Locomo Checkpoint","description":"Read a LoCoMo run checkpoint from the LangGraph store.\n\nThe checkpoint is now Postgres-backed (under namespace\n``(\"eval_checkpoints\",)``) so it survives LangGraph Cloud worker\nrotation and is readable from any replica — fixing the stickiness\nissue where the file-on-/tmp version was lost on every deploy.\n\nSet ``include_qa=true`` to fetch the full QA payload — that turns\nthis endpoint into a \"result-extraction\" hop that's safe even when\nthe original /run request lost its client connection.","operationId":"read_locomo_checkpoint_eval_locomo_checkpoint_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string","description":"Checkpoint key. (Historically a worker-local file path; now an opaque key into the LangGraph store namespace ``eval_checkpoints``. Same string used to write it.)","title":"Path"},"description":"Checkpoint key. (Historically a worker-local file path; now an opaque key into the LangGraph store namespace ``eval_checkpoints``. Same string used to write it.)"},{"name":"include_qa","in":"query","required":false,"schema":{"type":"boolean","description":"When true, include the full ``qa_results`` payload for each conversation. Use this to fetch the run's answers without holding open the synchronous /eval/locomo/run connection.","default":false,"title":"Include Qa"},"description":"When true, include the full ``qa_results`` payload for each conversation. Use this to fetch the run's answers without holding open the synchronous /eval/locomo/run connection."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__eval__CheckpointResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/locomo/cleanup":{"post":{"tags":["eval"],"summary":"Cleanup Locomo Memories","description":"Wipe all memories seeded by a prior LoCoMo run.\n\nUse this between runs to ensure each experiment starts from a clean\nslate. The previous run may have crashed mid-conversation (e.g. on\nrate limits) leaving partial memories that would skew the next run's\nscores.\n\nFor ``platformpilot``: deletes the eval namespace, evolution counter,\nand merge redirects for each conversation.\nFor ``mem0``: deletes the user_id ``locomo_<idx>`` for each conv.","operationId":"cleanup_locomo_memories_eval_locomo_cleanup_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"technique","in":"query","required":false,"schema":{"type":"string","description":"Memory system whose namespaces should be wiped","default":"platformpilot","title":"Technique"},"description":"Memory system whose namespaces should be wiped"},{"name":"max_conversations","in":"query","required":false,"schema":{"type":"integer","maximum":10,"minimum":1,"description":"Wipe data for conversations 0..max_conversations-1","default":10,"title":"Max Conversations"},"description":"Wipe data for conversations 0..max_conversations-1"},{"name":"mem0_api_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"(mem0) Mem0 API key — required when technique='mem0'","title":"Mem0 Api Key"},"description":"(mem0) Mem0 API key — required when technique='mem0'"},{"name":"mem0_org_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mem0 Org Id"}},{"name":"mem0_project_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mem0 Project Id"}},{"name":"enable_graph","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Enable Graph"}},{"name":"checkpoint_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"If set, delete this checkpoint file too","title":"Checkpoint Path"},"description":"If set, delete this checkpoint file too"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__eval__CleanupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/longmemeval/run":{"post":{"tags":["eval"],"summary":"Run Longmemeval Experiment","description":"Run LongMemEval: seed each haystack, retrieve, answer, record recall.","operationId":"run_longmemeval_experiment_eval_longmemeval_run_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"search_limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Search Limit"}},{"name":"prompt_variant","in":"query","required":false,"schema":{"enum":["v1","v2"],"type":"string","description":"Reader answer-prompt variant: 'v2' (default; curbs over-abstention by forcing a full scan plus paraphrase/date/relational matching before the same abstention path) or 'v1' (original, abstention-first). Both keep the _abs abstention path, so abstention questions still decline. Pass 'v1' to reproduce the original policy or to A/B the two.","default":"v2","title":"Prompt Variant"},"description":"Reader answer-prompt variant: 'v2' (default; curbs over-abstention by forcing a full scan plus paraphrase/date/relational matching before the same abstention path) or 'v1' (original, abstention-first). Both keep the _abs abstention path, so abstention questions still decline. Pass 'v1' to reproduce the original policy or to A/B the two."},{"name":"seed_granularity","in":"query","required":false,"schema":{"enum":["atomic","atomic_evolve","session"],"type":"string","description":"Memory ingestion granularity / evolution schedule. 'session' (legacy, default) is the one-memory-per-session dump: the fast, low-contention, proven baseline (~50 memories/example). 'atomic' (online) decomposes each session into standalone fact bullets via extract_facts, one freeform memory per fact, each evolved per-write (matches the product write path) but seeds far more memories per example. 'atomic_evolve' (batch) seeds the same atoms EMBED-ONLY then runs ONE deferred evolve_namespace_once pass over the complete corpus (no O(N^2) per-insert re-touch). Numbers are NOT comparable across values (different ingestion); the value is recorded in the run config.","default":"session","title":"Seed Granularity"},"description":"Memory ingestion granularity / evolution schedule. 'session' (legacy, default) is the one-memory-per-session dump: the fast, low-contention, proven baseline (~50 memories/example). 'atomic' (online) decomposes each session into standalone fact bullets via extract_facts, one freeform memory per fact, each evolved per-write (matches the product write path) but seeds far more memories per example. 'atomic_evolve' (batch) seeds the same atoms EMBED-ONLY then runs ONE deferred evolve_namespace_once pass over the complete corpus (no O(N^2) per-insert re-touch). Numbers are NOT comparable across values (different ingestion); the value is recorded in the run config."},{"name":"max_examples","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Evaluate the first N examples in dataset order (None = all).","title":"Max Examples"},"description":"Evaluate the first N examples in dataset order (None = all)."},{"name":"sample_per_type","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Stratified sampling: take the first N examples of EACH ability bucket (information_extraction, multi_session_reasoning, knowledge_updates, temporal_reasoning, abstention). Representative across abilities; takes precedence over max_examples.","title":"Sample Per Type"},"description":"Stratified sampling: take the first N examples of EACH ability bucket (information_extraction, multi_session_reasoning, knowledge_updates, temporal_reasoning, abstention). Representative across abilities; takes precedence over max_examples."},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"LongMemEval data URL or local path. Falls back to LONGMEMEVAL_DATA_PATH / LONGMEMEVAL_DATA_URL.","title":"Source"},"description":"LongMemEval data URL or local path. Falls back to LONGMEMEVAL_DATA_PATH / LONGMEMEVAL_DATA_URL."},{"name":"checkpoint_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Checkpoint key for resumable, Postgres-backed progress.","title":"Checkpoint Path"},"description":"Checkpoint key for resumable, Postgres-backed progress."},{"name":"question_ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated question_ids to run exactly (targeted re-run). Takes precedence over max_examples / sample_per_type.","title":"Question Ids"},"description":"Comma-separated question_ids to run exactly (targeted re-run). Takes precedence over max_examples / sample_per_type."},{"name":"pace_seconds","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":120.0,"minimum":0.0},{"type":"null"}],"title":"Pace Seconds"}},{"name":"retrieve_only","in":"query","required":false,"schema":{"type":"boolean","description":"Retrieve-only: the deployment seeds + retrieves but does NOT run the reader. Each row carries the retrieved 'context' and an empty 'response' for a client-side reader to fill before scoring, keeping the reader LLM and its spend off the deployment.","default":false,"title":"Retrieve Only"},"description":"Retrieve-only: the deployment seeds + retrieves but does NOT run the reader. Each row carries the retrieved 'context' and an empty 'response' for a client-side reader to fill before scoring, keeping the reader LLM and its spend off the deployment."},{"name":"example_concurrency","in":"query","required":false,"schema":{"type":"integer","maximum":16,"minimum":1,"description":"How many examples to seed/retrieve concurrently. Each example is an isolated namespace (own seed lease, evolution, consolidation), so this overlaps the long per-example seeds WITHOUT reintroducing the intra-namespace contention the serial evolve pass guards against. 1 (default) = the original sequential behavior. Raise it to shorten wall-clock on multi-example runs; bounded to keep one replica's event loop and Haiku QPS sane. Ignored when pace_seconds > 0.","default":1,"title":"Example Concurrency"},"description":"How many examples to seed/retrieve concurrently. Each example is an isolated namespace (own seed lease, evolution, consolidation), so this overlaps the long per-example seeds WITHOUT reintroducing the intra-namespace contention the serial evolve pass guards against. 1 (default) = the original sequential behavior. Raise it to shorten wall-clock on multi-example runs; bounded to keep one replica's event loop and Haiku QPS sane. Ignored when pace_seconds > 0."},{"name":"skip_consolidation","in":"query","required":false,"schema":{"type":"boolean","description":"atomic_evolve only: skip the deferred Phase-C consolidation (consolidate=False on evolve_namespace_once). Phase C is a serial single-writer compaction (~25-30% of per-example wall-time) that barely moves recall@k for a seed-then-query-once eval (it never deletes atoms; superseded reaping is off by default). Off by default to keep the production-faithful baseline; opt in to A/B the delta.","default":false,"title":"Skip Consolidation"},"description":"atomic_evolve only: skip the deferred Phase-C consolidation (consolidate=False on evolve_namespace_once). Phase C is a serial single-writer compaction (~25-30% of per-example wall-time) that barely moves recall@k for a seed-then-query-once eval (it never deletes atoms; superseded reaping is off by default). Off by default to keep the production-faithful baseline; opt in to A/B the delta."},{"name":"batch_concurrency","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":16,"minimum":1},{"type":"null"}],"description":"atomic_evolve only: override the within-example Phase-B evolution fan-out (AMEM_BATCH_EVOLVE_CONCURRENCY, default 8). This is the per-source decider+merge concurrency on ONE event loop, distinct from example_concurrency (which overlaps whole examples). None (default) uses the global setting; 1 runs Phase B serially to measure the baseline without event-loop oversubscription or hot-hub lock contention.","title":"Batch Concurrency"},"description":"atomic_evolve only: override the within-example Phase-B evolution fan-out (AMEM_BATCH_EVOLVE_CONCURRENCY, default 8). This is the per-source decider+merge concurrency on ONE event loop, distinct from example_concurrency (which overlaps whole examples). None (default) uses the global setting; 1 runs Phase B serially to measure the baseline without event-loop oversubscription or hot-hub lock contention."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LongMemEvalRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/longmemeval/score":{"post":{"tags":["eval"],"summary":"Score Longmemeval Results","description":"Judge QA accuracy and aggregate recall@k (both overall + per ability).","operationId":"score_longmemeval_results_eval_longmemeval_score_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"pace_seconds","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":120.0,"minimum":0.0},{"type":"null"}],"title":"Pace Seconds"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"description":"Per-question rows from /eval/longmemeval/run","title":"Rows"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LongMemEvalScoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/longmemeval/cancel":{"post":{"tags":["eval"],"summary":"Cancel Longmemeval Run","description":"Cancel an in-flight LongMemEval run on this worker.","operationId":"cancel_longmemeval_run_eval_longmemeval_cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"checkpoint_path","in":"query","required":true,"schema":{"type":"string","title":"Checkpoint Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/longmemeval/checkpoint":{"get":{"tags":["eval"],"summary":"Read Longmemeval Checkpoint","description":"Read a LongMemEval run checkpoint from the LangGraph store.","operationId":"read_longmemeval_checkpoint_eval_longmemeval_checkpoint_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string","description":"Checkpoint key used in the /run request.","title":"Path"},"description":"Checkpoint key used in the /run request."},{"name":"include_rows","in":"query","required":false,"schema":{"type":"boolean","description":"Include each example's full result rows (answers + recall).","default":false,"title":"Include Rows"},"description":"Include each example's full result rows (answers + recall)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__eval_longmemeval__CheckpointResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/longmemeval/cleanup":{"post":{"tags":["eval"],"summary":"Cleanup Longmemeval Memories","description":"Wipe memories seeded by a prior run (idempotent) and optional checkpoint.\n\nThe run already cleans up per example on success and sweeps its own tag\nat run end; this mops up after an interrupted run (per-example via the\ndataset, or everything eval-tagged via ``wipe_all_eval``).","operationId":"cleanup_longmemeval_memories_eval_longmemeval_cleanup_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},{"name":"max_examples","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Max Examples"}},{"name":"checkpoint_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkpoint Path"}},{"name":"wipe_all_eval","in":"query","required":false,"schema":{"type":"boolean","description":"Sweep EVERY LongMemEval namespace regardless of run tag — seeds, leases, redirects, evolution counters — without needing the dataset. This is the mop-up for runs that died mid-flight and will never be re-run (leaked seeds sit in the shared vector index and degrade production search). Do NOT use while another eval run is in flight: it deletes that run's seeds too.","default":false,"title":"Wipe All Eval"},"description":"Sweep EVERY LongMemEval namespace regardless of run tag — seeds, leases, redirects, evolution counters — without needing the dataset. This is the mop-up for runs that died mid-flight and will never be re-run (leaked seeds sit in the shared vector index and degrade production search). Do NOT use while another eval run is in flight: it deletes that run's seeds too."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__eval_longmemeval__CleanupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/memoryagentbench/run":{"post":{"tags":["eval"],"summary":"Run Mab Experiment","description":"Run MemoryAgentBench: incremental seed + probe + deterministic scoring.","operationId":"run_mab_experiment_eval_memoryagentbench_run_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"competency","in":"query","required":false,"schema":{"type":"string","default":"Conflict_Resolution","title":"Competency"}},{"name":"max_records","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Max Records"}},{"name":"search_limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":30,"title":"Search Limit"}},{"name":"chunk_chars","in":"query","required":false,"schema":{"type":"integer","maximum":200000,"minimum":512,"default":16000,"title":"Chunk Chars"}},{"name":"checkpoint_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Run id + resumable checkpoint key.","title":"Checkpoint Path"},"description":"Run id + resumable checkpoint key."},{"name":"pace_seconds","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":120.0,"minimum":0.0},{"type":"null"}],"title":"Pace Seconds"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MABRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/memoryagentbench/score":{"post":{"tags":["eval"],"summary":"Score Mab Results","description":"Aggregate already-scored rows (substring_exact_match is computed at run time).","operationId":"score_mab_results_eval_memoryagentbench_score_post","requestBody":{"content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows","description":"Scored rows from /run"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MABScoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/eval/memoryagentbench/cancel":{"post":{"tags":["eval"],"summary":"Cancel Mab Run","description":"Cancel an in-flight MemoryAgentBench run on this worker.","operationId":"cancel_mab_run_eval_memoryagentbench_cancel_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"checkpoint_path","in":"query","required":true,"schema":{"type":"string","title":"Checkpoint Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/memoryagentbench/checkpoint":{"get":{"tags":["eval"],"summary":"Read Mab Checkpoint","description":"Read a MemoryAgentBench run checkpoint.","operationId":"read_mab_checkpoint_eval_memoryagentbench_checkpoint_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"path","in":"query","required":true,"schema":{"type":"string","title":"Path"}},{"name":"include_rows","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Rows"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__eval_memoryagentbench__CheckpointResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/eval/memoryagentbench/cleanup":{"post":{"tags":["eval"],"summary":"Cleanup Mab Memories","description":"Wipe a run's seeded memories (by run_id=checkpoint_path) and the checkpoint.","operationId":"cleanup_mab_memories_eval_memoryagentbench_cleanup_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"competency","in":"query","required":false,"schema":{"type":"string","default":"Conflict_Resolution","title":"Competency"}},{"name":"max_records","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Max Records"}},{"name":"checkpoint_path","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkpoint Path"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/routes__eval_memoryagentbench__CleanupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/media/upload":{"post":{"tags":["media"],"summary":"Upload Media","description":"Accept an image or PDF upload and return a Claude content block.\n\nValidates format, size, and content signature, base64-encodes the bytes,\nand returns the content block (``image`` for images, ``document`` for\nPDFs) that the client embeds into a multi-part HumanMessage.","operationId":"upload_media_media_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_media_media_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/internal/gateway/accounts":{"get":{"tags":["Internal Gateway"],"summary":"List Gateway Accounts","description":"Return all enabled accounts that need gateway connections.\n\nCalled once on sidecar startup for bootstrap. Subsequent changes\nare delivered via Redis pub/sub (gateway:account_changes channel).\n\nThe payload spans every org on the platform (org_id, account_id, linked\nsender phone numbers, Discord guild_id), so it is gated on the internal\nAPI key, not on a customer bearer token.","operationId":"list_gateway_accounts_internal_gateway_accounts_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Gateway Accounts Internal Gateway Accounts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp_memory/mcp":{"get":{"summary":"Mcp Memory Sse Not Supported","description":"Signal to MCP clients that this server does not expose an SSE stream.\n\nThe MCP Streamable HTTP transport opens a GET to the same URL to\nestablish a server→client SSE notifications stream. This server is\nstateless and JSON-only, so we return 405 per the MCP spec instead\nof letting the request fall through as a 404.","operationId":"mcp_memory_sse_not_supported_mcp_memory_mcp_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Mcp Memory Endpoint","description":"MCP server: Streamable HTTP transport, stateless, JSON-RPC over POST.\n\nImplements the minimum surface needed by external clients: initialize,\nping, tools/list, tools/call, plus notifications/* (which expect no\nresponse).\n\nThe handshake is public: ``initialize``, ``ping``, ``tools/list`` and\nnotifications answer without a token, so a client (or a registry) can\nread the base tool surface before it has authenticated. An anonymous\ncaller sees exactly what a freshly-authenticated org with no feature\nflags would see (no per-org tools, no org-specific guidance).\n``tools/call`` requires a token and answers 401 + ``WWW-Authenticate``\notherwise; no data path is reachable anonymously.","operationId":"mcp_memory_endpoint_mcp_memory_mcp_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/":{"get":{"summary":"Root","description":"Root endpoint for Studio.","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"links":{},"schemas":{"Assistant":{"properties":{"assistant_id":{"type":"string","format":"uuid","title":"Assistant Id","description":"The ID of the assistant."},"graph_id":{"type":"string","title":"Graph Id","description":"The ID of the graph.","enum":["reflective_shell","HDRAgent","PlatformPilot","DefeasibleReasoningAgent","Dreamer","LongMemEvalSeed"]},"config":{"properties":{"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"recursion_limit":{"type":"integer","title":"Recursion Limit"},"configurable":{"type":"object","title":"Configurable"}},"type":"object","title":"Config","description":"The assistant config."},"context":{"type":"object","title":"Context","description":"Static context added to the assistant."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"The time the assistant was created."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"The last time the assistant was updated."},"metadata":{"type":"object","title":"Metadata","description":"The assistant metadata."},"version":{"type":"integer","title":"Version","description":"The version of the assistant"},"name":{"type":"string","title":"Assistant Name","description":"The name of the assistant"},"description":{"type":["string","null"],"title":"Assistant Description","description":"The description of the assistant"}},"type":"object","required":["assistant_id","graph_id","config","created_at","updated_at","metadata"],"title":"Assistant"},"AssistantCreate":{"properties":{"assistant_id":{"type":"string","format":"uuid","title":"Assistant Id","description":"The ID of the assistant. If not provided, a random UUID will be generated."},"graph_id":{"type":"string","title":"Graph Id","description":"The ID of the graph the assistant should use. The graph ID is normally set in your langgraph.json configuration.","enum":["reflective_shell","HDRAgent","PlatformPilot","DefeasibleReasoningAgent","Dreamer","LongMemEvalSeed"]},"config":{"type":"object","title":"Config","description":"Configuration to use for the graph. Useful when graph is configurable and you want to create different assistants based on different configurations."},"context":{"type":"object","title":"Context","description":"Static context added to the assistant."},"metadata":{"type":"object","title":"Metadata","description":"Metadata to add to assistant."},"if_exists":{"type":"string","enum":["raise","do_nothing"],"title":"If Exists","description":"How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing assistant).","default":"raise"},"name":{"type":"string","title":"Name","description":"The name of the assistant. Defaults to 'Untitled'."},"description":{"type":["string","null"],"title":"Description","description":"The description of the assistant. Defaults to null."}},"type":"object","required":["graph_id"],"title":"AssistantCreate","description":"Payload for creating an assistant."},"AssistantPatch":{"properties":{"graph_id":{"type":"string","title":"Graph Id","description":"The ID of the graph the assistant should use. The graph ID is normally set in your langgraph.json configuration. If not provided, assistant will keep pointing to same graph.","enum":["reflective_shell","HDRAgent","PlatformPilot","DefeasibleReasoningAgent","Dreamer","LongMemEvalSeed"]},"config":{"type":"object","title":"Config","description":"Configuration to use for the graph. Useful when graph is configurable and you want to update the assistant's configuration."},"context":{"type":"object","title":"Context","description":"Static context added to the assistant."},"metadata":{"type":"object","title":"Metadata","description":"Metadata to merge with existing assistant metadata."},"name":{"type":"string","title":"Name","description":"The new name for the assistant. If not provided, assistant will keep its current name."},"description":{"type":"string","title":"Description","description":"The new description for the assistant. If not provided, assistant will keep its current description."}},"type":"object","title":"AssistantPatch","description":"Payload for updating an assistant."},"AssistantVersionChange":{"properties":{"version":{"type":"integer","title":"Version","description":"The assistant version."}},"type":"object","title":"AssistantVersionChange","description":"Payload for changing the version of an assistant."},"Config":{"properties":{"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"recursion_limit":{"type":"integer","title":"Recursion Limit"},"configurable":{"type":"object","title":"Configurable"}},"type":"object","title":"Config"},"Cron":{"properties":{"cron_id":{"type":"string","format":"uuid","title":"Cron Id","description":"The ID of the cron."},"assistant_id":{"type":["string","null"],"format":"uuid","title":"Assistant Id","description":"The ID of the assistant."},"thread_id":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"end_time":{"type":"string","format":"date-time","title":"End Time","description":"The end date to stop running the cron."},"schedule":{"type":"string","title":"Schedule","description":"The schedule to run, cron format."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"The time the cron was created."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"The last time the cron was updated."},"user_id":{"type":["string","null"],"title":"User Id","description":"The ID of the user."},"payload":{"type":"object","title":"Payload","description":"The run payload to use for creating new run."},"next_run_date":{"type":["string","null"],"format":"date-time","title":"Next Run Date","description":"The next run date of the cron."},"metadata":{"type":"object","title":"Metadata","description":"The cron metadata."},"enabled":{"type":"boolean","title":"Enabled","description":"Whether the cron job should be enabled. Disabled crons are not executed.","default":true}},"type":"object","required":["cron_id","thread_id","end_time","schedule","created_at","updated_at","payload","enabled"],"title":"Cron","description":"Represents a scheduled task."},"CronCreate":{"properties":{"schedule":{"type":"string","title":"Schedule","description":"The cron schedule to execute this job on."},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone for the cron schedule (e.g. 'America/New_York'). Defaults to null, which is treated as UTC."},"end_time":{"type":"string","format":"date-time","title":"End Time","description":"The end date to stop running the cron."},"assistant_id":{"anyOf":[{"type":"string","format":"uuid","title":"Assistant Id"},{"type":"string","title":"Graph Id"}],"description":"The assistant ID or graph name to run. If using graph name, will default to the assistant automatically created from that graph by the server."},"input":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"object"}],"title":"Input","description":"The input to the graph."},"metadata":{"type":"object","title":"Metadata","description":"Metadata to assign to the cron job runs."},"config":{"properties":{"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"recursion_limit":{"type":"integer","title":"Recursion Limit"},"configurable":{"type":"object","title":"Configurable"}},"type":"object","title":"Config","description":"The configuration for the assistant."},"context":{"type":"object","title":"Context","description":"Static context added to the assistant."},"webhook":{"type":"string","maxLength":65536,"minLength":1,"format":"uri-reference","title":"Webhook","description":"Webhook to call after LangGraph API call is done."},"interrupt_before":{"anyOf":[{"type":"string","enum":["*"]},{"items":{"type":"string"},"type":"array"}],"title":"Interrupt Before","description":"Nodes to interrupt immediately before they get executed."},"interrupt_after":{"anyOf":[{"type":"string","enum":["*"]},{"items":{"type":"string"},"type":"array"}],"title":"Interrupt After","description":"Nodes to interrupt immediately after they get executed."},"on_run_completed":{"type":"string","enum":["delete","keep"],"default":"delete","title":"On Run Completed","description":"What to do with the thread after the run completes. 'delete' removes the thread after execution. 'keep' creates a new thread for each execution but does not clean them up."},"enabled":{"type":"boolean","title":"Enabled","description":"Whether the cron job should be enabled. Disabled crons are not executed.","default":true},"stream_mode":{"anyOf":[{"items":{"type":"string","enum":["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]},"type":"array"},{"type":"string","enum":["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]}],"title":"Stream Mode","description":"The stream mode(s) to use.","default":["values"]},"stream_subgraphs":{"type":"boolean","title":"Stream Subgraphs","description":"Whether to stream output from subgraphs.","default":false},"stream_resumable":{"type":"boolean","title":"Stream Resumable","description":"Whether to persist the stream chunks in order to resume the stream later.","default":false},"durability":{"type":"string","enum":["sync","async","exit"],"title":"Durability","description":"Durability level for the run. Must be one of `sync`, `async`, or `exit`. See [durability modes](https://docs.langchain.com/oss/python/langgraph/durable-execution#durability-modes) for more details.","default":"async"}},"type":"object","required":["assistant_id","schedule"],"additionalProperties":true,"title":"CronCreate","description":"Payload for creating a stateless cron job (creates a new thread for each execution)."},"CronPatch":{"properties":{"schedule":{"type":"string","title":"Schedule","description":"The cron schedule to execute this job on."},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone for the cron schedule (e.g. 'America/New_York'). Defaults to null, which is treated as UTC."},"end_time":{"type":["string","null"],"format":"date-time","title":"End Time","description":"The end date to stop running the cron. Send null to clear a previously set end time; omit this field to leave the existing value unchanged."},"input":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"object"}],"title":"Input","description":"The input to the graph."},"metadata":{"type":"object","title":"Metadata","description":"Metadata to merge with existing cron job metadata."},"config":{"properties":{"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"recursion_limit":{"type":"integer","title":"Recursion Limit"},"configurable":{"type":"object","title":"Configurable"}},"type":"object","title":"Config","description":"The configuration for the assistant."},"context":{"type":"object","title":"Context","description":"Static context added to the assistant."},"webhook":{"type":"string","maxLength":65536,"minLength":1,"format":"uri-reference","title":"Webhook","description":"Webhook to call after LangGraph API call is done."},"interrupt_before":{"anyOf":[{"type":"string","enum":["*"]},{"items":{"type":"string"},"type":"array"}],"title":"Interrupt Before","description":"Nodes to interrupt immediately before they get executed."},"interrupt_after":{"anyOf":[{"type":"string","enum":["*"]},{"items":{"type":"string"},"type":"array"}],"title":"Interrupt After","description":"Nodes to interrupt immediately after they get executed."},"on_run_completed":{"type":"string","enum":["delete","keep"],"title":"On Run Completed","description":"What to do with the thread after the run completes. 'delete' removes the thread after execution. 'keep' creates a new thread for each execution but does not clean them up."},"enabled":{"type":"boolean","title":"Enabled","description":"Enable or disable the cron job."},"stream_mode":{"anyOf":[{"items":{"type":"string","enum":["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]},"type":"array"},{"type":"string","enum":["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]}],"title":"Stream Mode","description":"The stream mode(s) to use.","default":["values"]},"stream_subgraphs":{"type":"boolean","title":"Stream Subgraphs","description":"Whether to stream output from subgraphs.","default":false},"stream_resumable":{"type":"boolean","title":"Stream Resumable","description":"Whether to persist the stream chunks in order to resume the stream later.","default":false},"durability":{"type":"string","enum":["sync","async","exit"],"title":"Durability","description":"Durability level for the run. Must be one of `sync`, `async`, or `exit`. See [durability modes](https://docs.langchain.com/oss/python/langgraph/durable-execution#durability-modes) for more details.","default":"async"}},"type":"object","title":"CronPatch","description":"Payload for updating a cron job. All fields are optional."},"CronSearch":{"properties":{"assistant_id":{"type":"string","format":"uuid","title":"Assistant Id","description":"The assistant ID or graph name to filter by using exact match."},"thread_id":{"type":"string","format":"uuid","title":"Thread Id","description":"The thread ID to search for."},"enabled":{"type":"boolean","title":"Enabled","description":"Filter by enabled status. If not provided, returns both enabled and disabled crons."},"metadata":{"type":"object","title":"Metadata","description":"Metadata to filter by. Exact match filter for each KV pair."},"limit":{"type":"integer","title":"Limit","description":"The maximum number of results to return.","default":10,"minimum":1,"maximum":1000},"offset":{"type":"integer","title":"Offset","description":"The number of results to skip.","default":0,"minimum":0},"sort_by":{"type":"string","title":"Sort By","description":"The field to sort by.","default":"created_at","enum":["cron_id","assistant_id","thread_id","next_run_date","end_time","created_at","updated_at"]},"sort_order":{"type":"string","title":"Sort Order","description":"The order to sort by.","default":"desc","enum":["asc","desc"]},"select":{"type":"array","items":{"type":"string","enum":["cron_id","assistant_id","thread_id","on_run_completed","end_time","schedule","timezone","created_at","updated_at","user_id","payload","next_run_date","metadata","enabled"]},"title":"Select","description":"Specify which fields to return. If not provided, all fields are returned."}},"type":"object","required":[],"title":"CronSearch","description":"Payload for listing crons"},"CronCountRequest":{"properties":{"assistant_id":{"type":"string","format":"uuid","title":"Assistant Id","description":"The assistant ID or graph name to search for."},"thread_id":{"type":"string","format":"uuid","title":"Thread Id","description":"The thread ID to search for."},"metadata":{"type":"object","title":"Metadata","description":"Metadata to filter by. Exact match filter for each KV pair."}},"type":"object","title":"CronCountRequest","description":"Payload for counting crons"},"GraphSchema":{"properties":{"graph_id":{"type":"string","title":"Graph Id","description":"The ID of the graph.","enum":["reflective_shell","HDRAgent","PlatformPilot","DefeasibleReasoningAgent","Dreamer","LongMemEvalSeed"]},"input_schema":{"type":"object","title":"Input Schema","description":"The schema for the graph input. Missing if unable to generate JSON schema from graph."},"output_schema":{"type":"object","title":"Output Schema","description":"The schema for the graph output. Missing if unable to generate JSON schema from graph."},"state_schema":{"type":"object","title":"State Schema","description":"The schema for the graph state. Missing if unable to generate JSON schema from graph."},"config_schema":{"type":"object","title":"Config Schema","description":"The schema for the graph config. Missing if unable to generate JSON schema from graph."},"context_schema":{"type":"object","title":"Context Schema","description":"The schema for the graph context. Missing if unable to generate JSON schema from graph."}},"type":"object","required":["graph_id","state_schema"],"title":"GraphSchema","description":"Defines the structure and properties of a graph."},"GraphSchemaNoId":{"properties":{"input_schema":{"type":"object","title":"Input Schema","description":"The schema for the graph input. Missing if unable to generate JSON schema from graph."},"output_schema":{"type":"object","title":"Output Schema","description":"The schema for the graph output. Missing if unable to generate JSON schema from graph."},"state_schema":{"type":"object","title":"State Schema","description":"The schema for the graph state. Missing if unable to generate JSON schema from graph."},"config_schema":{"type":"object","title":"Config Schema","description":"The schema for the graph config. Missing if unable to generate JSON schema from graph."},"context_schema":{"type":"object","title":"Context Schema","description":"The schema for the graph context. Missing if unable to generate JSON schema from graph."}},"type":"object","required":["input_schema","output_schema","state_schema"],"title":"GraphSchemaNoId","description":"Defines the structure and properties of a graph without an ID."},"Subgraphs":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/GraphSchemaNoId"},"title":"Subgraphs","description":"Map of graph name to graph schema metadata (`input_schema`, `output_schema`, `state_schema`, `config_schema`, `context_schema`)."},"Run":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id","description":"The ID of the run."},"thread_id":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"assistant_id":{"type":"string","format":"uuid","title":"Assistant Id","description":"The assistant that was used for this run."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"The time the run was created."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"The last time the run was updated."},"status":{"type":"string","enum":["pending","running","error","success","timeout","interrupted"],"title":"Status","description":"The status of the run. One of 'pending', 'running', 'error', 'success', 'timeout', 'interrupted'."},"metadata":{"type":"object","title":"Metadata","description":"The run metadata."},"kwargs":{"type":"object","title":"Kwargs"},"multitask_strategy":{"type":"string","enum":["reject","rollback","interrupt","enqueue"],"title":"Multitask Strategy","description":"Strategy to handle concurrent runs on the same thread."},"langsmith_session_name":{"type":"string","title":"Langsmith Session Name","description":"LangSmith tracing session (project) name for this run, when tracing is enabled at creation time.","nullable":true}},"type":"object","required":["run_id","thread_id","assistant_id","created_at","updated_at","status","metadata","kwargs","multitask_strategy"],"title":"Run"},"Send":{"type":"object","title":"Send","description":"A message to send to a node.","properties":{"node":{"type":"string","title":"Node","description":"The node to send the message to."},"input":{"type":["object","array","number","string","boolean","null"],"title":"Message","description":"The message to send."}},"required":["node","input"]},"Command":{"type":"object","title":"Command","description":"The command to run.","properties":{"update":{"type":["object","array","null"],"title":"Update","description":"An update to the state."},"resume":{"type":["object","array","number","string","boolean","null"],"title":"Resume","description":"A value to pass to an interrupted node."},"goto":{"anyOf":[{"$ref":"#/components/schemas/Send"},{"type":"array","items":{"$ref":"#/components/schemas/Send"}},{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}],"title":"Goto","description":"Name of the node(s) to navigate to next or node(s) to be executed with a provided input."}}},"RunCreateStateful":{"properties":{"assistant_id":{"anyOf":[{"type":"string","format":"uuid","title":"Assistant Id"},{"type":"string","title":"Graph Id"}],"description":"The assistant ID or graph name to run. If using graph name, will default to first assistant created from that graph."},"checkpoint":{"type":"object","title":"Checkpoint","description":"The checkpoint to resume from.","$ref":"#/components/schemas/CheckpointConfig"},"input":{"anyOf":[{"type":"object"},{"type":"array"},{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}],"title":"Input","description":"The input to the graph."},"command":{"anyOf":[{"$ref":"#/components/schemas/Command"},{"type":"null"}],"title":"Input","description":"The input to the graph."},"metadata":{"type":"object","title":"Metadata","description":"Metadata to assign to the run."},"config":{"properties":{"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"recursion_limit":{"type":"integer","title":"Recursion Limit"},"configurable":{"type":"object","title":"Configurable"}},"type":"object","title":"Config","description":"The configuration for the assistant."},"context":{"type":"object","title":"Context","description":"Static context added to the assistant."},"webhook":{"type":"string","maxLength":65536,"minLength":1,"format":"uri-reference","title":"Webhook","description":"Webhook to call after LangGraph API call is done."},"interrupt_before":{"anyOf":[{"type":"string","enum":["*"]},{"items":{"type":"string"},"type":"array"}],"title":"Interrupt Before","description":"Nodes to interrupt immediately before they get executed."},"interrupt_after":{"anyOf":[{"type":"string","enum":["*"]},{"items":{"type":"string"},"type":"array"}],"title":"Interrupt After","description":"Nodes to interrupt immediately after they get executed."},"stream_mode":{"anyOf":[{"items":{"type":"string","enum":["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]},"type":"array"},{"type":"string","enum":["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]}],"title":"Stream Mode","description":"The stream mode(s) to use.","default":["values"]},"stream_subgraphs":{"type":"boolean","title":"Stream Subgraphs","description":"Whether to stream output from subgraphs.","default":false},"stream_resumable":{"type":"boolean","title":"Stream Resumable","description":"Whether to persist the stream chunks in order to resume the stream later.","default":false},"feedback_keys":{"items":{"type":"string"},"type":"array","title":"Feedback Keys","description":"Generate pre-signed URLs for assigning feedback keys to the run.\n\nFor each key specified, a unique URL will be generated that can be called to assign the feedback key to the run. See [LangSmith Feedback](https://docs.langchain.com/langsmith/observability-concepts#feedback) for more details."},"multitask_strategy":{"type":"string","enum":["reject","rollback","interrupt","enqueue"],"title":"Multitask Strategy","description":"Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.","default":"enqueue"},"if_not_exists":{"type":"string","enum":["create","reject"],"title":"If Not Exists","description":"How to handle missing thread. Must be either 'reject' (raise error if missing), or 'create' (create new thread).","default":"reject"},"after_seconds":{"type":"number","title":"After Seconds","description":"The number of seconds to wait before starting the run. Use to schedule future runs."},"checkpoint_during":{"type":"boolean","title":"Checkpoint During","description":"Whether to checkpoint during the run.\n\nDeprecated. Use `durability` instead to control checkpoint persistence behavior during the run.","deprecated":true,"default":false},"durability":{"type":"string","enum":["sync","async","exit"],"title":"Durability","description":"Durability level for the run. Must be one of `sync`, `async`, or `exit`. See [durability modes](https://docs.langchain.com/oss/python/langgraph/durable-execution#durability-modes) for more details.","default":"async"}},"type":"object","required":["assistant_id"],"title":"RunCreateStateful","description":"Payload for creating a run."},"RunBatchCreate":{"type":"array","items":{"$ref":"#/components/schemas/RunCreateStateless"},"minItems":1,"title":"RunBatchCreate","description":"Payload for creating a batch of runs."},"RunCreateStateless":{"properties":{"assistant_id":{"anyOf":[{"type":"string","format":"uuid","title":"Assistant Id"},{"type":"string","title":"Graph Id"}],"description":"The assistant ID or graph name to run. If using graph name, will default to first assistant created from that graph."},"input":{"anyOf":[{"type":"object"},{"type":"array"},{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}],"title":"Input","description":"The input to the graph."},"command":{"anyOf":[{"$ref":"#/components/schemas/Command"},{"type":"null"}],"title":"Input","description":"The input to the graph."},"metadata":{"type":"object","title":"Metadata","description":"Metadata to assign to the run."},"config":{"properties":{"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"recursion_limit":{"type":"integer","title":"Recursion Limit"},"configurable":{"type":"object","title":"Configurable"}},"type":"object","title":"Config","description":"The configuration for the assistant."},"context":{"type":"object","title":"Context","description":"Static context added to the assistant."},"webhook":{"type":"string","maxLength":65536,"minLength":1,"format":"uri-reference","title":"Webhook","description":"Webhook to call after LangGraph API call is done."},"stream_mode":{"anyOf":[{"items":{"type":"string","enum":["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]},"type":"array"},{"type":"string","enum":["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]}],"title":"Stream Mode","description":"The stream mode(s) to use.","default":["values"]},"feedback_keys":{"items":{"type":"string"},"type":"array","title":"Feedback Keys","description":"Generate pre-signed URLs for assigning feedback keys to the run.\n\nFor each key specified, a unique URL will be generated that can be called to assign the feedback key to the run. See [LangSmith Feedback](https://docs.langchain.com/langsmith/observability-concepts#feedback) for more details."},"stream_subgraphs":{"type":"boolean","title":"Stream Subgraphs","description":"Whether to stream output from subgraphs.","default":false},"stream_resumable":{"type":"boolean","title":"Stream Resumable","description":"Whether to persist the stream chunks in order to resume the stream later.","default":false},"on_completion":{"type":"string","enum":["delete","keep"],"title":"On Completion","description":"Whether to delete or keep the thread created for a stateless run. Must be one of 'delete' or 'keep'.","default":"delete"},"after_seconds":{"type":"number","title":"After Seconds","description":"The number of seconds to wait before starting the run. Use to schedule future runs."},"checkpoint_during":{"type":"boolean","title":"Checkpoint During","description":"Whether to checkpoint during the run.\n\nDeprecated. Use `durability` instead to control checkpoint persistence behavior during the run.","deprecated":true,"default":false},"durability":{"type":"string","enum":["sync","async","exit"],"title":"Durability","description":"Durability level for the run. Must be one of `sync`, `async`, or `exit`. See [durability modes](https://docs.langchain.com/oss/python/langgraph/durable-execution#durability-modes) for more details.","default":"async"}},"type":"object","required":["assistant_id"],"title":"RunCreateStateless","description":"Payload for creating a run."},"AssistantSearchRequest":{"properties":{"metadata":{"type":"object","title":"Metadata","description":"Metadata to filter by. Exact match filter for each KV pair."},"graph_id":{"type":"string","title":"Graph Id","description":"The ID of the graph to filter by. The graph ID is normally set in your langgraph.json configuration.","enum":["reflective_shell","HDRAgent","PlatformPilot","DefeasibleReasoningAgent","Dreamer","LongMemEvalSeed"]},"name":{"type":"string","title":"Name","description":"Name of the assistant to filter by. The filtering logic will match (case insensitive) assistants where 'name' is a substring of the assistant name."},"limit":{"type":"integer","title":"Limit","description":"The maximum number of results to return.","default":10,"minimum":1,"maximum":1000},"offset":{"type":"integer","title":"Offset","description":"The number of results to skip.","default":0,"minimum":0},"sort_by":{"type":"string","enum":["assistant_id","created_at","updated_at","name","graph_id"],"title":"Sort By","description":"The field to sort by."},"sort_order":{"type":"string","enum":["asc","desc"],"title":"Sort Order","description":"The order to sort by."},"select":{"type":"array","items":{"type":"string","enum":["assistant_id","graph_id","name","description","config","context","created_at","updated_at","metadata","version"]},"title":"Select","description":"Specify which fields to return. If not provided, all fields are returned."}},"type":"object","title":"AssistantSearchRequest","description":"Payload for listing assistants."},"AssistantCountRequest":{"properties":{"metadata":{"type":"object","title":"Metadata","description":"Metadata to filter by. Exact match filter for each KV pair."},"graph_id":{"type":"string","title":"Graph Id","description":"The ID of the graph to filter by. The graph ID is normally set in your langgraph.json configuration."},"name":{"type":"string","title":"Name","description":"Name of the assistant to filter by. The filtering logic will match (case insensitive) assistants where 'name' is a substring of the assistant name."}},"type":"object","title":"AssistantCountRequest","description":"Payload for counting assistants."},"AssistantVersionsSearchRequest":{"properties":{"metadata":{"type":"object","title":"Metadata","description":"Metadata to filter versions by. Exact match filter for each KV pair."},"limit":{"type":"integer","title":"Limit","description":"The maximum number of versions to return.","default":10,"minimum":1,"maximum":1000},"offset":{"type":"integer","title":"Offset","description":"The number of versions to skip.","default":0,"minimum":0}},"type":"object","title":"SearchRequest","description":"Payload for listing assistant versions."},"ThreadSearchRequest":{"properties":{"ids":{"type":"array","items":{"type":"string","format":"uuid"},"title":"Ids","description":"List of thread IDs to include. Others are excluded."},"metadata":{"type":"object","title":"Metadata","description":"Thread metadata to filter on."},"values":{"type":"object","title":"Values","description":"State values to filter on."},"status":{"type":"string","enum":["idle","busy","interrupted","error"],"title":"Status","description":"Thread status to filter on."},"limit":{"type":"integer","title":"Limit","description":"Maximum number to return.","default":10,"minimum":1,"maximum":1000},"offset":{"type":"integer","title":"Offset","description":"Offset to start from.","default":0,"minimum":0},"sort_by":{"type":"string","enum":["thread_id","status","created_at","updated_at","state_updated_at"],"title":"Sort By","description":"Sort by field."},"sort_order":{"type":"string","enum":["asc","desc"],"title":"Sort Order","description":"Sort order."},"select":{"type":"array","items":{"type":"string","enum":["thread_id","created_at","updated_at","state_updated_at","metadata","config","status","values","interrupts"]},"title":"Select","description":"Specify which fields to return. If not provided, all fields are returned."},"extract":{"type":"object","additionalProperties":{"type":"string"},"title":"Extract","description":"Map of alias to JSONB path for extracting specific values. Paths must start with values, metadata, config, or interrupts. Example: {\"last_msg\": \"values.messages[-1]\"}.","maxProperties":10}},"type":"object","title":"ThreadSearchRequest","description":"Payload for listing threads."},"ThreadCountRequest":{"properties":{"metadata":{"type":"object","title":"Metadata","description":"Thread metadata to filter on."},"values":{"type":"object","title":"Values","description":"State values to filter on."},"status":{"type":"string","enum":["idle","busy","interrupted","error"],"title":"Status","description":"Thread status to filter on."}},"type":"object","title":"ThreadCountRequest","description":"Payload for counting threads."},"Thread":{"properties":{"thread_id":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread."},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"The time the thread was created."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"The last time the thread was updated."},"state_updated_at":{"type":"string","format":"date-time","title":"State Updated At","description":"The last time the thread state was updated."},"metadata":{"type":"object","title":"Metadata","description":"The thread metadata."},"config":{"type":"object","title":"Config","description":"The thread config."},"status":{"type":"string","enum":["idle","busy","interrupted","error"],"title":"Status","description":"The status of the thread."},"values":{"type":"object","title":"Values","description":"The current state of the thread."},"interrupts":{"type":"object","title":"Interrupts","description":"The current interrupts of the thread."},"ttl":{"type":"object","title":"TTL Info","description":"TTL information if set for this thread. Only present when ?include=ttl is passed.","properties":{"strategy":{"type":"string","enum":["delete","keep_latest"],"description":"The TTL strategy."},"ttl_minutes":{"type":"number","description":"The TTL in minutes."},"expires_at":{"type":"string","format":"date-time","description":"When the thread will expire."}}},"extracted":{"type":"object","title":"Extracted","description":"Extracted values from thread JSONB columns, populated when extract is specified in search request."}},"type":"object","required":["thread_id","created_at","updated_at","metadata","status"],"title":"Thread"},"ThreadCreate":{"properties":{"thread_id":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread. If not provided, a random UUID will be generated."},"metadata":{"type":"object","title":"Metadata","description":"Metadata to add to thread."},"if_exists":{"type":"string","enum":["raise","do_nothing"],"title":"If Exists","description":"How to handle duplicate creation. Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread).","default":"raise"},"ttl":{"type":"object","title":"TTL","description":"The time-to-live for the thread.","properties":{"strategy":{"type":"string","enum":["delete","keep_latest"],"description":"The TTL strategy. 'delete' removes the entire thread. 'keep_latest' prunes old checkpoints but keeps the thread and its latest state.","default":"delete"},"ttl":{"type":"number","description":"The time-to-live in minutes from now until thread should be swept."}}},"supersteps":{"type":"array","items":{"type":"object","properties":{"updates":{"type":"array","items":{"$ref":"#/components/schemas/ThreadSuperstepUpdate"}}},"required":["updates"]}}},"type":"object","title":"ThreadCreate","description":"Payload for creating a thread."},"ThreadPatch":{"properties":{"metadata":{"type":"object","title":"Metadata","description":"Metadata to merge with existing thread metadata."},"ttl":{"type":"object","title":"TTL","description":"The time-to-live for the thread.","properties":{"strategy":{"type":"string","enum":["delete","keep_latest"],"description":"The TTL strategy. 'delete' removes the entire thread. 'keep_latest' prunes old checkpoints but keeps the thread and its latest state.","default":"delete"},"ttl":{"type":"number","description":"The time-to-live in minutes from now until thread should be swept."}}}},"type":"object","title":"ThreadPatch","description":"Payload for updating a thread."},"ThreadPruneRequest":{"properties":{"thread_ids":{"type":"array","items":{"type":"string","format":"uuid"},"title":"Thread IDs","description":"List of thread IDs to prune."},"strategy":{"type":"string","enum":["delete","keep_latest"],"title":"Strategy","description":"The prune strategy. 'delete' removes threads entirely. 'keep_latest' prunes old checkpoints but keeps threads and their latest state.","default":"delete"}},"required":["thread_ids"],"type":"object","title":"ThreadPruneRequest","description":"Payload for pruning threads."},"ThreadPruneResponse":{"properties":{"pruned_count":{"type":"integer","title":"Pruned Count","description":"Number of threads successfully pruned."}},"required":["pruned_count"],"type":"object","title":"ThreadPruneResponse","description":"Response from pruning threads."},"ThreadStateCheckpointRequest":{"properties":{"checkpoint":{"$ref":"#/components/schemas/CheckpointConfig","title":"Checkpoint","description":"The checkpoint to get the state for."},"subgraphs":{"type":"boolean","title":"Subgraphs","description":"Include subgraph states."}},"required":["checkpoint"],"type":"object","title":"ThreadStateCheckpointRequest","description":"Payload for getting the state of a thread at a checkpoint."},"ThreadState":{"properties":{"values":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"object"}],"title":"Values"},"next":{"items":{"type":"string"},"type":"array","title":"Next"},"tasks":{"items":{"type":"object","properties":{"id":{"type":"string","title":"Task Id"},"name":{"type":"string","title":"Node Name"},"error":{"type":"string","title":"Error"},"interrupts":{"type":"array","items":{"$ref":"#/components/schemas/Interrupt"}},"checkpoint":{"$ref":"#/components/schemas/CheckpointConfig","title":"Checkpoint"},"state":{"$ref":"#/components/schemas/ThreadState"}},"required":["id","name"]},"type":"array","title":"Tasks"},"checkpoint":{"$ref":"#/components/schemas/CheckpointConfig","title":"Checkpoint"},"metadata":{"type":"object","title":"Metadata"},"created_at":{"type":"string","title":"Created At"},"parent_checkpoint":{"type":"object","title":"Parent Checkpoint"},"interrupts":{"type":"array","items":{"$ref":"#/components/schemas/Interrupt"}}},"type":"object","required":["values","next","checkpoint","metadata","created_at"],"title":"ThreadState"},"ThreadStateSearch":{"properties":{"limit":{"type":"integer","title":"Limit","description":"The maximum number of states to return.","default":1,"maximum":1000,"minimum":1},"before":{"title":"Before","description":"Return states before this checkpoint.","$ref":"#/components/schemas/CheckpointConfig"},"metadata":{"type":"object","title":"Metadata","description":"Filter states by metadata key-value pairs."},"checkpoint":{"$ref":"#/components/schemas/CheckpointConfig","title":"Checkpoint","description":"Return states for this subgraph."}},"type":"object","title":"ThreadStateSearch"},"ThreadStateUpdate":{"properties":{"values":{"anyOf":[{"items":{},"type":"array"},{"type":"object"},{"type":"null"}],"title":"Values","description":"The values to update the state with."},"checkpoint":{"$ref":"#/components/schemas/CheckpointConfig","title":"Checkpoint","description":"The checkpoint to update the state of."},"as_node":{"type":"string","title":"As Node","description":"Update the state as if this node had just executed."}},"type":"object","title":"ThreadStateUpdate","description":"Payload for updating the state of a thread."},"ThreadSuperstepUpdate":{"properties":{"values":{"anyOf":[{"type":"array","items":{"type":"object"}},{"type":"object"},{"type":"null"}]},"command":{"anyOf":[{"$ref":"#/components/schemas/Command"},{"type":"null"}],"description":"The command associated with the update."},"as_node":{"type":"string","description":"Update the state as if this node had just executed."}},"required":["as_node"],"type":"object"},"ThreadStateUpdateResponse":{"properties":{"checkpoint":{"type":"object","title":"Checkpoint"}},"type":"object","title":"ThreadStateUpdateResponse","description":"Response for adding state to a thread."},"CheckpointConfig":{"type":"object","title":"CheckpointConfig","description":"Checkpoint config.","properties":{"thread_id":{"type":"string","description":"Unique identifier for the thread associated with this checkpoint."},"checkpoint_ns":{"type":"string","description":"Namespace for the checkpoint, used for organization and retrieval."},"checkpoint_id":{"type":"string","description":"Optional unique identifier for the checkpoint itself."},"checkpoint_map":{"type":"object","description":"Optional dictionary containing checkpoint-specific data."}}},"StorePutRequest":{"type":"object","required":["namespace","key","value"],"properties":{"namespace":{"type":"array","items":{"type":"string"},"title":"Namespace","description":"A list of strings representing the namespace path."},"key":{"type":"string","title":"Key","description":"The unique identifier for the item within the namespace."},"value":{"type":"object","title":"Value","description":"A dictionary containing the item's data."},"index":{"oneOf":[{"type":"boolean","enum":[false]},{"type":"array","items":{"type":"string"}},{"type":"null"}],"default":null,"title":"Index","description":"Controls search indexing - null (use defaults), false (disable), or list of field paths to index."},"ttl":{"type":["number","null"],"default":null,"title":"TTL","description":"Optional time-to-live in minutes for the item, or null for no expiration."}},"title":"StorePutRequest","description":"Request to store or update an item."},"StoreDeleteRequest":{"type":"object","required":["key"],"properties":{"namespace":{"type":"array","items":{"type":"string"},"title":"Namespace","description":"A list of strings representing the namespace path."},"key":{"type":"string","title":"Key","description":"The unique identifier for the item."}},"title":"StoreDeleteRequest","description":"Request to delete an item."},"StoreSearchRequest":{"type":"object","properties":{"namespace_prefix":{"type":["array","null"],"items":{"type":"string"},"title":"Namespace Prefix","description":"List of strings representing the namespace prefix."},"filter":{"type":["object","null"],"additionalProperties":true,"title":"Filter","description":"Optional dictionary of key-value pairs to filter results."},"limit":{"type":"integer","default":10,"title":"Limit","description":"Maximum number of items to return (default is 10)."},"offset":{"type":"integer","default":0,"title":"Offset","description":"Number of items to skip before returning results (default is 0)."},"query":{"type":["string","null"],"title":"Query","description":"Optional natural language search query. If not provided, items are returned ordered by last updated time (listing mode). If provided, performs a natural language search over item contents."},"refresh_ttl":{"type":["boolean","null"],"default":null,"title":"Refresh TTL","description":"Whether to refresh the TTL on items returned by this search. If null, uses the store's default behavior."}},"title":"StoreSearchRequest","description":"Request to list or search for items within a namespace prefix. Without a query, lists items by last updated time. With a query, performs natural language search."},"StoreListNamespacesRequest":{"type":"object","properties":{"prefix":{"type":"array","items":{"type":"string"},"title":"Prefix","description":"Optional list of strings representing the prefix to filter namespaces."},"suffix":{"type":"array","items":{"type":"string"},"title":"Suffix","description":"Optional list of strings representing the suffix to filter namespaces."},"max_depth":{"type":"integer","title":"Max Depth","description":"Optional integer specifying the maximum depth of namespaces to return."},"limit":{"type":"integer","default":100,"title":"Limit","description":"Maximum number of namespaces to return (default is 100)."},"offset":{"type":"integer","default":0,"title":"Offset","description":"Number of namespaces to skip before returning results (default is 0)."}}},"Item":{"type":"object","required":["namespace","key","value","created_at","updated_at"],"properties":{"namespace":{"type":"array","items":{"type":"string"},"description":"The namespace of the item. A namespace is analogous to a document's directory."},"key":{"type":"string","description":"The unique identifier of the item within its namespace. In general, keys needn't be globally unique."},"value":{"type":"object","description":"The value stored in the item. This is the document itself."},"created_at":{"type":"string","format":"date-time","description":"The timestamp when the item was created."},"updated_at":{"type":"string","format":"date-time","description":"The timestamp when the item was last updated."}},"description":"Represents a single document or data entry in the graph's Store. Items are used to store cross-thread memories."},"RunsCancel":{"type":"object","title":"RunsCancel","description":"Payload for cancelling runs.","properties":{"status":{"type":"string","enum":["pending","running","all"],"title":"Status","description":"Filter runs by status to cancel. Must be one of 'pending', 'running', or 'all'."},"thread_id":{"type":"string","format":"uuid","title":"Thread Id","description":"The ID of the thread containing runs to cancel."},"run_ids":{"type":"array","items":{"type":"string","format":"uuid"},"title":"Run Ids","description":"List of run IDs to cancel."}},"oneOf":[{"required":["status"]},{"required":["thread_id","run_ids"]}]},"SearchItemsResponse":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Item"}}}},"ListNamespaceResponse":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"ErrorResponse":{"type":"object","required":["detail"],"properties":{"detail":{"type":"string","description":"Human-readable error message"}},"title":"ErrorResponse","description":"Error response returned from the server"},"ThreadCronCreate":{"properties":{"schedule":{"type":"string","title":"Schedule","description":"The cron schedule to execute this job on."},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone for the cron schedule (e.g. 'America/New_York'). Defaults to null, which is treated as UTC."},"end_time":{"type":"string","format":"date-time","title":"End Time","description":"The end date to stop running the cron."},"assistant_id":{"anyOf":[{"type":"string","format":"uuid","title":"Assistant Id"},{"type":"string","title":"Graph Id"}],"description":"The assistant ID or graph name to run. If using graph name, will default to the assistant automatically created from that graph by the server."},"input":{"anyOf":[{"items":{"type":"object"},"type":"array"},{"type":"object"}],"title":"Input","description":"The input to the graph."},"metadata":{"type":"object","title":"Metadata","description":"Metadata to assign to the cron job runs."},"config":{"properties":{"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"recursion_limit":{"type":"integer","title":"Recursion Limit"},"configurable":{"type":"object","title":"Configurable"}},"type":"object","title":"Config","description":"The configuration for the assistant."},"context":{"type":"object","title":"Context","description":"Static context added to the assistant."},"webhook":{"type":"string","maxLength":65536,"minLength":1,"format":"uri-reference","title":"Webhook","description":"Webhook to call after LangGraph API call is done."},"interrupt_before":{"anyOf":[{"type":"string","enum":["*"]},{"items":{"type":"string"},"type":"array"}],"title":"Interrupt Before","description":"Nodes to interrupt immediately before they get executed."},"interrupt_after":{"anyOf":[{"type":"string","enum":["*"]},{"items":{"type":"string"},"type":"array"}],"title":"Interrupt After","description":"Nodes to interrupt immediately after they get executed."},"multitask_strategy":{"type":"string","enum":["reject","rollback","interrupt","enqueue"],"title":"Multitask Strategy","description":"Multitask strategy to use. Must be one of 'reject', 'interrupt', 'rollback', or 'enqueue'.","default":"enqueue"},"enabled":{"type":"boolean","title":"Enabled","description":"Whether the cron job should be enabled. Disabled crons are not executed.","default":true},"stream_mode":{"anyOf":[{"items":{"type":"string","enum":["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]},"type":"array"},{"type":"string","enum":["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]}],"title":"Stream Mode","description":"The stream mode(s) to use.","default":["values"]},"stream_subgraphs":{"type":"boolean","title":"Stream Subgraphs","description":"Whether to stream output from subgraphs.","default":false},"stream_resumable":{"type":"boolean","title":"Stream Resumable","description":"Whether to persist the stream chunks in order to resume the stream later.","default":false},"durability":{"type":"string","enum":["sync","async","exit"],"title":"Durability","description":"Durability level for the run. Must be one of `sync`, `async`, or `exit`. See [durability modes](https://docs.langchain.com/oss/python/langgraph/durable-execution#durability-modes) for more details.","default":"async"}},"type":"object","required":["assistant_id","schedule"],"title":"ThreadCronCreate","description":"Payload for creating a thread-specific cron job (runs on the same thread)."},"Interrupt":{"type":"object","properties":{"id":{"type":["string","null"]},"value":{"type":"object"}},"title":"Interrupt","required":["value"]},"RunCreateStreamingStateful":{"allOf":[{"$ref":"#/components/schemas/RunCreateStateful"},{"type":"object","properties":{"on_disconnect":{"type":"string","enum":["cancel","continue"],"title":"On Disconnect","description":"The disconnect mode to use. Must be one of 'cancel' or 'continue'.","default":"continue"}}}],"title":"RunCreateStreamingStateful"},"RunCreateStreamingStateless":{"allOf":[{"$ref":"#/components/schemas/RunCreateStateless"},{"type":"object","properties":{"on_disconnect":{"type":"string","enum":["cancel","continue"],"title":"On Disconnect","description":"The disconnect mode to use. Must be one of 'cancel' or 'continue'.","default":"continue"}}}],"title":"RunCreateStreamingStateless"},"ProtocolChannel":{"type":"string","title":"Protocol Channel","description":"Subscribable event channel. One of the eight fixed channels or a user-defined `custom:<name>` namespaced custom channel emitted by a stream transformer. `debug` and `checkpoints` were removed from the protocol in `@langchain/protocol@0.0.10` — task-level debug info now flows on the `tasks` channel, and checkpoint pointers ride on `values` events as an attached `checkpoint` envelope.","anyOf":[{"type":"string","enum":["values","updates","messages","tools","lifecycle","input","tasks","custom"]},{"type":"string","pattern":"^custom:.+$","description":"User-defined namespaced custom channel."}]},"ProtocolNamespace":{"type":"array","items":{"type":"string"},"title":"Protocol Namespace","description":"Hierarchical path identifying a position in the agent tree. Empty array denotes the root agent; each segment names a nested subgraph."},"ProtocolEventStreamRequest":{"type":"object","title":"ProtocolEventStreamRequest","description":"Body of `POST /threads/{thread_id}/stream/events`. Filters the connection-scoped SSE stream.","required":["channels"],"properties":{"channels":{"type":"array","items":{"$ref":"#/components/schemas/ProtocolChannel"},"minItems":1,"description":"Channels to subscribe to for the lifetime of this connection."},"namespaces":{"type":"array","items":{"$ref":"#/components/schemas/ProtocolNamespace"},"description":"Prefix-match filter. An event matches if its namespace starts with any of these prefixes. Omit for all namespaces."},"depth":{"type":"integer","minimum":0,"description":"Max depth below the namespace prefix. Omit for unbounded depth."},"since":{"type":"integer","minimum":0,"description":"Replay events with `seq` greater than this value before streaming live events."}},"additionalProperties":true},"ProtocolCommand":{"type":"object","title":"ProtocolCommand","description":"A client → server command envelope. Known methods: `run.start`, `input.respond`, `subscription.subscribe` (WS only), `subscription.unsubscribe` (WS only), `agent.getTree`.","required":["id","method"],"properties":{"id":{"type":"integer","minimum":0,"description":"Client-assigned command id; echoed in the response."},"method":{"type":"string","description":"Command method name (e.g. `run.start`)."},"params":{"type":"object","description":"Method-specific parameters. See the CDDL spec for per-method shapes.","additionalProperties":true}},"additionalProperties":true},"ProtocolResponseMeta":{"type":"object","title":"ProtocolResponseMeta","description":"Optional metadata attached to command responses.","properties":{"applied_through_seq":{"type":"integer","minimum":0,"description":"Highest event `seq` observed on the session when this response was generated."}},"additionalProperties":true},"ProtocolSuccess":{"type":"object","title":"ProtocolSuccess","description":"Successful command response.","required":["type","id","result"],"properties":{"type":{"type":"string","const":"success"},"id":{"type":"integer","minimum":0},"result":{"type":"object","description":"Method-specific result payload.","additionalProperties":true},"meta":{"$ref":"#/components/schemas/ProtocolResponseMeta"}},"additionalProperties":true},"ProtocolError":{"type":"object","title":"ProtocolError","description":"Error response for a command.","required":["type","id","error","message"],"properties":{"type":{"type":"string","const":"error"},"id":{"oneOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"The `id` of the offending command, or null if the envelope was unparseable."},"error":{"type":"string","enum":["invalid_argument","unknown_command","unknown_error","no_such_run","no_such_subscription","no_such_namespace","no_such_interrupt","no_such_checkpoint","permission_denied","not_supported"]},"message":{"type":"string"},"stacktrace":{"type":"string"},"meta":{"$ref":"#/components/schemas/ProtocolResponseMeta"}},"additionalProperties":true},"ProtocolEvent":{"type":"object","title":"ProtocolEvent","description":"A server → client event. Sent as JSON over WebSocket, or as the `data:` field of an SSE frame (with `event:` set to `method` and `id:` set to `seq`).","required":["type","method","params"],"properties":{"type":{"type":"string","const":"event"},"event_id":{"type":"string","description":"Unique ID for reconnection (mirrored to SSE `id:`)."},"seq":{"type":"integer","minimum":0,"description":"Monotonic per-session sequence number for ordering and replay."},"method":{"type":"string","description":"Channel method name (e.g. `messages`, `tools`, `lifecycle`, `custom:my_channel`)."},"params":{"type":"object","required":["namespace","timestamp","data"],"properties":{"namespace":{"$ref":"#/components/schemas/ProtocolNamespace"},"timestamp":{"type":"integer","description":"Wall-clock milliseconds since Unix epoch. Use `seq` for ordering."},"data":{"description":"Channel-specific payload. See the CDDL spec for per-channel shapes."},"node":{"type":"string","description":"Graph node that produced this event (messages, tools)."}},"additionalProperties":true}},"additionalProperties":true},"APIResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"data":{"anyOf":[{},{"type":"null"}],"title":"Data"}},"type":"object","required":["success","message"],"title":"APIResponse","description":"Standard API response."},"ActiveServersResponse":{"properties":{"active_servers":{"items":{"type":"string"},"type":"array","title":"Active Servers"},"excluded_servers":{"items":{"$ref":"#/components/schemas/ExcludedServer"},"type":"array","title":"Excluded Servers"},"total_enabled":{"type":"integer","title":"Total Enabled"}},"type":"object","required":["active_servers","excluded_servers","total_enabled"],"title":"ActiveServersResponse","description":"Response for active servers endpoint."},"AdminViewState":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"AdminViewState","description":"Response shape for the admin-view endpoints."},"AdminViewUpdate":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"AdminViewUpdate","description":"Request body for PUT /organizations/{org_id}/admin-view."},"AgentEnvironmentResponse":{"properties":{"cloud_providers":{"additionalProperties":{"$ref":"#/components/schemas/CloudProviderResponse"},"type":"object","title":"Cloud Providers"},"clusters":{"additionalProperties":{"$ref":"#/components/schemas/KubernetesClusterResponse"},"type":"object","title":"Clusters"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["cloud_providers","clusters"],"title":"AgentEnvironmentResponse","description":"Response schema for complete Agent Environment."},"AgentEnvironmentValidationResult":{"properties":{"valid":{"type":"boolean","title":"Valid"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"cloud_providers_count":{"type":"integer","title":"Cloud Providers Count"},"clusters_count":{"type":"integer","title":"Clusters Count"}},"type":"object","required":["valid","cloud_providers_count","clusters_count"],"title":"AgentEnvironmentValidationResult","description":"Response schema for environment validation."},"AgentSettingsResponse":{"properties":{"event_threads_enabled":{"type":"boolean","title":"Event Threads Enabled","description":"Whether automatic thread creation from events is enabled"},"web_search_enabled":{"type":"boolean","title":"Web Search Enabled","description":"Whether web search is enabled"},"web_search_max_uses":{"type":"integer","title":"Web Search Max Uses","description":"Max web searches per minute (rolling window)"},"web_extract_enabled":{"type":"boolean","title":"Web Extract Enabled","description":"Whether URL extraction is enabled"},"web_extract_max_uses":{"type":"integer","title":"Web Extract Max Uses","description":"Max URL extractions per minute (rolling window)"},"web_extract_depth":{"type":"string","title":"Web Extract Depth","description":"Extraction depth: 'basic' or 'advanced'"},"memory_enabled":{"type":"boolean","title":"Memory Enabled","description":"Whether investigation memory (A-mem) is enabled"},"memory_maintenance_enabled":{"type":"boolean","title":"Memory Maintenance Enabled","description":"Whether background memory maintenance is enabled"},"dr_input_capture_enabled":{"type":"boolean","title":"Dr Input Capture Enabled","description":"Whether evaluation-run input capture is enabled"},"dr_gate_auto_delta_max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Dr Gate Auto Delta Max","description":"Org override for the 'auto' consumption-gate ceiling (null = deployment default)"},"dr_gate_suggest_delta_max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Dr Gate Suggest Delta Max","description":"Org override for the 'suggest' consumption-gate ceiling (null = deployment default)"},"dream_daily_run_cap":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dream Daily Run Cap","description":"Org override for daily background memory-maintenance runs (null = deployment default)"},"tracing_enabled":{"type":"boolean","title":"Tracing Enabled","description":"Whether per-run LangSmith trace forwarding is enabled for this org. False by default; admin opts in. When False, no node inputs/outputs are sent to LangSmith, even if the global ``LANGSMITH_TRACING`` env var is set."},"grounding_reminders_enabled":{"type":"boolean","title":"Grounding Reminders Enabled","description":"Whether the fresh DISPATCH-CLAIM CONTRACT is injected in the system prompt for modes that have one (currently DR Research)."},"profile_suggestions_enabled":{"type":"boolean","title":"Profile Suggestions Enabled","description":"Whether proactive next-session profile suggestions are enabled for admin chat sessions."},"default_chat_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Chat Profile","description":"Profile name used for chat memory extraction + recall. None = platform default (SRE)."},"default_chat_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Chat Model","description":"Org default model id for the chat executor. None = platform default (see ``chat_model_default``)."},"default_chat_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Chat Effort","description":"Org default effort for the chat executor. None = platform default (see ``chat_effort_default``)."},"agent_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Effort","description":"Single effort cap for non-chat reasoning (HDR/DR executor + HDR hypothesis/solution). None = per-model platform default. Does NOT affect chat."},"chat_model_options":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Chat Model Options","description":"Selectable chat models as [{id, label}] (read-only)."},"chat_effort_options":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Chat Effort Options","description":"Selectable effort levels as [{id, label}] (read-only)."},"chat_efforts_by_model":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Chat Efforts By Model","description":"Valid effort ids per model id (read-only). The UI filters the effort picker by the selected model (Sonnet 5 and Opus both expose low–xhigh)."},"chat_model_default":{"type":"string","title":"Chat Model Default","description":"Platform default model id when default_chat_model is null."},"chat_effort_default":{"type":"string","title":"Chat Effort Default","description":"Platform default effort when default_chat_effort is null."},"default_thread_visibility":{"type":"string","title":"Default Thread Visibility","description":"Default visibility for new conversations in the d3 composer. 'private' | 'org' | 'team:<uuid>'."},"cron_thread_ttl_minutes":{"type":"integer","title":"Cron Thread Ttl Minutes","description":"Minutes before cron-created threads are auto-deleted"},"command_deny_list":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Command Deny List","description":"Command patterns blocked from execution"},"compaction_trigger_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Compaction Trigger Tokens","description":"Input token threshold for context compaction (50k–900k). None = global default."},"playbook_failure_archive_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Playbook Failure Archive Rate","description":"Per-org playbook archive rate (0, 1]. None = platform default (0.5)."},"amem_superseded_ttl_days":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amem Superseded Ttl Days","description":"Per-org supersession reap window (days). None = platform default (keep forever unless AMEM_SUPERSEDED_TTL_DAYS is set). Inert unless the platform-global AMEM_SUPERSEDED_RECALL='hide'."},"revision":{"type":"integer","title":"Revision","description":"Monotonic settings revision (also surfaced as the ETag)","default":0},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Last update timestamp"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By","description":"User who last updated"}},"type":"object","required":["event_threads_enabled","web_search_enabled","web_search_max_uses","web_extract_enabled","web_extract_max_uses","web_extract_depth","memory_enabled","memory_maintenance_enabled","dr_input_capture_enabled","tracing_enabled","grounding_reminders_enabled","profile_suggestions_enabled","default_thread_visibility","cron_thread_ttl_minutes","command_deny_list"],"title":"AgentSettingsResponse","description":"Response schema for agent settings."},"AgentSettingsUpdate":{"properties":{"event_threads_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Event Threads Enabled","description":"Enable/disable automatic thread creation from alert events"},"web_search_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Web Search Enabled","description":"Enable/disable web search tool"},"web_search_max_uses":{"anyOf":[{"type":"integer","maximum":20.0,"minimum":1.0},{"type":"null"}],"title":"Web Search Max Uses","description":"Max web searches per minute (rolling window, 1-20)"},"web_extract_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Web Extract Enabled","description":"Enable/disable URL content extraction tool"},"web_extract_max_uses":{"anyOf":[{"type":"integer","maximum":20.0,"minimum":1.0},{"type":"null"}],"title":"Web Extract Max Uses","description":"Max URL extractions per minute (rolling window, 1-20)"},"web_extract_depth":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Web Extract Depth","description":"Extraction depth: 'basic' or 'advanced' (for complex pages)"},"memory_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Memory Enabled","description":"Enable/disable investigation memory (A-mem)"},"memory_maintenance_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Memory Maintenance Enabled","description":"Enable/disable background memory maintenance (paid-plan opt-in; cannot be enabled while the subscription is in trial)"},"dr_input_capture_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Dr Input Capture Enabled","description":"Opt-in capture of evaluation run inputs (encrypted, retention-capped) so rubric replay can re-test real cases"},"dr_gate_auto_delta_max":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Dr Gate Auto Delta Max","description":"Org override for the 'auto' consumption-gate ceiling. Explicit null clears back to the deployment default. The effective auto ceiling must stay <= the suggest ceiling."},"dr_gate_suggest_delta_max":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Dr Gate Suggest Delta Max","description":"Org override for the 'suggest' consumption-gate ceiling. Explicit null clears back to the deployment default."},"dream_daily_run_cap":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Dream Daily Run Cap","description":"Org override for the total background memory-maintenance runs allowed per UTC day, chained continuations included. Explicit null clears back to the deployment default; values above the deployment ceiling are refused."},"tracing_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tracing Enabled","description":"Enable/disable LangSmith trace forwarding per-run for this org. Default False platform-wide — admin opts in. When False, node inputs/outputs are not sent to LangSmith regardless of the global ``LANGSMITH_TRACING`` env var, preserving the operator-blind posture set by E2EE-at-rest."},"grounding_reminders_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Grounding Reminders Enabled","description":"Inject a fresh DISPATCH-CLAIM CONTRACT in the system prompt for modes that have one (currently DR Research). Set False to disable per-org if the reminder is interfering."},"profile_suggestions_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Profile Suggestions Enabled","description":"Enable proactive next-session profile suggestions for admin chat sessions (opt-in canary; default off). When on, a long exploratory admin session may prompt 'save this as a reusable profile?' at the start of the next session."},"default_chat_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Chat Profile","description":"Profile name used for chat memory extraction + recall (built-in or custom). Set to ``null`` to clear the override and revert to the platform default; omitting the field entirely leaves the current value alone. Validated at write time — unknown profile names return 422. Empty strings are coerced to ``null`` (clear) on read."},"default_chat_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Chat Model","description":"Model id the PlatformPilot chat executor uses. Must be one of the curated options from GET /settings/agent (``chat_model_options``). ``null`` clears the override (revert to the platform default); omitting the field leaves it alone. Empty strings are coerced to ``null``; unknown ids return 422."},"default_chat_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Chat Effort","description":"Anthropic effort level for the chat executor: 'low', 'medium', or 'high'. ``null`` clears the override (revert to the platform default of 'high'); omitting the field leaves it alone. Empty strings are coerced to ``null``; unknown values return 422."},"agent_effort":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Effort","description":"Single effort cap for non-chat agent reasoning (HDR/DR executor + HDR hypothesis/solution): 'low', 'medium', 'high', or 'xhigh'. ``null`` clears it (each model reverts to its platform default); omitting leaves it alone. Applied clamped per model (Sonnet 5 and Opus both accept up to xhigh). Empty strings coerce to ``null``; unknown values return 422. Does NOT affect chat."},"default_thread_visibility":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Default Thread Visibility","description":"Per-org default visibility applied to new conversations in the d3 composer when the user does not explicitly choose otherwise. Grammar: 'private' (owner-only), 'org' (everyone in this org), 'team:<uuid>' (specific team). Backend does NOT enforce — the badge state at thread-create time is authoritative for ``metadata.team_id``. d3 normalises invalid values to 'private' on read."},"cron_thread_ttl_minutes":{"anyOf":[{"type":"integer","maximum":43200.0,"minimum":60.0},{"type":"null"}],"title":"Cron Thread Ttl Minutes","description":"Minutes before cron-created threads are auto-deleted (60 min – 30 days)"},"command_deny_list":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Command Deny List","description":"Command patterns blocked from execution (full replacement). Each entry: {pattern: str, is_regex: bool, description: str, category: str}"},"compaction_trigger_tokens":{"anyOf":[{"type":"integer","maximum":900000.0,"minimum":50000.0},{"type":"null"}],"title":"Compaction Trigger Tokens","description":"Input token threshold for context compaction (50k–900k). None = use global default."},"playbook_failure_archive_rate":{"anyOf":[{"type":"number","maximum":1.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Playbook Failure Archive Rate","description":"Fraction of a learned playbook's recent uses that must be attributable failures before it is archived (with a global 2-failure floor). Range (0, 1]. None = use the platform default (0.5). Expert per-org risk-appetite knob."},"amem_superseded_ttl_days":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"null"}],"title":"Amem Superseded Ttl Days","description":"Grace window (days) after which a superseded (stale) knowledge record is reaped by consolidation. None = use the platform default (AMEM_SUPERSEDED_TTL_DAYS, also None = keep forever). Requires the platform-global AMEM_SUPERSEDED_RECALL='hide' to take effect; under the default 'annotate' mode this window is inert and no records are reaped."}},"type":"object","title":"AgentSettingsUpdate","description":"Request schema for updating agent settings."},"ArtifactCheck":{"properties":{"kind":{"type":"string","enum":["assert_contains","assert_not_contains","assert_regex"],"title":"Kind"},"pattern":{"type":"string","maxLength":500,"minLength":1,"title":"Pattern"}},"type":"object","required":["kind","pattern"],"title":"ArtifactCheck","description":"One deterministic text check against the drafted artifact."},"AuthorizationCallbackRequest":{"properties":{"code":{"type":"string","title":"Code"},"state":{"type":"string","title":"State"}},"type":"object","required":["code","state"],"title":"AuthorizationCallbackRequest","description":"Request for authorization callback."},"AuthorizationStartResponse":{"properties":{"authorization_url":{"type":"string","title":"Authorization Url"},"state":{"type":"string","title":"State"}},"type":"object","required":["authorization_url","state"],"title":"AuthorizationStartResponse","description":"Response from starting authorization flow."},"AutonomyResponse":{"properties":{"autonomy_level":{"type":"integer","title":"Autonomy Level","description":"Persisted autonomy level (clamped to capability on write)"},"capability":{"type":"integer","title":"Capability","description":"Earned capability rung (0, 25, 50, 75, or 100)"},"effective_level":{"type":"integer","title":"Effective Level","description":"min(level, capability); 0 when Brain is disabled"},"brain_enabled":{"type":"boolean","title":"Brain Enabled","description":"Brain (memory) prerequisite; the UI dims the slider when False"},"n_runs":{"type":"integer","title":"N Runs","description":"Completed investigations counted"},"accepted_count":{"type":"integer","title":"Accepted Count","description":"Human-approved remediations"},"ignored_count":{"type":"integer","title":"Ignored Count","description":"Human Ignore rulings"},"remediation_success_count":{"type":"integer","title":"Remediation Success Count","description":"Approved remediations that completed successfully"},"next_rung":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Rung","description":"Next unlockable rung; None at 100"},"next_rung_requirements":{"additionalProperties":{"type":"number"},"type":"object","title":"Next Rung Requirements","description":"Remaining deltas toward next_rung (unmet only)"},"decision":{"anyOf":[{"$ref":"#/components/schemas/DecisionCapability"},{"type":"null"}],"description":"Decision-autonomy status (DR verdict gate): whether auto verdicts stand, plus the ruling counts behind it. None when the signal could not be read."},"capability_truncated":{"type":"boolean","title":"Capability Truncated","description":"Capability scan was truncated or failed; counts undercount"},"capability_degraded":{"type":"boolean","title":"Capability Degraded","description":"The capability scan FAILED (read error): the rung is a degraded 0 and nothing was counted. Distinct from capability_truncated alone, which means a long track record exceeded the scan ceiling and real counts undercount. The UI copy for the two must differ: 'could not read your track record' vs 'the earned rung may read lower than it is'.","default":false}},"type":"object","required":["autonomy_level","capability","effective_level","brain_enabled","n_runs","accepted_count","ignored_count","remediation_success_count","next_rung","next_rung_requirements","capability_truncated"],"title":"AutonomyResponse","description":"Response schema for autonomy settings.\n\nProgress fields mirror the entities-overview pattern so the UI can\nrender \"N more to unlock\" copy against ``next_rung_requirements``."},"AutonomyUpdate":{"properties":{"autonomy_level":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Autonomy Level","description":"Desired autonomy level (0-100)"}},"type":"object","required":["autonomy_level"],"title":"AutonomyUpdate","description":"Request schema for updating autonomy level."},"AvailableChannelResponse":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"blurb":{"type":"string","title":"Blurb"},"capabilities":{"additionalProperties":true,"type":"object","title":"Capabilities"},"configured":{"type":"boolean","title":"Configured","default":false}},"type":"object","required":["id","label","blurb","capabilities"],"title":"AvailableChannelResponse","description":"A channel plugin available for configuration."},"AvailableChannelsListResponse":{"properties":{"channels":{"items":{"$ref":"#/components/schemas/AvailableChannelResponse"},"type":"array","title":"Channels"}},"type":"object","required":["channels"],"title":"AvailableChannelsListResponse","description":"Response for listing available channel plugins."},"BindingCreate":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"conversation_id":{"type":"string","title":"Conversation Id"},"graph_id":{"type":"string","title":"Graph Id","default":"PlatformPilot"},"description":{"type":"string","title":"Description","default":""}},"type":"object","required":["channel_id","conversation_id"],"title":"BindingCreate","description":"Request body for creating a binding."},"Body_get_access_token_token_post":{"properties":{"client_id":{"type":"string","title":"Client Id"},"client_secret":{"type":"string","title":"Client Secret"}},"type":"object","required":["client_id","client_secret"],"title":"Body_get_access_token_token_post"},"Body_upload_media_media_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_media_media_upload_post"},"BotConfigCreate":{"properties":{"webhook_url":{"type":"string","title":"Webhook Url"},"enabled":{"type":"boolean","title":"Enabled","default":true},"notification_strategy":{"type":"string","enum":["first","all"],"title":"Notification Strategy","default":"first"}},"type":"object","required":["webhook_url"],"title":"BotConfigCreate","description":"Request model for creating a bot configuration."},"BotConfigResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"enabled":{"type":"boolean","title":"Enabled"},"notification_strategy":{"type":"string","title":"Notification Strategy"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"}},"type":"object","required":["provider","enabled","notification_strategy","created_by","created_at","updated_at"],"title":"BotConfigResponse","description":"Response model for a bot configuration."},"BotConfigUpdate":{"properties":{"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"notification_strategy":{"anyOf":[{"type":"string","enum":["first","all"]},{"type":"null"}],"title":"Notification Strategy"}},"type":"object","title":"BotConfigUpdate","description":"Request model for updating a bot configuration."},"BotListResponse":{"properties":{"bots":{"additionalProperties":{"$ref":"#/components/schemas/BotConfigResponse"},"type":"object","title":"Bots"},"total":{"type":"integer","title":"Total"},"enabled_count":{"type":"integer","title":"Enabled Count"}},"type":"object","required":["bots","total","enabled_count"],"title":"BotListResponse","description":"Response model for listing bot configurations."},"BrainDigestConfig":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"channel_id":{"type":"string","title":"Channel Id","default":""},"account_id":{"type":"string","title":"Account Id","default":"default"},"to":{"type":"string","title":"To","default":""},"audience_attested":{"type":"boolean","title":"Audience Attested","default":false}},"type":"object","title":"BrainDigestConfig","description":"Per-org opt-in for the weekly Brain digest.\n\nThe digest aggregates memory-derived findings into a channel whose\nmembership can exceed the admin set, a leak class run-initiated\nsummaries do not have. That is why ``audience_attested`` is part of the\ncontract: the admin enabling it attests that everyone in the target\nchannel may see org-wide Brain content, and the sender re-checks the\nattestation at send time. Sends are weekly at most, ride dream\ncompletion (no scheduler), and skip entirely when there is no news."},"CallerBrainResponse":{"properties":{"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"canonical_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Name"},"recent_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recent Context"},"recent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recent At"},"suggestions":{"items":{"$ref":"#/components/schemas/StarterSuggestion"},"type":"array","title":"Suggestions"}},"type":"object","title":"CallerBrainResponse","description":"What the Brain holds about the authenticated caller.\n\nAll-null with an empty ``suggestions`` list is the normal empty state, not\nan error: the caller has no person entity yet, nothing is linked to them,\nor the layer is off. The UI reads it as \"no personalization available\" and\ngreets them plainly."},"CancelDowngradeResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether cancellation was successful"},"subscription_id":{"type":"string","title":"Subscription Id","description":"Stripe subscription ID"},"schedule_id":{"type":"string","title":"Schedule Id","description":"Cancelled schedule ID"},"message":{"type":"string","title":"Message","description":"Confirmation message"}},"type":"object","required":["success","subscription_id","schedule_id","message"],"title":"CancelDowngradeResponse","description":"Response schema for cancelling a scheduled downgrade."},"CancelResponse":{"properties":{"cancelled":{"type":"boolean","title":"Cancelled"},"checkpoint_path":{"type":"string","title":"Checkpoint Path"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["cancelled","checkpoint_path","detail"],"title":"CancelResponse","description":"Response from the cancel-run endpoint."},"CategoryConnection":{"properties":{"source":{"type":"string","title":"Source","description":"First category of the pair (alphabetical)"},"target":{"type":"string","title":"Target","description":"Second category of the pair"},"total":{"type":"integer","title":"Total","description":"Deduped memory-to-memory edges crossing the two categories"},"relations":{"additionalProperties":{"type":"integer"},"type":"object","title":"Relations","description":"Edge count per link relation; each deduped edge carries the most-specific relation of its two stored directions"}},"type":"object","required":["source","target","total"],"title":"CategoryConnection","description":"Aggregate edge weight between two categories (live rows only)."},"CategorySummaryResponse":{"properties":{"category":{"type":"integer","title":"Category"},"count":{"type":"integer","title":"Count"},"avg_bleu":{"type":"number","title":"Avg Bleu"},"avg_f1":{"type":"number","title":"Avg F1"},"avg_llm":{"type":"number","title":"Avg Llm"}},"type":"object","required":["category","count","avg_bleu","avg_f1","avg_llm"],"title":"CategorySummaryResponse","description":"Per-category aggregated metrics."},"ChannelAccountCreate":{"properties":{"account_id":{"type":"string","title":"Account Id","description":"Account identifier","default":"default"},"credentials":{"additionalProperties":true,"type":"object","title":"Credentials","description":"Channel-specific credentials (e.g. bot_token, signing_secret)"},"enabled":{"type":"boolean","title":"Enabled","default":true},"settings":{"additionalProperties":true,"type":"object","title":"Settings"},"notification_strategy":{"type":"string","enum":["first","all"],"title":"Notification Strategy","default":"all"}},"type":"object","required":["credentials"],"title":"ChannelAccountCreate","description":"Request body for creating a channel account."},"ChannelAccountResponse":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"account_id":{"type":"string","title":"Account Id"},"enabled":{"type":"boolean","title":"Enabled"},"settings":{"additionalProperties":true,"type":"object","title":"Settings"},"notification_strategy":{"type":"string","title":"Notification Strategy"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["channel_id","account_id","enabled","settings","notification_strategy","created_by","created_at","updated_at"],"title":"ChannelAccountResponse","description":"Response model for a channel account (credentials excluded)."},"ChannelAccountUpdate":{"properties":{"credentials":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Credentials"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Settings"},"notification_strategy":{"anyOf":[{"type":"string","enum":["first","all"]},{"type":"null"}],"title":"Notification Strategy"}},"type":"object","title":"ChannelAccountUpdate","description":"Request body for updating a channel account."},"ChannelAuthorizeResponse":{"properties":{"authorize_url":{"type":"string","title":"Authorize Url"},"state":{"type":"string","title":"State"}},"type":"object","required":["authorize_url","state"],"title":"ChannelAuthorizeResponse","description":"Response with OAuth authorize URL for channel installation."},"ChannelIdentityCreateRequest":{"properties":{"channel_id":{"type":"string","maxLength":64,"minLength":1,"title":"Channel Id"},"sender_id":{"type":"string","maxLength":255,"minLength":1,"title":"Sender Id"},"user_id":{"type":"string","maxLength":36,"minLength":1,"title":"User Id"},"display_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["channel_id","sender_id","user_id"],"title":"ChannelIdentityCreateRequest","description":"Request to link a channel sender to a PlatformPilot user."},"ChannelIdentityResponse":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"sender_id":{"type":"string","title":"Sender Id"},"user_id":{"type":"string","title":"User Id"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"linked_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked At"},"linked_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Linked By"}},"type":"object","required":["channel_id","sender_id","user_id"],"title":"ChannelIdentityResponse","description":"Response schema for a channel identity link."},"ChannelListResponse":{"properties":{"channels":{"items":{"$ref":"#/components/schemas/ChannelSummaryResponse"},"type":"array","title":"Channels"},"total_accounts":{"type":"integer","title":"Total Accounts"},"total_enabled":{"type":"integer","title":"Total Enabled"}},"type":"object","required":["channels","total_accounts","total_enabled"],"title":"ChannelListResponse","description":"Response for listing all configured channels."},"ChannelOAuthCallbackRequest":{"properties":{"code":{"type":"string","title":"Code"},"state":{"type":"string","title":"State"}},"type":"object","required":["code","state"],"title":"ChannelOAuthCallbackRequest","description":"Request body for channel OAuth callback."},"ChannelOAuthCallbackResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"workspace_id":{"type":"string","title":"Workspace Id","default":""},"workspace_name":{"type":"string","title":"Workspace Name","default":""},"message":{"type":"string","title":"Message","default":""}},"type":"object","required":["success"],"title":"ChannelOAuthCallbackResponse","description":"Response from channel OAuth callback."},"ChannelSummaryResponse":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"label":{"type":"string","title":"Label"},"account_count":{"type":"integer","title":"Account Count"},"enabled_count":{"type":"integer","title":"Enabled Count"},"accounts":{"items":{"$ref":"#/components/schemas/ChannelAccountResponse"},"type":"array","title":"Accounts"}},"type":"object","required":["channel_id","label","account_count","enabled_count","accounts"],"title":"ChannelSummaryResponse","description":"Summary of a channel's configured accounts."},"CheckoutSessionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Checkout session ID"},"stripe_session_id":{"type":"string","title":"Stripe Session Id","description":"Stripe checkout session ID"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID (null if orphaned)"},"plan_id":{"type":"string","title":"Plan Id","description":"Plan being purchased"},"status":{"$ref":"#/components/schemas/CheckoutStatus","description":"Session status"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Session creation timestamp"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At","description":"Session completion timestamp"}},"type":"object","required":["id","stripe_session_id","plan_id","status","created_at"],"title":"CheckoutSessionResponse","description":"Response schema for checkout session details."},"CheckoutStatus":{"type":"string","enum":["pending","completed","expired"],"title":"CheckoutStatus","description":"Checkout session statuses."},"CheckpointConvProgress":{"properties":{"seeded":{"type":"boolean","title":"Seeded"},"turns_seeded":{"type":"integer","title":"Turns Seeded"},"qa_results_count":{"type":"integer","title":"Qa Results Count"},"completed":{"type":"boolean","title":"Completed"},"qa_results":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Qa Results"}},"type":"object","required":["seeded","turns_seeded","qa_results_count","completed"],"title":"CheckpointConvProgress","description":"Per-conversation checkpoint state."},"CheckpointExampleProgress":{"properties":{"seeded":{"type":"boolean","title":"Seeded"},"sessions_seeded":{"type":"integer","title":"Sessions Seeded"},"completed":{"type":"boolean","title":"Completed"},"rows":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Rows"}},"type":"object","required":["seeded","sessions_seeded","completed"],"title":"CheckpointExampleProgress","description":"Per-example checkpoint state."},"CheckpointRecordProgress":{"properties":{"seeded":{"type":"boolean","title":"Seeded"},"chunks_seeded":{"type":"integer","title":"Chunks Seeded"},"completed":{"type":"boolean","title":"Completed"},"rows":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Rows"}},"type":"object","required":["seeded","chunks_seeded","completed"],"title":"CheckpointRecordProgress","description":"Per-record checkpoint state."},"ClaimRequest":{"properties":{"token":{"type":"string","maxLength":64,"minLength":1,"title":"Token"}},"type":"object","required":["token"],"title":"ClaimRequest","description":"Request to claim an invite token."},"ClientRegistrationRequest":{"properties":{"redirect_uris":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Redirect Uris"},"grant_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Grant Types"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"}},"type":"object","title":"ClientRegistrationRequest","description":"Request for dynamic client registration."},"ClientRegistrationResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"ClientRegistrationResponse","description":"Response from dynamic client registration."},"CloudProviderCreate":{"properties":{"provider":{"type":"string","pattern":"^(gcp|aws|azure)$","title":"Provider","description":"Cloud provider type","examples":["gcp","aws","azure"]},"config":{"additionalProperties":true,"type":"object","title":"Config","description":"Provider-specific configuration (GCP/AWS/Azure)","examples":[{"project_id":"my-gcp-project","service_account_email":"sa@project.iam.gserviceaccount.com"}]},"labels":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Labels","description":"Labels for agent reasoning","examples":[{"cloud":"gcp","env":"prod"}]},"provider_key":{"type":"string","title":"Provider Key","description":"Auto-derived unique provider key (GCP: project_id, AWS: account_id, Azure: subscription_id)","default":"","examples":["my-gcp-project-123","123456789012","12345678-1234-1234-1234-123456789012"]}},"type":"object","required":["provider","config"],"title":"CloudProviderCreate","description":"Request schema for creating cloud provider.\n\nNOTE: provider_key is auto-derived from cloud-native identifiers:\n- GCP: project_id\n- AWS: account_id\n- Azure: subscription_id"},"CloudProviderListResponse":{"properties":{"providers":{"items":{"$ref":"#/components/schemas/CloudProviderResponse"},"type":"array","title":"Providers"}},"type":"object","required":["providers"],"title":"CloudProviderListResponse","description":"Response schema for list of cloud providers."},"CloudProviderResponse":{"properties":{"provider_key":{"type":"string","title":"Provider Key"},"provider":{"type":"string","title":"Provider"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Labels"},"clusters":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Clusters"},"services":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Services"},"created_at":{"type":"string","title":"Created At"},"import_bucket_probe":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Import Bucket Probe"},"media_bucket_probe":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Media Bucket Probe"}},"type":"object","required":["provider_key","provider","config","labels","clusters","created_at"],"title":"CloudProviderResponse","description":"Response schema for cloud provider details (hierarchical with nested clusters)."},"CloudProviderUpdate":{"properties":{"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config","description":"Updated provider configuration"},"labels":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Labels","description":"Updated labels"}},"type":"object","title":"CloudProviderUpdate","description":"Request schema for updating cloud provider."},"ClusterAccessInfo":{"properties":{"cluster_name":{"type":"string","title":"Cluster Name","description":"Cluster name","examples":["prod-cluster"]},"location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location","description":"Cluster location (zone or region), null if cluster not found","examples":["us-central1-a","us-central1"]},"access_level":{"type":"string","title":"Access Level","description":"Detected access level: container.clusterAdmin, container.clusterViewer, or unknown","examples":["container.clusterAdmin","container.clusterViewer","unknown"]},"has_label":{"type":"boolean","title":"Has Label","description":"Whether cluster has platformpilot-access=enabled label","examples":[true,false]},"can_access":{"type":"boolean","title":"Can Access","description":"Whether service account can get cluster details","examples":[true,false]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Explanation if access_level is not container.clusterAdmin","examples":["Missing platformpilot-access=enabled label on cluster","Insufficient permissions to get cluster details (conditional IAM binding may not be applied)"]}},"type":"object","required":["cluster_name","access_level","has_label","can_access"],"title":"ClusterAccessInfo","description":"Access verification result for a single cluster."},"ClusterAccessRequest":{"properties":{"cluster_names":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Cluster Names","description":"List of cluster names to verify access for","examples":[["prod-cluster","staging-cluster"]]}},"type":"object","required":["cluster_names"],"title":"ClusterAccessRequest","description":"Request to verify access level for specific clusters.\n\nUsed in Step 4 of the UI journey to validate that conditional IAM bindings\nand cluster labels have been properly applied."},"ClusterAccessResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether verification completed successfully","examples":[true]},"cluster_access":{"items":{"$ref":"#/components/schemas/ClusterAccessInfo"},"type":"array","title":"Cluster Access","description":"Access verification results per cluster"}},"type":"object","required":["success","cluster_access"],"title":"ClusterAccessResponse","description":"Response containing access verification results for multiple clusters."},"ClusterCreationResult":{"properties":{"cluster_name":{"type":"string","title":"Cluster Name"},"status":{"type":"string","title":"Status","description":"success, skipped, or failed"},"cluster":{"anyOf":[{"$ref":"#/components/schemas/KubernetesClusterResponse"},{"type":"null"}],"description":"Cluster details if created/skipped"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if failed"}},"type":"object","required":["cluster_name","status"],"title":"ClusterCreationResult","description":"Result for a single cluster creation within a batch."},"ClusterDiscoveryResult":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether discovery completed successfully","examples":[true,false]},"project_id":{"type":"string","title":"Project Id","description":"GCP project ID","examples":["my-gcp-project-123"]},"clusters":{"items":{"$ref":"#/components/schemas/DiscoveredClusterInfo"},"type":"array","title":"Clusters","description":"Discovered clusters (empty on failure)","default":[]},"total_count":{"type":"integer","title":"Total Count","description":"Total clusters discovered","examples":[3,0]},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","description":"Hard errors preventing discovery","default":[],"examples":[["Permission denied: Service account lacks 'container.clusters.list'"]]},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"Soft warnings during discovery","default":[],"examples":[[]]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code","description":"Machine-readable error code","examples":["INSUFFICIENT_PERMISSIONS","PROJECT_NOT_FOUND"]},"error_details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Error Details","description":"Additional error context","examples":[{"missing_permission":"container.clusters.list","required_role":"roles/container.clusterViewer","service_account":"customer-sa@project.iam.gserviceaccount.com"}]},"suggested_actions":{"items":{"type":"string"},"type":"array","title":"Suggested Actions","description":"Actionable steps to resolve errors","default":[],"examples":[["Grant 'Kubernetes Engine Cluster Viewer' role to customer-sa@project.iam.gserviceaccount.com","gcloud projects add-iam-policy-binding my-project --member='serviceAccount:customer-sa@project.iam.gserviceaccount.com' --role='roles/container.clusterViewer'"]]}},"type":"object","required":["success","project_id","total_count"],"title":"ClusterDiscoveryResult","description":"Cluster discovery result with comprehensive error handling.\n\nFollows AgentEnvironmentValidationResult pattern for consistency.\nSupports both successful discovery and error scenarios with actionable guidance."},"CompensationSpec":{"properties":{"description":{"type":"string","maxLength":300,"minLength":1,"title":"Description"},"command":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Command"}},"type":"object","required":["description"],"title":"CompensationSpec","description":"Declarative \"what undoes this action\" metadata (A.6).\n\nRendered wherever a matched action is held for approval, so the\nreviewer sees the undo path next to the proposed action. The\n``command`` is display-only — nothing executes it automatically."},"ContextWindowResponse":{"properties":{"used_tokens":{"type":"integer","title":"Used Tokens","description":"Estimated tokens currently in this thread's context window. Anchor + block-aware delta hybrid: exact when the most recent AIMessage carries Anthropic usage_metadata, block-aware char/4 fallback otherwise."},"max_tokens":{"type":"integer","title":"Max Tokens","description":"Context-window capacity in tokens of the configured chat executor model (deployment-level constant). Not discovered per-thread: PlatformPilot runs the executor as a sub-graph, so the parent thread state the indicator can read does not carry the assistant turns' model metadata — per-message discovery returned null for every real chat thread and wrongly pinned this to the 200k default."},"percent":{"type":"number","minimum":0.0,"title":"Percent","description":"used_tokens / max_tokens. May exceed 1.0 briefly between the moment a turn pushes content over the model limit and the moment Anthropic compaction summarizes it."},"compaction_trigger_tokens":{"type":"integer","title":"Compaction Trigger Tokens","description":"Token count at which Anthropic context compaction will fire on the next turn. Per-org override honored."},"from_anchor":{"type":"boolean","title":"From Anchor","description":"True when an AIMessage anchor was found and used (high accuracy). False when the estimate fell back to pure block-aware char/4 across the whole list (turn-1 case)."}},"type":"object","required":["used_tokens","max_tokens","percent","compaction_trigger_tokens","from_anchor"],"title":"ContextWindowResponse","description":"Indicator payload — minimal so the UI can render '70.2k / 200.0k (35%)'."},"ConvertTrialResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Subscription status after conversion ('active' on success)."},"plan_id":{"type":"string","title":"Plan Id","description":"Plan the subscription is on."},"subscription_id":{"type":"string","title":"Subscription Id","description":"Internal subscription record ID."},"already_active":{"type":"boolean","title":"Already Active","description":"True if the subscription was already active (idempotent no-op).","default":false}},"type":"object","required":["status","plan_id","subscription_id"],"title":"ConvertTrialResponse","description":"Response schema for converting a Brain trial to a paid subscription now."},"CreateCheckoutRequest":{"properties":{"plan_id":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Subscription plan to purchase (starter or professional)"},"success_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Success Url","description":"Custom success URL (overrides default)"},"cancel_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Cancel Url","description":"Custom cancel URL (overrides default)"},"user_uid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Uid","description":"User UID from Landing Page (Auth0 User ID, e.g., 'auth0|1234567890abcdef'). If provided, checkout will be created for this user instead of the service account."},"region":{"anyOf":[{"type":"string","enum":["us","eu"]},{"type":"null"}],"title":"Region","description":"Billing region detected by Landing Page from Cloudflare geolocation. 'us' routes to DynG AI, Inc. (Delaware), 'eu' routes to PlatformPilot Limited (Ireland). If not provided, defaults to 'us'. Ignored for existing customers (uses stored region)."},"billing_period":{"type":"string","enum":["monthly","annual"],"title":"Billing Period","description":"Billing period for the subscription. 'monthly' for month-to-month, 'annual' for yearly billing (typically discounted). Defaults to 'monthly'.","default":"monthly"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Checkout source identifier. Set to 'landing_page_onboarding' by the Landing Page during initial onboarding to trigger server-side Auth0 flag setting."}},"type":"object","required":["plan_id"],"title":"CreateCheckoutRequest","description":"Request schema for creating a Stripe Checkout session."},"CreateCheckoutResponse":{"properties":{"checkout_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Checkout Url","description":"Stripe Checkout URL to redirect user to"},"session_id":{"type":"string","title":"Session Id","description":"Checkout session ID for tracking"}},"type":"object","required":["checkout_url","session_id"],"title":"CreateCheckoutResponse","description":"Response schema for created Stripe Checkout session."},"CreditAllocationResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Allocation ID"},"user_id":{"type":"string","title":"User Id","description":"User ID"},"subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Id","description":"Subscription ID (null if unlinked)"},"credits_granted":{"type":"integer","title":"Credits Granted","description":"Credits granted"},"credits_remaining":{"type":"integer","title":"Credits Remaining","description":"Credits remaining"},"credits_used":{"type":"integer","title":"Credits Used","description":"Credits used"},"usage_percentage":{"type":"number","title":"Usage Percentage","description":"Percentage used (0-100)"},"period_start":{"type":"string","format":"date-time","title":"Period Start","description":"Period start date"},"period_end":{"type":"string","format":"date-time","title":"Period End","description":"Period end date"},"stripe_invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Invoice Id","description":"Stripe invoice ID"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Allocation creation timestamp"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether allocation is currently active"},"is_expired":{"type":"boolean","title":"Is Expired","description":"Whether allocation period has expired"}},"type":"object","required":["id","user_id","credits_granted","credits_remaining","credits_used","usage_percentage","period_start","period_end","created_at","is_active","is_expired"],"title":"CreditAllocationResponse","description":"Response schema for credit allocation details."},"CreditBalanceResponse":{"properties":{"user_id":{"type":"string","title":"User Id","description":"User ID"},"current_period":{"$ref":"#/components/schemas/CurrentPeriodCredits","description":"Credits for current billing period"},"total_lifetime_credits":{"type":"integer","title":"Total Lifetime Credits","description":"Total credits allocated over lifetime"},"total_lifetime_usage":{"type":"integer","title":"Total Lifetime Usage","description":"Total credits used over lifetime"}},"type":"object","required":["user_id","current_period","total_lifetime_credits","total_lifetime_usage"],"title":"CreditBalanceResponse","description":"Response schema for current credit balance."},"CreditPackBalanceResponse":{"properties":{"prepaid_credits_available":{"type":"integer","title":"Prepaid Credits Available","description":"Current prepaid credit balance"},"prepaid_balance_cents":{"type":"integer","title":"Prepaid Balance Cents","description":"Actual dollar balance in cents (use for display, avoids rounding)"},"price_per_credit_cents":{"type":"integer","title":"Price Per Credit Cents","description":"Current price per credit in cents"},"plan_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Id","description":"User's subscription plan"},"purchase_history":{"items":{"$ref":"#/components/schemas/CreditPackPurchase"},"type":"array","title":"Purchase History","description":"Recent credit pack purchases"}},"type":"object","required":["prepaid_credits_available","prepaid_balance_cents","price_per_credit_cents"],"title":"CreditPackBalanceResponse","description":"Response schema for credit pack balance and history."},"CreditPackCheckoutRequest":{"properties":{"preset":{"anyOf":[{"$ref":"#/components/schemas/UsagePackPreset"},{"type":"null"}],"description":"Preset pack amount: '10' ($10), '25' ($25), or '50' ($50)"},"amount_cents":{"anyOf":[{"type":"integer","maximum":50000.0,"minimum":500.0},{"type":"null"}],"title":"Amount Cents","description":"Custom amount in cents (min $5, max $500). Used if preset is not set."},"return_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Return Url","description":"URL to redirect after checkout (success or cancel). If provided, appends ?checkout=success or ?checkout=cancelled."}},"type":"object","title":"CreditPackCheckoutRequest","description":"Request schema for purchasing a credit pack.\n\nSupports two modes:\n1. Preset pack: Set `preset` to \"10\", \"25\", or \"50\" (recommended)\n2. Custom amount: Set `amount_cents` for any amount (fallback)\n\nIf both are provided, `preset` takes precedence."},"CreditPackCheckoutResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url","description":"Stripe Checkout URL"},"checkout_session_id":{"type":"string","title":"Checkout Session Id","description":"Stripe Checkout session ID"},"amount_cents":{"type":"integer","title":"Amount Cents","description":"Purchase amount in cents"},"credits_to_receive":{"type":"integer","title":"Credits To Receive","description":"Credits that will be added after successful payment"},"price_per_credit_cents":{"type":"integer","title":"Price Per Credit Cents","description":"Price per credit in cents"}},"type":"object","required":["checkout_url","checkout_session_id","amount_cents","credits_to_receive","price_per_credit_cents"],"title":"CreditPackCheckoutResponse","description":"Response schema for credit pack checkout session."},"CreditPackPurchase":{"properties":{"id":{"type":"string","title":"Id","description":"Transaction ID"},"amount_cents":{"type":"integer","title":"Amount Cents","description":"Amount paid in cents"},"credits_received":{"type":"integer","title":"Credits Received","description":"Credits added to balance"},"price_per_credit_cents":{"type":"integer","title":"Price Per Credit Cents","description":"Price per credit at purchase"},"purchased_at":{"type":"string","format":"date-time","title":"Purchased At","description":"Purchase timestamp"}},"type":"object","required":["id","amount_cents","credits_received","price_per_credit_cents","purchased_at"],"title":"CreditPackPurchase","description":"Schema for a credit pack purchase record."},"CreditTransactionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Transaction ID"},"user_id":{"type":"string","title":"User Id","description":"User ID"},"allocation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Allocation Id","description":"Allocation ID (null if unlinked)"},"amount":{"type":"integer","title":"Amount","description":"Credit amount (positive = grant, negative = usage)"},"transaction_type":{"$ref":"#/components/schemas/TransactionType","description":"Transaction type"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason","description":"Transaction reason"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id","description":"LangGraph thread ID (for usage tracking)"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Additional context"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Transaction timestamp"}},"type":"object","required":["id","user_id","amount","transaction_type","created_at"],"title":"CreditTransactionResponse","description":"Response schema for credit transaction details."},"CreditUsageRequest":{"properties":{"amount":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount","description":"Number of credits to use (must be positive)"},"reason":{"type":"string","maxLength":500,"minLength":1,"title":"Reason","description":"Reason for usage"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id","description":"LangGraph thread ID"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Additional context (e.g., model, tokens, agent type)","examples":[{"agent":"HDRAgent","model":"claude-sonnet-4","tokens":1500}]}},"type":"object","required":["amount","reason"],"title":"CreditUsageRequest","description":"Request schema for recording credit usage."},"CurrentOrganizationMembershipResponse":{"properties":{"user_id":{"type":"string","title":"User Id"},"organization_id":{"type":"string","title":"Organization Id"},"role":{"type":"string","title":"Role"}},"type":"object","required":["user_id","organization_id","role"],"title":"CurrentOrganizationMembershipResponse","description":"Caller-bound live membership used by peer services for authorization."},"CurrentPeriodCredits":{"properties":{"granted":{"type":"integer","title":"Granted","description":"Credits granted this period"},"remaining":{"type":"integer","title":"Remaining","description":"Credits remaining this period"},"used":{"type":"integer","title":"Used","description":"Credits used this period"},"usage_percentage":{"type":"number","title":"Usage Percentage","description":"Percentage of credits used (0-100)"},"period_start":{"type":"string","format":"date-time","title":"Period Start","description":"Period start date"},"period_end":{"type":"string","format":"date-time","title":"Period End","description":"Period end date"}},"type":"object","required":["granted","remaining","used","usage_percentage","period_start","period_end"],"title":"CurrentPeriodCredits","description":"Credit details for current billing period."},"DecisionCapability":{"properties":{"earned":{"type":"boolean","title":"Earned","description":"True once auto verdicts may stand unreviewed.","default":false},"agreements":{"type":"integer","title":"Agreements","description":"Human rulings that accepted a DR verdict.","default":0},"overrides":{"type":"integer","title":"Overrides","description":"Human rulings that overrode a DR verdict.","default":0},"override_pct":{"type":"number","title":"Override Pct","description":"Override share among all rulings.","default":0.0},"min_agreements":{"type":"integer","title":"Min Agreements","description":"Agreements required before auto can stand.","default":0},"max_override_pct":{"type":"number","title":"Max Override Pct","description":"Override-share ceiling for earning trust.","default":0.0},"truncated":{"type":"boolean","title":"Truncated","description":"Scan hit the page ceiling or failed; counts undercount.","default":false},"degraded":{"type":"boolean","title":"Degraded","description":"Scan FAILED outright (read error): counts absent, not undercounted. Same split as ``CapabilityResult.degraded``.","default":false}},"type":"object","title":"DecisionCapability","description":"Earned decision-autonomy status plus the counts behind it."},"DefeatType":{"type":"string","enum":["rebut","undercut"],"title":"DefeatType","description":"Pollock's two defeat types.\n\nREBUT attacks the conclusion of a claim (\"not P\"). UNDERCUT attacks\nthe inference connecting premises to the conclusion (\"the source of P\nis unreliable\"). The NDE treats both uniformly when computing defeat\nstatus; the distinction is preserved for explanations."},"DenyListEntrySchema":{"properties":{"pattern":{"type":"string","minLength":1,"title":"Pattern","description":"Regex pattern or literal prefix"},"is_regex":{"type":"boolean","title":"Is Regex","description":"Treat pattern as regex","default":false},"description":{"type":"string","title":"Description","description":"Human-readable reason","default":""},"category":{"type":"string","title":"Category","description":"Grouping: kubectl, gcloud, general","default":""}},"type":"object","required":["pattern"],"title":"DenyListEntrySchema","description":"Schema for a single deny list entry."},"DenyListResponse":{"properties":{"entries":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Entries","description":"Current deny list entries"},"count":{"type":"integer","title":"Count","description":"Number of entries"},"revision":{"type":"integer","title":"Revision","description":"Monotonic settings revision backing this deny list (also surfaced as the ETag; echo it back via If-Match on a write)","default":0},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Last settings update timestamp"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By","description":"User who last updated settings"}},"type":"object","required":["entries","count"],"title":"DenyListResponse","description":"Response schema for deny list."},"DenyListUpdate":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/DenyListEntrySchema"},"type":"array","title":"Entries","description":"Full replacement deny list entries"}},"type":"object","required":["entries"],"title":"DenyListUpdate","description":"Request schema for replacing the deny list."},"DeviceRegisterRequest":{"properties":{"token":{"type":"string","maxLength":200,"minLength":16,"title":"Token"},"platform":{"type":"string","maxLength":20,"title":"Platform","default":"ios"}},"type":"object","required":["token"],"title":"DeviceRegisterRequest","description":"Register (or refresh) one push target."},"DeviceToken":{"properties":{"type":{"type":"string","title":"Type","default":"device_token"},"token":{"type":"string","maxLength":200,"minLength":16,"title":"Token"},"platform":{"type":"string","title":"Platform","default":"ios"},"created_at":{"type":"string","title":"Created At","default":""},"last_seen_at":{"type":"string","title":"Last Seen At","default":""}},"type":"object","required":["token"],"title":"DeviceToken","description":"One registered push target."},"DiscoveredClusterInfo":{"properties":{"name":{"type":"string","title":"Name","description":"Cluster name","examples":["prod-gke-us-central1"]},"location":{"type":"string","title":"Location","description":"Zone (e.g., us-central1-a) or region (e.g., us-central1)","examples":["us-central1-a","us-central1"]},"cluster_type":{"type":"string","title":"Cluster Type","description":"Cluster type: zonal, regional, or autopilot","examples":["zonal","regional","autopilot"]},"status":{"type":"string","title":"Status","description":"Cluster status (RUNNING, PROVISIONING, etc.)","examples":["RUNNING","PROVISIONING"]},"access_level":{"type":"string","title":"Access Level","description":"Access level for service account: viewer, editor, admin, or unknown","examples":["admin","viewer","editor","unknown"]},"suggested_labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Suggested Labels","description":"Auto-derived labels for agent reasoning","examples":[{"cloud":"gcp","env":"production","region":"us-central1"}]},"resource_labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Resource Labels","description":"GCP resource labels from cluster metadata (e.g., platformpilot-access=enabled)","examples":[{"platformpilot-access":"enabled","team":"platform"},{"cost-center":"engineering","environment":"prod"}]}},"type":"object","required":["name","location","cluster_type","status","access_level","suggested_labels"],"title":"DiscoveredClusterInfo","description":"Discovered GKE cluster information for UI selection."},"DiscoveredServiceInfo":{"properties":{"name":{"type":"string","title":"Name","description":"API name (e.g., sqladmin.googleapis.com)","examples":["sqladmin.googleapis.com"]},"display_name":{"type":"string","title":"Display Name","description":"Human-readable service name","examples":["Cloud SQL Admin API"]},"category":{"type":"string","title":"Category","description":"Service category (compute, database, monitoring, etc.)","examples":["database","compute","monitoring"]},"suggested_labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Suggested Labels","description":"Auto-derived labels"}},"type":"object","required":["name","display_name","category"],"title":"DiscoveredServiceInfo","description":"Discovered GCP service information for UI selection."},"Disqualifiers":{"properties":{"description":{"type":"string","title":"Description","default":""},"interest_seed_template":{"type":"string","minLength":1,"title":"Interest Seed Template","description":"Template for the initial epistemic interest. Variables in {braces} are substituted at runtime — only ``{candidate}`` and ``{candidate_id}`` are accepted (e.g., '{candidate} is qualified for outreach'). Any other placeholder is rejected at validation time so the DR run can't crash on a typo."},"patterns":{"items":{"$ref":"#/components/schemas/Pattern"},"type":"array","title":"Patterns","description":"Defeater rubric. Order and priority are informational: the engine adjudicates every fired defeater uniformly (see ``Pattern.priority``)"},"verification_protocol":{"type":"string","title":"Verification Protocol","description":"Free-form description of the source-verification workflow: which providers and fetchers to use, parallel/serial ordering, and source-authority hierarchy. Tool-agnostic — describe the workflow in terms of capabilities (enrichment, web-fetch, web-search) rather than naming specific vendor tools, so the rubric stays portable across configurations. Injected into the source-verification agent's instructions at run time; empty means defaults only.","default":""},"info_seeker_prompt":{"type":"string","title":"Info Seeker Prompt","description":"Guidance injected into the evidence-gathering agent when an interest cannot be resolved with current evidence: what to gather first and which capabilities to prefer. Empty means defaults only.","default":""},"version":{"type":"integer","title":"Version","description":"Schema version of this sub-pack","default":1}},"additionalProperties":false,"type":"object","required":["interest_seed_template"],"title":"Disqualifiers","description":"Phase-1 (disqualification) configuration for a Rubric.\n\nHolds the defeater patterns the engine evaluates against the\ncandidate plus the source-verification protocol the undercutter\nfollows. Was ``DefeasiblePack`` in earlier scaffolding."},"DomainCreateRequest":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z0-9][a-z0-9_-]*$","title":"Name"},"description":{"type":"string","title":"Description","default":""},"graph_id":{"type":"string","title":"Graph Id","description":"Orchestration graph that processes this domain","default":"HypotheticoDeductiveAgent"},"namespaces":{"items":{"$ref":"#/components/schemas/NamespaceRequest"},"type":"array","maxItems":3,"minItems":1,"title":"Namespaces"},"extraction_instructions":{"type":"string","minLength":1,"title":"Extraction Instructions"},"requires_cloud_resources":{"type":"boolean","title":"Requires Cloud Resources","description":"Whether profiles using this domain need K8s/cloud resource selection","default":true},"drops_updates":{"type":"boolean","title":"Drops Updates","description":"True = drop update events (ops default), False = process state transitions as primary events","default":true}},"type":"object","required":["name","namespaces","extraction_instructions"],"title":"DomainCreateRequest","description":"Request schema for creating a custom memory domain."},"DomainMetadataResponse":{"properties":{"orchestration_graphs":{"items":{"$ref":"#/components/schemas/GraphInfo"},"type":"array","title":"Orchestration Graphs"},"executors":{"items":{"$ref":"#/components/schemas/ExecutorInfo"},"type":"array","title":"Executors"}},"type":"object","required":["orchestration_graphs","executors"],"title":"DomainMetadataResponse","description":"Available orchestration graphs and executors for domain creation."},"DomainResponse":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"graph_id":{"type":"string","title":"Graph Id"},"namespaces":{"items":{"$ref":"#/components/schemas/NamespaceConfig"},"type":"array","title":"Namespaces"},"extraction_instructions":{"type":"string","title":"Extraction Instructions"},"requires_cloud_resources":{"type":"boolean","title":"Requires Cloud Resources","default":true},"drops_updates":{"type":"boolean","title":"Drops Updates","default":true},"is_builtin":{"type":"boolean","title":"Is Builtin"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["name","description","graph_id","namespaces","extraction_instructions","is_builtin"],"title":"DomainResponse","description":"Response schema for a memory domain."},"DomainUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"graph_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Graph Id"},"namespaces":{"anyOf":[{"items":{"$ref":"#/components/schemas/NamespaceRequest"},"type":"array"},{"type":"null"}],"title":"Namespaces"},"extraction_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Instructions"},"requires_cloud_resources":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Requires Cloud Resources"},"drops_updates":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Drops Updates"}},"type":"object","title":"DomainUpdateRequest","description":"Request schema for updating a custom memory domain (partial)."},"DowngradeRequest":{"properties":{"target_plan":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Target plan to downgrade to (e.g., 'starter')"}},"type":"object","required":["target_plan"],"title":"DowngradeRequest","description":"Request schema for downgrading subscription to a lower tier."},"DowngradeResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether downgrade was scheduled"},"subscription_id":{"type":"string","title":"Subscription Id","description":"Stripe subscription ID"},"schedule_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Id","description":"Stripe subscription schedule ID (for scheduled downgrades)"},"previous_plan":{"type":"string","title":"Previous Plan","description":"Current plan name"},"new_plan":{"type":"string","title":"New Plan","description":"New plan name after downgrade"},"effective_date":{"type":"string","title":"Effective Date","description":"When the downgrade takes effect (ISO format)"}},"type":"object","required":["success","subscription_id","previous_plan","new_plan","effective_date"],"title":"DowngradeResponse","description":"Response schema for subscription downgrade."},"DreamGates":{"properties":{"enabled":{"type":"boolean","title":"Enabled","description":"Platform switch (DREAM_ENABLED)"},"allowlisted":{"type":"boolean","title":"Allowlisted","description":"Org admitted by the rollout allowlist"},"opted_in":{"type":"boolean","title":"Opted In","description":"The org's Dreaming toggle"},"paid_subscription":{"type":"boolean","title":"Paid Subscription","description":"Active non-trial subscription"},"balance_positive":{"type":"boolean","title":"Balance Positive","description":"Usage balance above zero"},"open":{"type":"boolean","title":"Open","description":"Every gate passes"},"blocked_by":{"items":{"type":"string"},"type":"array","title":"Blocked By","description":"Failing gates, in check order"}},"type":"object","required":["enabled","allowlisted","opted_in","paid_subscription","balance_positive","open","blocked_by"],"title":"DreamGates","description":"Why dreaming can or cannot run for this org right now."},"DreamPressure":{"properties":{"pressure":{"type":"integer","title":"Pressure","description":"Write-side disorder observations"},"read_observations":{"type":"integer","title":"Read Observations","description":"Recall-side corroborations"},"effective_pressure":{"type":"integer","title":"Effective Pressure","description":"pressure + read_observations // divisor"},"pressure_threshold":{"type":"integer","title":"Pressure Threshold","description":"Backoff-scaled trigger threshold"},"percent_to_threshold":{"type":"integer","title":"Percent To Threshold","description":"effective_pressure as a percent of threshold, capped at 100"},"writes_since_sweep":{"type":"integer","title":"Writes Since Sweep","description":"Writes since the last full survey"},"sweep_threshold":{"type":"integer","title":"Sweep Threshold","description":"Backoff-scaled sweep threshold"},"barren_streak":{"type":"integer","title":"Barren Streak","description":"Consecutive runs that changed nothing"},"backoff":{"type":"integer","title":"Backoff","description":"Threshold multiplier from the barren streak"},"queue_debt":{"type":"boolean","title":"Queue Debt","description":"Planned work left undrained"},"stale":{"type":"boolean","title":"Stale","description":"Last run older than the staleness interval"},"signals":{"items":{"type":"string"},"type":"array","title":"Signals","description":"Work signals firing right now"}},"type":"object","required":["pressure","read_observations","effective_pressure","pressure_threshold","percent_to_threshold","writes_since_sweep","sweep_threshold","barren_streak","backoff","queue_debt","stale","signals"],"title":"DreamPressure","description":"The adenosine counter and the thresholds it is measured against."},"DreamReportSummary":{"properties":{"key":{"type":"string","title":"Key"},"started_at":{"type":"string","title":"Started At","default":""},"finished_at":{"type":"string","title":"Finished At","default":""},"dry_run":{"type":"boolean","title":"Dry Run","default":false},"chain_count":{"type":"integer","title":"Chain Count","default":0},"pressure_snapshot":{"type":"integer","title":"Pressure Snapshot","default":0},"ops_planned":{"type":"integer","title":"Ops Planned","default":0},"ops_executed":{"type":"integer","title":"Ops Executed","default":0},"records_absorbed":{"type":"integer","title":"Records Absorbed","default":0},"memory_debt":{"type":"integer","title":"Memory Debt","default":0},"dead_letters":{"type":"integer","title":"Dead Letters","default":0},"categories_rewritten":{"type":"integer","title":"Categories Rewritten","default":0},"plan_errors":{"type":"integer","title":"Plan Errors","default":0},"fatal_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fatal Error"}},"type":"object","required":["key"],"title":"DreamReportSummary","description":"One past run, trimmed to what a status panel can show."},"DreamRunRequest":{"properties":{"force":{"type":"boolean","title":"Force","description":"Survey even with no accumulated pressure. Defaults to true: an admin asking for a run now means the run should happen, and every billing/lease gate still applies inside the graph.","default":true}},"type":"object","title":"DreamRunRequest","description":"Manual run options."},"DreamRunResponse":{"properties":{"started":{"type":"boolean","title":"Started"},"forced":{"type":"boolean","title":"Forced"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["started","forced","detail"],"title":"DreamRunResponse","description":"Outcome of a manual run request."},"DreamRunState":{"properties":{"in_flight":{"type":"boolean","title":"In Flight","description":"A run is leased or freshly queued"},"pending":{"type":"boolean","title":"Pending","description":"A run is queued but has not started"},"lease_held":{"type":"boolean","title":"Lease Held","description":"A run currently holds the org lease"},"runs_today":{"type":"integer","title":"Runs Today","description":"Trigger bursts started today (UTC)"},"max_runs_per_day":{"type":"integer","title":"Max Runs Per Day","description":"Burst ceiling for automatic runs"},"total_runs_today":{"type":"integer","title":"Total Runs Today","description":"All runs today, chains included"},"total_runs_cap":{"type":"integer","title":"Total Runs Cap","description":"Hard daily bound enforced by the graph"},"total_runs_cap_is_custom":{"type":"boolean","title":"Total Runs Cap Is Custom","description":"The daily bound comes from an org override, not the default"},"total_runs_cap_ceiling":{"type":"integer","title":"Total Runs Cap Ceiling","description":"Highest daily bound this deployment will accept"},"daily_bound_reached":{"type":"boolean","title":"Daily Bound Reached","description":"No further runs will start today"},"last_run_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Run At","description":"Finish time of the last run"},"queued_clusters":{"type":"integer","title":"Queued Clusters","description":"Live near-duplicate clusters awaiting a merge decision"},"queued_oversize":{"type":"integer","title":"Queued Oversize","description":"Live overlong records awaiting a split decision"}},"type":"object","required":["in_flight","pending","lease_held","runs_today","max_runs_per_day","total_runs_today","total_runs_cap","total_runs_cap_is_custom","total_runs_cap_ceiling","daily_bound_reached","queued_clusters","queued_oversize"],"title":"DreamRunState","description":"In-flight state and the daily brakes."},"DreamingStatusResponse":{"properties":{"dry_run":{"type":"boolean","title":"Dry Run","description":"Runs plan and report without committing changes"},"would_trigger":{"type":"boolean","title":"Would Trigger","description":"A memory write right now would start a run"},"gates":{"$ref":"#/components/schemas/DreamGates"},"pressure":{"$ref":"#/components/schemas/DreamPressure"},"run":{"$ref":"#/components/schemas/DreamRunState"},"reports":{"items":{"$ref":"#/components/schemas/DreamReportSummary"},"type":"array","title":"Reports"}},"type":"object","required":["dry_run","would_trigger","gates","pressure","run","reports"],"title":"DreamingStatusResponse","description":"Everything the Dreaming panel renders."},"EncryptionConfigCreate":{"properties":{"provider":{"$ref":"#/components/schemas/KmsKeyProvider","default":"gcp"},"key_resource":{"type":"string","title":"Key Resource","description":"Full GCP KMS resource name. See ``KmsKeyConfig.key_resource``."}},"type":"object","required":["key_resource"],"title":"EncryptionConfigCreate","description":"Request body for ``POST .../encryption`` and ``PUT .../encryption``.\n\nPOST creates a new config (or 409s if one already exists for this\ncloud_provider). PUT replaces the entire config (used for KEK\nrotation — customer minted a new key, points us at it). Both\naccept the same fields; the route handler enforces semantics."},"EncryptionConfigResponse":{"properties":{"provider":{"$ref":"#/components/schemas/KmsKeyProvider"},"key_resource":{"type":"string","title":"Key Resource"},"provisioning_state":{"$ref":"#/components/schemas/integration__schemas__encryption_config__ProvisioningState"},"last_test_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Test At"},"last_test_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Test Error"},"actor_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Email"},"mutated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Mutated At"}},"type":"object","required":["provider","key_resource","provisioning_state","last_test_at","last_test_error","actor_email","mutated_at"],"title":"EncryptionConfigResponse","description":"``GET .../encryption`` response and the body of POST/PUT 200 OKs.\n\nThe key_resource is returned as-is to the admin caller (they\nalready know it — they sent it). Logs/audit trails redact it via\n``kms_client._redact_kek``."},"EncryptionSubscriptionRequiredProblemDetail":{"properties":{"type":{"type":"string","title":"Type","description":"URI identifying the problem type","default":"https://api.platformpilot.ai/errors/byok-encryption-subscription-required"},"title":{"type":"string","title":"Title","default":"Active subscription required"},"status":{"type":"integer","title":"Status","default":402},"detail":{"type":"string","title":"Detail","description":"Human-readable explanation of the gate"}},"type":"object","required":["detail"],"title":"EncryptionSubscriptionRequiredProblemDetail","description":"RFC 9457 problem details for the encryption-config subscription gate.\n\nThe 402 fires only when there's no active subscription at all, so a\n``current_plan`` field would always serialize as ``null`` and add no\ninformation for the SDK or UI — intentionally omitted. If a future\nplan-tier gate is reintroduced for this surface, add the field at\nthat point with a real value, not a perennial null."},"EntitiesOverviewResponse":{"properties":{"entities":{"items":{"$ref":"#/components/schemas/EntityListItem"},"type":"array","title":"Entities"},"pending_aliases":{"items":{"$ref":"#/components/schemas/PendingAlias"},"type":"array","title":"Pending Aliases"},"proposals":{"items":{"$ref":"#/components/schemas/MergeProposal"},"type":"array","title":"Proposals"},"unsupported_facts":{"items":{"$ref":"#/components/schemas/UnsupportedFact"},"type":"array","title":"Unsupported Facts"},"total_entities":{"type":"integer","title":"Total Entities"},"truncated":{"type":"boolean","title":"Truncated","default":false},"precedent_count":{"type":"integer","title":"Precedent Count","default":0},"negative_precedent_count":{"type":"integer","title":"Negative Precedent Count","default":0},"adjudication_min_precedents":{"type":"integer","title":"Adjudication Min Precedents","default":0},"adjudication_active":{"type":"boolean","title":"Adjudication Active","default":false}},"type":"object","required":["entities","pending_aliases","proposals","total_entities"],"title":"EntitiesOverviewResponse","description":"Registry list + curation queue from one bounded sweep."},"EntityDetailResponse":{"properties":{"key":{"type":"string","title":"Key"},"requested_key":{"type":"string","title":"Requested Key"},"redirected":{"type":"boolean","title":"Redirected","default":false},"canonical_name":{"type":"string","title":"Canonical Name","default":""},"entity_type":{"type":"string","title":"Entity Type","default":"unknown"},"entity_type_confirmed":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Entity Type Confirmed"},"status":{"type":"string","title":"Status","default":"active"},"created_at":{"type":"string","title":"Created At","default":""},"rho":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rho"},"facts_at":{"type":"string","title":"Facts At","default":""},"fact_count":{"type":"integer","title":"Fact Count","default":0},"facts":{"items":{"$ref":"#/components/schemas/EntityFactItem"},"type":"array","title":"Facts"},"relations":{"items":{"$ref":"#/components/schemas/EntityRelationOut"},"type":"array","title":"Relations"},"referenced_by":{"items":{"$ref":"#/components/schemas/EntityReferenceOut"},"type":"array","title":"Referenced By"},"member_sample":{"items":{"type":"string"},"type":"array","title":"Member Sample"},"member_preview":{"items":{"$ref":"#/components/schemas/MemberPreviewItem"},"type":"array","title":"Member Preview"},"member_count":{"type":"integer","title":"Member Count","default":0}},"type":"object","required":["key","requested_key"],"title":"EntityDetailResponse","description":"One entity with its fact sheet, edges, and a membership sample.\n\nHistory IS included here: the current-values-by-default rule protects\nLLM prompts from version ambiguity; the curation UI wants the chain."},"EntityFactHistoryEntry":{"properties":{"value":{"type":"string","title":"Value","default":""},"observed_at":{"type":"string","title":"Observed At","default":""},"source_memory_key":{"type":"string","title":"Source Memory Key","default":""},"source_namespace":{"type":"string","title":"Source Namespace","default":""}},"type":"object","title":"EntityFactHistoryEntry","description":"One superseded value in a fact's bounded history chain."},"EntityFactItem":{"properties":{"predicate":{"type":"string","title":"Predicate","default":""},"value":{"type":"string","title":"Value","default":""},"observed_at":{"type":"string","title":"Observed At","default":""},"confidence":{"type":"number","title":"Confidence","default":0.0},"source_memory_key":{"type":"string","title":"Source Memory Key","default":""},"source_namespace":{"type":"string","title":"Source Namespace","default":""},"unsupported_at":{"type":"string","title":"Unsupported At","default":""},"kept":{"type":"boolean","title":"Kept","default":false},"evidence_support":{"type":"integer","title":"Evidence Support","default":0},"evidence_trials":{"type":"integer","title":"Evidence Trials","default":0},"last_negative_at":{"type":"string","title":"Last Negative At","default":""},"ineffective_at":{"type":"string","title":"Ineffective At","default":""},"history":{"items":{"$ref":"#/components/schemas/EntityFactHistoryEntry"},"type":"array","title":"History"}},"type":"object","title":"EntityFactItem","description":"One current-state attribute fact of an entity.\n\n``source_memory_key`` + ``source_namespace`` form the full provenance\naddress of the memory the value was distilled from (empty when the\ndistiller cited no excerpt, or on rows written before grounding)."},"EntityListItem":{"properties":{"key":{"type":"string","title":"Key"},"canonical_name":{"type":"string","title":"Canonical Name","default":""},"entity_type":{"type":"string","title":"Entity Type","default":"unknown"},"status":{"type":"string","title":"Status","default":"active"},"link_count":{"type":"integer","title":"Link Count","default":0},"merged_into":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Merged Into"},"fact_count":{"type":"integer","title":"Fact Count","default":0},"edge_count":{"type":"integer","title":"Edge Count","default":0},"rho":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rho"},"created_at":{"type":"string","title":"Created At","default":""}},"type":"object","required":["key"],"title":"EntityListItem","description":"One registry row in the overview."},"EntityReferenceOut":{"properties":{"predicate":{"type":"string","title":"Predicate","default":""},"subject_key":{"type":"string","title":"Subject Key","default":""},"subject_name":{"type":"string","title":"Subject Name","default":""},"observed_at":{"type":"string","title":"Observed At","default":""},"valid_from":{"type":"string","title":"Valid From","default":""},"valid_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid To"},"closed_mechanism":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Closed Mechanism"}},"type":"object","title":"EntityReferenceOut","description":"One object-side edge: another entity -> predicate -> this entity."},"EntityRelationOut":{"properties":{"predicate":{"type":"string","title":"Predicate","default":""},"object_key":{"type":"string","title":"Object Key","default":""},"object_name":{"type":"string","title":"Object Name","default":""},"observed_at":{"type":"string","title":"Observed At","default":""},"confidence":{"type":"number","title":"Confidence","default":0.0},"valid_from":{"type":"string","title":"Valid From","default":""},"valid_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Valid To"},"closed_mechanism":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Closed Mechanism"},"superseded_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Superseded By"},"evidence_support":{"type":"integer","title":"Evidence Support","default":0},"evidence_trials":{"type":"integer","title":"Evidence Trials","default":0},"last_negative_at":{"type":"string","title":"Last Negative At","default":""},"ineffective_at":{"type":"string","title":"Ineffective At","default":""}},"type":"object","title":"EntityRelationOut","description":"One subject-side edge: this entity -> predicate -> another entity."},"EscalationEvent":{"properties":{"thread_id":{"type":"string","title":"Thread Id"},"from_profile":{"type":"string","title":"From Profile"},"to_profile":{"type":"string","title":"To Profile"},"reason":{"type":"string","title":"Reason"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"alert_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alert Title"},"success":{"type":"boolean","title":"Success","default":true},"timestamp":{"type":"string","title":"Timestamp"}},"type":"object","required":["thread_id","from_profile","to_profile","reason"],"title":"EscalationEvent","description":"Single cross-domain escalation event."},"EscalationEventsResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/EscalationEvent"},"type":"array","title":"Events"}},"type":"object","required":["events"],"title":"EscalationEventsResponse","description":"Wrapper for escalation event list."},"EscalationPairStats":{"properties":{"from_profile":{"type":"string","title":"From Profile"},"to_profile":{"type":"string","title":"To Profile"},"count":{"type":"integer","title":"Count"},"last_occurred":{"type":"string","title":"Last Occurred"},"providers":{"items":{"type":"string"},"type":"array","title":"Providers"}},"type":"object","required":["from_profile","to_profile","count","last_occurred","providers"],"title":"EscalationPairStats","description":"Aggregate stats for a (from_profile, to_profile) pair."},"EscalationRecommendationsResponse":{"properties":{"recommendations":{"items":{"$ref":"#/components/schemas/ProfilePinRecommendation"},"type":"array","title":"Recommendations"}},"type":"object","required":["recommendations"],"title":"EscalationRecommendationsResponse","description":"Wrapper for profile-pin recommendations."},"EscalationStatsResponse":{"properties":{"stats":{"items":{"$ref":"#/components/schemas/EscalationPairStats"},"type":"array","title":"Stats"}},"type":"object","required":["stats"],"title":"EscalationStatsResponse","description":"Wrapper for escalation pair stats."},"ExcludedServer":{"properties":{"name":{"type":"string","title":"Name"},"reason":{"type":"string","enum":["oauth_token_missing","unsupported_transport","missing_url","connection_timeout","connection_failed"],"title":"Reason"},"message":{"type":"string","title":"Message"},"needs_authorization":{"type":"boolean","title":"Needs Authorization","default":false}},"type":"object","required":["name","reason","message"],"title":"ExcludedServer","description":"Information about an excluded server."},"ExecutorInfo":{"properties":{"id":{"type":"string","title":"Id"},"description":{"type":"string","title":"Description"}},"type":"object","required":["id","description"],"title":"ExecutorInfo","description":"Describes an available executor type."},"ExtraUsageSettingsResponse":{"properties":{"billing_model":{"type":"string","title":"Billing Model","description":"Billing model: 'prepaid' (Starter/Pro) or 'postpaid' (Enterprise)","default":"prepaid"},"plan_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Id","description":"User's subscription plan"},"prepaid_credits_available":{"type":"integer","title":"Prepaid Credits Available","description":"Prepaid credits purchased (never expire)","default":0},"extra_usage_enabled":{"type":"boolean","title":"Extra Usage Enabled","description":"Whether postpaid overage billing is enabled (Enterprise only)"},"extra_usage_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Extra Usage Cap Cents","description":"Max monthly overage spend in cents (NULL = unlimited)"},"extra_usage_cap_dollars":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Extra Usage Cap Dollars","description":"Max monthly overage spend in dollars (for display)"},"overage_credits_used":{"type":"integer","title":"Overage Credits Used","description":"Overage credits used this billing period (postpaid)"},"overage_spend_cents":{"type":"integer","title":"Overage Spend Cents","description":"Current overage spend in cents (postpaid)"},"overage_spend_dollars":{"type":"number","title":"Overage Spend Dollars","description":"Current overage spend in dollars (postpaid)"},"remaining_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Remaining Cap Cents","description":"Remaining overage budget in cents (NULL if unlimited)"},"remaining_cap_dollars":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Remaining Cap Dollars","description":"Remaining overage budget in dollars (NULL if unlimited)"},"price_per_credit_cents":{"type":"integer","title":"Price Per Credit Cents","description":"Price per credit in cents"}},"type":"object","required":["extra_usage_enabled","overage_credits_used","overage_spend_cents","overage_spend_dollars","price_per_credit_cents"],"title":"ExtraUsageSettingsResponse","description":"Response schema for extra usage settings."},"ExtraUsageSettingsUpdateRequest":{"properties":{"extra_usage_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Extra Usage Enabled","description":"Enable/disable overage billing"},"extra_usage_cap_cents":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Extra Usage Cap Cents","description":"Max monthly overage spend in cents (0 = no limit)"}},"type":"object","title":"ExtraUsageSettingsUpdateRequest","description":"Request schema for updating extra usage settings."},"FactorPolarity":{"type":"string","enum":["support","attack"],"title":"FactorPolarity","description":"Sign of a ranking factor's contribution to QBAF aggregation."},"GCPServiceBatchCreate":{"properties":{"services":{"items":{"additionalProperties":true,"type":"object"},"type":"array","minItems":1,"title":"Services","description":"List of services to register (each with service_name, display_name, category)"}},"type":"object","required":["services"],"title":"GCPServiceBatchCreate","description":"Request schema for batch service registration."},"GCPServiceBatchResponse":{"properties":{"total":{"type":"integer","title":"Total"},"created":{"type":"integer","title":"Created"},"skipped":{"type":"integer","title":"Skipped"},"results":{"items":{"$ref":"#/components/schemas/ServiceCreationResult"},"type":"array","title":"Results"}},"type":"object","required":["total","created","skipped","results"],"title":"GCPServiceBatchResponse","description":"Response schema for bulk service registration."},"GCPServiceListResponse":{"properties":{"services":{"items":{"$ref":"#/components/schemas/GCPServiceResponse"},"type":"array","title":"Services"}},"type":"object","required":["services"],"title":"GCPServiceListResponse","description":"Response schema for list of GCP services."},"GCPServiceResponse":{"properties":{"service_name":{"type":"string","title":"Service Name"},"display_name":{"type":"string","title":"Display Name"},"category":{"type":"string","title":"Category"},"labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Labels"},"iam_roles":{"items":{"type":"string"},"type":"array","title":"Iam Roles"},"discovered_at":{"type":"string","title":"Discovered At","default":""}},"type":"object","required":["service_name","display_name","category"],"title":"GCPServiceResponse","description":"Response schema for a registered GCP service."},"GoogleTestRequest":{"properties":{"projectID":{"type":"string","title":"Projectid","description":"Google Cloud Project ID to test"}},"type":"object","required":["projectID"],"title":"GoogleTestRequest","description":"Request model for Google Cloud integration test"},"GrantBrainPassRequest":{"properties":{"org_id":{"type":"string","title":"Org Id","description":"Organization to credit (the pay token 'sub')."},"jti":{"type":"string","title":"Jti","description":"Pay token id; the idempotency key for this purchase."},"sku":{"type":"string","title":"Sku","description":"Pass SKU (e.g. 'platformpilot-starter'); resolves price + duration."},"payment_intent_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Intent Id","description":"Stripe PaymentIntent that settled the charge (audit)."},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By","description":"Optional Auth0 uid of the human who approved the spend."}},"type":"object","required":["org_id","jti","sku"],"title":"GrantBrainPassRequest","description":"Request to grant (or idempotently re-confirm) a Brain access pass.\n\nThe grant is keyed on ``jti`` (the pay token id), so a retry (or the\nwebhook backstop firing for the same payment) converges to one pass. The\npass horizon (``paid_through``) is computed server-side from the SKU's\n``duration_days``; the client does NOT supply it (the backend stays\nauthoritative on duration just as it is on price)."},"GrantBrainPassResponse":{"properties":{"granted":{"type":"boolean","title":"Granted","description":"True once the pass is recorded."},"tier":{"type":"string","title":"Tier","description":"Entitlement tier the pass confers.","default":"paid"},"jti":{"type":"string","title":"Jti","description":"The purchase id (echoed for correlation)."},"paid_through":{"type":"string","format":"date-time","title":"Paid Through","description":"UTC instant the pass entitlement lapses."}},"type":"object","required":["granted","jti","paid_through"],"title":"GrantBrainPassResponse","description":"Result of a Brain access pass grant."},"GraphInfo":{"properties":{"id":{"type":"string","title":"Id"},"description":{"type":"string","title":"Description"},"display_name":{"type":"string","title":"Display Name","default":""}},"type":"object","required":["id","description"],"title":"GraphInfo","description":"Describes an available orchestration graph."},"GroundingEntry":{"properties":{"canonical":{"type":"string","title":"Canonical","description":"Display spelling of the canonical category"},"folded":{"items":{"type":"string"},"type":"array","title":"Folded","description":"Raw emergent labels the dream reconcile mapped onto this canonical (non-identity ledger entries). The ledger keeps label names only, not per-label memory counts — folded rows were rewritten to the canonical, so their original counts no longer exist"}},"type":"object","required":["canonical"],"title":"GroundingEntry","description":"One canonical category and the raw labels reconcile folded into it."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthStatus":{"type":"string","enum":["ok","unreachable","auth_failed","schema_mismatch"],"title":"HealthStatus","description":"Most recent ``_ensure_byo_db_health`` probe outcome.\n\nPopulated by the eight-check probe at activation; pre-flight\nprobes at config write time only emit ``ok`` / ``unreachable``."},"IAMGrantRequest":{"properties":{"service_name":{"type":"string","title":"Service Name","description":"GCP API name"},"role":{"type":"string","title":"Role","description":"IAM role to grant"},"access_level":{"type":"string","pattern":"^(viewer|admin)$","title":"Access Level","description":"Access level: viewer or admin","default":"viewer"}},"type":"object","required":["service_name","role"],"title":"IAMGrantRequest","description":"Request to grant an IAM role."},"IAMGrantResult":{"properties":{"service_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Name"},"role":{"type":"string","title":"Role"},"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"fix_command":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fix Command"}},"type":"object","required":["role","success","message"],"title":"IAMGrantResult","description":"Result of IAM grant or revoke operation."},"IAMRecommendation":{"properties":{"service_name":{"type":"string","title":"Service Name"},"display_name":{"type":"string","title":"Display Name"},"recommended_role":{"type":"string","title":"Recommended Role"},"has_role":{"type":"boolean","title":"Has Role"},"access_level":{"type":"string","title":"Access Level","description":"viewer or admin"},"gcloud_command":{"type":"string","title":"Gcloud Command"}},"type":"object","required":["service_name","display_name","recommended_role","has_role","access_level","gcloud_command"],"title":"IAMRecommendation","description":"IAM role recommendation for a service."},"IAMRevokeRequest":{"properties":{"role":{"type":"string","title":"Role","description":"IAM role to revoke"}},"type":"object","required":["role"],"title":"IAMRevokeRequest","description":"Request to revoke an IAM role."},"IntegrationTestResponse":{"properties":{"result":{"type":"string","title":"Result","description":"Test result: 'success' or 'failed'"},"message":{"type":"string","title":"Message","description":"Descriptive message about the test result"}},"type":"object","required":["result","message"],"title":"IntegrationTestResponse","description":"Response model for integration test results"},"InviteCreateRequest":{"properties":{"channel_id":{"type":"string","maxLength":64,"minLength":1,"title":"Channel Id"},"sender_id":{"type":"string","maxLength":255,"minLength":1,"title":"Sender Id"},"target_user_id":{"type":"string","maxLength":36,"minLength":1,"title":"Target User Id"}},"type":"object","required":["channel_id","sender_id","target_user_id"],"title":"InviteCreateRequest","description":"Request to generate an invite link for channel identity linking."},"InviteResponse":{"properties":{"url":{"type":"string","title":"Url"},"token":{"type":"string","title":"Token"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["url","token","expires_at"],"title":"InviteResponse","description":"Response with the invite URL and token."},"InvoiceListResponse":{"properties":{"invoices":{"items":{"$ref":"#/components/schemas/InvoiceResponse"},"type":"array","title":"Invoices","description":"List of invoices"},"count":{"type":"integer","title":"Count","description":"Number of invoices returned in this response"},"has_more":{"type":"boolean","title":"Has More","description":"Whether more invoices exist beyond this page"}},"type":"object","required":["invoices","count","has_more"],"title":"InvoiceListResponse","description":"Response schema for paginated invoice list."},"InvoiceResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Stripe invoice ID"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number","description":"Invoice number (e.g., INV-0001)"},"created":{"type":"string","format":"date-time","title":"Created","description":"Invoice creation date"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date","description":"Payment due date"},"amount_due":{"type":"integer","title":"Amount Due","description":"Amount due in cents"},"amount_paid":{"type":"integer","title":"Amount Paid","description":"Amount paid in cents"},"currency":{"type":"string","title":"Currency","description":"Three-letter ISO currency code"},"status":{"type":"string","title":"Status","description":"Invoice status (draft, open, paid, uncollectible, void)"},"hosted_invoice_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hosted Invoice Url","description":"URL to view/pay the invoice"},"invoice_pdf":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Pdf","description":"URL to download PDF"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Invoice description"},"subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Id","description":"Associated subscription ID"}},"type":"object","required":["id","created","amount_due","amount_paid","currency","status"],"title":"InvoiceResponse","description":"Response schema for a single invoice."},"JobCreateRequest":{"properties":{"schedule":{"type":"string","title":"Schedule","description":"UTC cron expression (5 fields: minute hour day month weekday). Examples: '0 */6 * * *' (every 6h), '30 9 * * 1-5' (weekdays 09:30 UTC)."},"task_description":{"type":"string","maxLength":4000,"minLength":1,"title":"Task Description"},"assistant_id":{"type":"string","title":"Assistant Id","default":"PlatformPilot"}},"type":"object","required":["schedule","task_description"],"title":"JobCreateRequest","description":"Request schema for creating a scheduled job."},"JobResponse":{"properties":{"cron_id":{"type":"string","title":"Cron Id"},"schedule":{"type":"string","title":"Schedule"},"task_description":{"type":"string","title":"Task Description"},"assistant_id":{"type":"string","title":"Assistant Id"},"enabled":{"type":"boolean","title":"Enabled"},"next_run_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Run Date"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["cron_id","schedule","task_description","assistant_id","enabled"],"title":"JobResponse","description":"Response schema for a scheduled job."},"JobUpdateRequest":{"properties":{"schedule":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule"},"task_description":{"anyOf":[{"type":"string","maxLength":4000,"minLength":1},{"type":"null"}],"title":"Task Description"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"JobUpdateRequest","description":"Request schema for updating a scheduled job (partial)."},"KmsKeyProvider":{"type":"string","enum":["gcp"],"title":"KmsKeyProvider","description":"Cloud provider hosting the customer's KMS key.\n\nPhase B = GCP only. AWS/Azure are documented in PLA-204 Phase D\nand live behind a separate ``kms_client_aws.py`` /\n``kms_client_azure.py`` not implemented here. The enum is\nforward-looking so a tenant who later upgrades doesn't break\nschema compatibility on stored records."},"KubernetesClusterBatchCreate":{"properties":{"clusters":{"items":{"additionalProperties":true,"type":"object"},"type":"array","minItems":1,"title":"Clusters","description":"List of clusters to create (each with cluster_name and optional labels)","examples":[[{"cluster_name":"prod-gke-us-central1","labels":{"region":"us-central1","stage":"production"}},{"cluster_name":"staging-gke-us-east1","labels":{"region":"us-east1","stage":"staging"}}]]}},"type":"object","required":["clusters"],"title":"KubernetesClusterBatchCreate","description":"Request schema for creating multiple Kubernetes clusters in a single request."},"KubernetesClusterBatchResponse":{"properties":{"total":{"type":"integer","title":"Total","description":"Total clusters in request"},"created":{"type":"integer","title":"Created","description":"Number of clusters created"},"skipped":{"type":"integer","title":"Skipped","description":"Number of clusters skipped (already exist)"},"failed":{"type":"integer","title":"Failed","description":"Number of clusters that failed"},"results":{"items":{"$ref":"#/components/schemas/ClusterCreationResult"},"type":"array","title":"Results","description":"Per-cluster results"}},"type":"object","required":["total","created","skipped","failed","results"],"title":"KubernetesClusterBatchResponse","description":"Response schema for bulk cluster creation."},"KubernetesClusterListResponse":{"properties":{"clusters":{"items":{"$ref":"#/components/schemas/KubernetesClusterResponse"},"type":"array","title":"Clusters"}},"type":"object","required":["clusters"],"title":"KubernetesClusterListResponse","description":"Response schema for list of Kubernetes clusters."},"KubernetesClusterResponse":{"properties":{"cluster_name":{"type":"string","title":"Cluster Name"},"provider_key":{"type":"string","title":"Provider Key"},"labels":{"additionalProperties":{"type":"string"},"type":"object","title":"Labels"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["cluster_name","provider_key","labels","created_at"],"title":"KubernetesClusterResponse","description":"Response schema for Kubernetes cluster details (hierarchical)."},"KubernetesClusterUpdate":{"properties":{"labels":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Labels","description":"Updated labels"}},"type":"object","title":"KubernetesClusterUpdate","description":"Request schema for updating Kubernetes cluster."},"LinkRulingRequest":{"properties":{"a_key":{"type":"string","title":"A Key","description":"One endpoint's memory key"},"b_key":{"type":"string","title":"B Key","description":"The other endpoint's memory key"},"namespace":{"type":"string","enum":["episodes","knowledge"],"title":"Namespace","description":"Namespace both memories live in"},"ruling":{"type":"string","enum":["confirm","dispute"],"title":"Ruling","description":"'confirm' = this connection is right; 'dispute' = it is wrong. Disputing does not delete the connection: it marks it so recall stops leaning on it and the graph can show it as rejected."}},"type":"object","required":["a_key","b_key","namespace","ruling"],"title":"LinkRulingRequest","description":"A reviewer's verdict on one connection between two memories."},"LinkRulingResponse":{"properties":{"a_key":{"type":"string","title":"A Key"},"b_key":{"type":"string","title":"B Key"},"namespace":{"type":"string","title":"Namespace"},"provenance":{"type":"string","enum":["structural","inferred","confirmed","disputed"],"title":"Provenance","description":"The tier now recorded on both directions of the edge"},"directions_stamped":{"type":"integer","title":"Directions Stamped","description":"How many of the two stored directions were updated. Normally 2; 1 when only one side records the link (a half-written edge)."}},"type":"object","required":["a_key","b_key","namespace","provenance","directions_stamped"],"title":"LinkRulingResponse","description":"Result of a link ruling."},"LinkedEntityOut":{"properties":{"key":{"type":"string","title":"Key","default":""},"name":{"type":"string","title":"Name","default":""},"entity_type":{"type":"string","title":"Entity Type","default":"unknown"}},"type":"object","title":"LinkedEntityOut","description":"One entity linked to a memory, resolved to its terminal survivor.\n\n``key`` is the registry row key (``entity:{uuid}``), directly usable\nas the workbench deep-link target (``/brain/workbench?entity=<key>``);\nthe mention-to-key resolution already happened in the entity layer."},"LongMemEvalRunResponse":{"properties":{"technique":{"type":"string","title":"Technique"},"total_questions":{"type":"integer","title":"Total Questions"},"total_sessions_seeded":{"type":"integer","title":"Total Sessions Seeded"},"total_duration_s":{"type":"number","title":"Total Duration S"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows","description":"Per-question rows: question, response, retrieved, recall, ..."},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","required":["technique","total_questions","total_sessions_seeded","total_duration_s","rows"],"title":"LongMemEvalRunResponse","description":"Response from the run phase."},"LongMemEvalScoreResponse":{"properties":{"accuracy":{"additionalProperties":true,"type":"object","title":"Accuracy"},"recall":{"additionalProperties":true,"type":"object","title":"Recall"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows","description":"Scored rows (each with a `correct` flag) for failure inspection."}},"type":"object","required":["accuracy","recall"],"title":"LongMemEvalScoreResponse","description":"Response from the score phase: QA accuracy + retrieval recall@k."},"MABRunResponse":{"properties":{"technique":{"type":"string","title":"Technique"},"total_records":{"type":"integer","title":"Total Records"},"total_chunks_seeded":{"type":"integer","title":"Total Chunks Seeded"},"total_duration_s":{"type":"number","title":"Total Duration S"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows","description":"Per-probe rows: question, response, correct, answer_in_context, ..."},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","required":["technique","total_records","total_chunks_seeded","total_duration_s","rows"],"title":"MABRunResponse","description":"Response from the run phase (rows already scored — deterministic)."},"MABScoreResponse":{"properties":{"summary":{"additionalProperties":true,"type":"object","title":"Summary"}},"type":"object","required":["summary"],"title":"MABScoreResponse","description":"Aggregated accuracy (overall + per competency) + fact-grounding rate."},"MCPOAuthConfig":{"properties":{"type":{"type":"string","const":"oauth2","title":"Type","default":"oauth2"},"grant_type":{"type":"string","enum":["client_credentials","authorization_code"],"title":"Grant Type","default":"client_credentials"},"authorization_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization Endpoint"},"token_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Endpoint"},"registration_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registration Endpoint"},"revocation_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revocation Endpoint"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Secret"},"dynamic_registration":{"type":"boolean","title":"Dynamic Registration","default":false},"initial_access_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initial Access Token"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes","default":[]},"resource":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource"},"redirect_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"},"token_secret_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Secret Ref"}},"type":"object","title":"MCPOAuthConfig","description":"OAuth 2.1 configuration for MCP server authentication.\n\nSupports both client_credentials (server-to-server) and authorization_code\n(user-delegated) grant types with PKCE. Dynamic client registration (RFC 7591)\nis supported for on-demand client provisioning."},"MCPServerConfig":{"properties":{"transport":{"type":"string","enum":["sse","http"],"title":"Transport","default":"sse"},"url":{"type":"string","title":"Url"},"headers":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Headers"},"timeout":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Timeout"},"sse_read_timeout":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sse Read Timeout"},"auth":{"anyOf":[{"$ref":"#/components/schemas/MCPOAuthConfig"},{"type":"null"}]},"session_kwargs":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Session Kwargs"},"terminate_on_close":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Terminate On Close"},"enabled":{"type":"boolean","title":"Enabled","default":true},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]},"resolved_ips":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Resolved Ips"}},"type":"object","required":["url"],"title":"MCPServerConfig","description":"MCP server configuration schema for remote MCP servers.\n\nSupported transports:\n- sse: Server-Sent Events (recommended for most MCP servers like Linear)\n- http: HTTP streaming\n\nThe resolved_ips field stores IP addresses resolved at validation time\nfor DNS pinning - preventing DNS rebinding attacks where the hostname\nresolves to a different (internal) IP at connection time."},"MediaUploadResponse":{"properties":{"content_block":{"additionalProperties":true,"type":"object","title":"Content Block"},"retained_in_memory":{"type":"boolean","title":"Retained In Memory","default":true},"retention_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Retention Reason"}},"type":"object","required":["content_block"],"title":"MediaUploadResponse","description":"Response from the media upload endpoint."},"MemberPreviewItem":{"properties":{"key":{"type":"string","title":"Key"},"namespace":{"type":"string","title":"Namespace"},"label":{"type":"string","title":"Label","default":""}},"type":"object","required":["key","namespace"],"title":"MemberPreviewItem","description":"One linked-memory sample enriched for display.\n\nBare keys tell the user nothing; ``key`` + ``namespace`` form the memory\naddress the UI's hover card dereferences, and ``label`` is the memory's\none-sentence ``context`` (truncated) — the same de-facto title the\ncitation chips use."},"MemoryDbConfigCreate":{"properties":{"instance_connection_name":{"type":"string","maxLength":200,"title":"Instance Connection Name","description":"Cloud SQL connection string of the form ``project:region:instance``."},"database":{"type":"string","maxLength":63,"title":"Database","description":"Postgres database name within the instance. Capped at the Postgres identifier length (63 chars) so the REST layer rejects oversized payloads before the inner ``MemoryDbConfig`` validators see them."},"iam_user":{"type":"string","maxLength":320,"title":"Iam User","description":"Service-account email used as the IAM DB user. Must end in ``.iam.gserviceaccount.com``."},"public_ip":{"anyOf":[{"type":"string","maxLength":45},{"type":"null"}],"title":"Public Ip","description":"Public IPv4 address of the Cloud SQL instance, or ``None`` if registered pre-IP-resolution. Capped at the longest legal IPv6 textual form (45 chars) so the payload layer rejects oversized strings before the inner ``MemoryDbConfig._check_public_ip`` runs."},"openai_api_key":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Openai Api Key","description":"Optional: the org's own OpenAI API key for embedding traffic (BYOK). Omit/null = keep any existing key; empty string = clear it. Never echoed in responses."}},"type":"object","required":["instance_connection_name","database","iam_user"],"title":"MemoryDbConfigCreate","description":"POST payload for memory-db config.\n\n``provisioning_state`` always starts at ``pending`` from the\nREST surface — the dispatcher is the only thing that should be\nable to flip it to ``active``, and that happens via\n``set_memory_db_active(...)`` after the health probe passes.\n\nLength-bounded regexes are hoisted from ``MemoryDbConfig`` to\nTHIS payload: the REST route fans out to the Cloud SQL Admin API\n(``fetch_cloud_sql_tls_metadata``) BEFORE constructing\n``MemoryDbConfig``, so without the bounds at the payload layer a\nmulti-MB ``iam_user`` / ``instance_connection_name`` would reach\nGoogle's API and get echoed into the ``TlsMetadataFetchError``\nlog line. ``provisioned_by`` is intentionally NOT a payload field:\ncaller-controlled mass-assign here would let a REST caller mark a\nconfig as ``agent``-provisioned when only the onboarding agent\nshould set that — the route always stamps ``MANUAL`` regardless\nof payload."},"MemoryDbConfigResponse":{"properties":{"instance_connection_name":{"type":"string","title":"Instance Connection Name"},"database":{"type":"string","title":"Database"},"iam_user":{"type":"string","title":"Iam User"},"public_ip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Ip"},"instance_dns_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Instance Dns Name"},"server_ca_pinned":{"type":"boolean","title":"Server Ca Pinned","description":"Whether a per-instance server CA is pinned for this config. The raw PEM is intentionally not echoed over REST — it is a public certificate but bloats responses and operators retrieve it from gcloud when needed. ``False`` means BYO connects fail closed until activation re-fetches the CA."},"openai_key_configured":{"type":"boolean","title":"Openai Key Configured","description":"Whether the org supplied its own OpenAI embedding key (BYOK). The ciphertext and fingerprint are intentionally not echoed over REST (this bool mirrors the ``server_ca_pinned`` precedent) so the admin UI can show key status without ever handling the secret.","default":false},"provisioning_state":{"$ref":"#/components/schemas/integration__schemas__memory_db__ProvisioningState"},"pending_operation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pending Operation Id"},"provisioned_by":{"anyOf":[{"$ref":"#/components/schemas/ProvisionedBy"},{"type":"null"}]},"provisioned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Provisioned At"},"last_health_check":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Health Check"},"last_health_status":{"anyOf":[{"$ref":"#/components/schemas/HealthStatus"},{"type":"null"}]},"last_setup_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Setup At"},"actor_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Email","description":"Email of the last actor that mutated this config. ``None`` for legacy configs that pre-date the audit trail."},"mutated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Mutated At","description":"UTC timestamp of the last mutation."}},"type":"object","required":["instance_connection_name","database","iam_user","public_ip","instance_dns_name","server_ca_pinned","provisioning_state","pending_operation_id","provisioned_by","provisioned_at","last_health_check","last_health_status","last_setup_at"],"title":"MemoryDbConfigResponse","description":"GET payload — same fields as the stored record.\n\nNo fields here are secret (the IAM auth pattern means we never\nstash a password), but we still keep this distinct from\n``MemoryDbConfig`` so future internal-only fields (e.g., a\npool-cache key) can be added without leaking via REST."},"MemoryGraphLink":{"properties":{"source":{"type":"string","title":"Source","description":"Source node ID (memory key)"},"target":{"type":"string","title":"Target","description":"Target node ID (memory key)"},"cross_namespace":{"type":"boolean","title":"Cross Namespace","description":"Whether link crosses namespace boundary","default":false},"strength":{"type":"number","title":"Strength","description":"Edge strength (0.0-1.0), min-max normalized per response from the stored link_strengths (tube diameter) with an evolution-event-count fallback","default":0.0},"link_type":{"type":"string","enum":["related","bridge","causes","precedes","updates","contradicts"],"title":"Link Type","description":"Edge relation type (most specific of the two stored directions). NEAR family (same-topic): 'related' (elaboration), 'precedes' (temporal order), 'updates' (newer info), 'contradicts' (conflict). BRIDGE family (cross-topic connector): 'bridge', 'causes' (causal). Absent/legacy edges → 'related'. Clients should render the bridge FAMILY (bridge OR causes) as cross-topic, not just the literal 'bridge'.","default":"related"},"provenance":{"type":"string","enum":["structural","inferred","confirmed","disputed"],"title":"Provenance","description":"Who asserted this edge, collapsed across its two stored directions to the tier that most demands attention (disputed > confirmed > inferred > structural). 'structural' = a deterministic writer created it; 'inferred' = proposed automatically, and the reading for every edge predating this field; 'confirmed'/'disputed' = a reviewer ruled on it. Clients should render 'disputed' distinctly (a reviewer said this connection is wrong) and may de-emphasize 'inferred'.","default":"inferred"}},"type":"object","required":["source","target"],"title":"MemoryGraphLink","description":"An edge in the memory knowledge graph."},"MemoryGraphNode":{"properties":{"id":{"type":"string","title":"Id","description":"Memory key (unique within namespace)"},"namespace":{"type":"string","title":"Namespace","description":"Source namespace: 'episodes' or 'knowledge'"},"category":{"type":"string","title":"Category","description":"LLM-classified category","default":"Uncategorized"},"retrieval_count":{"type":"integer","title":"Retrieval Count","description":"Times retrieved","default":0},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"ISO creation timestamp"},"last_accessed":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Accessed","description":"ISO last access timestamp"},"event_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Time","description":"Original event/alert timestamp"},"link_count":{"type":"integer","title":"Link Count","description":"Number of links to other memories","default":0},"content_preview":{"type":"string","title":"Content Preview","description":"Truncated content for tooltip (max 200 chars)","default":""},"superseded":{"type":"boolean","title":"Superseded","description":"Whether this record has been superseded (marked stale by a newer memory). Surfaced so the viz can flag stale records for the pre-reap spot-check the supersession design relies on.","default":false},"superseded_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Superseded At","description":"Earliest invalid_at across the superseded_by log, if superseded"},"superseded_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Superseded By","description":"Key of the current-truth record that replaced this one (the newest superseding entry by written_at). Surfaced so the pre-reap spot-check can see not just THAT a record is stale but BY WHAT — without it the operator can't judge whether the supersede was correct."},"absorbed":{"type":"boolean","title":"Absorbed","description":"Whether a dream consolidation absorbed this record into a canonical. Absorbed rows are hidden from recall in EVERY mode (their content lives on in the canonical), so without this marker the graph shows nodes the agent can never recall, indistinguishable from live ones.","default":false},"absorbed_into":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Absorbed Into","description":"Key of the dream canonical that absorbed this record (_amem.absorbed_into), so the viz can point at where the content lives on."}},"type":"object","required":["id","namespace"],"title":"MemoryGraphNode","description":"A lean node in the memory knowledge graph.\n\nIntentionally omits the heavy per-memory fields (``context``,\n``keywords``, ``tags``) — the graph render only needs id/namespace/\ncounts/preview, and those heavy fields are used solely by the detail\npanel for the ONE selected node. They are fetched on demand via\n``GET /{namespace}/{memory_key}`` (``MemoryNodeDetail``) so the whole-\ngraph payload stays small."},"MemoryGraphResponse":{"properties":{"nodes":{"items":{"$ref":"#/components/schemas/MemoryGraphNode"},"type":"array","title":"Nodes"},"links":{"items":{"$ref":"#/components/schemas/MemoryGraphLink"},"type":"array","title":"Links"},"total_memories":{"type":"integer","title":"Total Memories","description":"Total memory count across requested namespaces","default":0},"truncated":{"type":"boolean","title":"Truncated","description":"Whether the graph was truncated due to size limits","default":false},"max_nodes":{"type":"integer","title":"Max Nodes","description":"Max node limit applied","default":0}},"type":"object","title":"MemoryGraphResponse","description":"D3.js-compatible force graph data."},"MemoryNodeDetail":{"properties":{"id":{"type":"string","title":"Id","description":"Memory key (unique within namespace)"},"namespace":{"type":"string","title":"Namespace","description":"Source namespace: 'episodes' or 'knowledge'"},"context":{"type":"string","title":"Context","description":"One-sentence context summary","default":""},"seed_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seed Source","description":"Origin label when this memory was imported by a seed batch (item 5 origin chip); None for agent-earned memories"},"seed_source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seed Source Id","description":"Stable source-registry id (Provenance v2); None for agent-earned or pre-registry memories"},"seed_source_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed Source Version","description":"Which import version of the source produced this memory"},"seed_superseded":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Seed Superseded","description":"Set when a newer import of the same source no longer contains this fact ({at, by_version, by_batch}); the row is kept, annotated, and resurrected if a later import re-confirms it"},"keywords":{"items":{"type":"string"},"type":"array","title":"Keywords","description":"Key terms"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","description":"Classification tags"},"linked_entities":{"items":{"$ref":"#/components/schemas/LinkedEntityOut"},"type":"array","title":"Linked Entities","description":"Active entities linked to this memory (bounded, name-sorted), for cross-navigation into the entity workbench. Empty when the entity layer is off for the org."},"media":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Media","description":"Media attachment pointers on this memory (kind, mime, description, described, origin, checksum...). Renders as the detail-panel chip; the description is the searchable text projection, and bucket/object keys are pointers the UI must never turn into URLs."},"resolved_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved From","description":"Original requested key when this node was reached by following a redirect (the memory was merged/superseded by consolidation or dreaming). None for a direct hit. Lets a citation chip show that it resolved to the surviving memory."}},"type":"object","required":["id","namespace"],"title":"MemoryNodeDetail","description":"Heavy per-memory fields, fetched lazily for the ONE selected node.\n\nCarries the fields trimmed from ``MemoryGraphNode`` so the detail panel\ncan render context/keywords/tags without those riding along in the\nwhole-graph payload. id/namespace are echoed back for the caller to\nconfirm it got the node it asked for."},"MergeProposal":{"properties":{"key":{"type":"string","title":"Key"},"entity_a":{"type":"string","title":"Entity A"},"entity_b":{"type":"string","title":"Entity B"},"entity_a_name":{"type":"string","title":"Entity A Name","default":""},"entity_b_name":{"type":"string","title":"Entity B Name","default":""},"score":{"type":"number","title":"Score","default":0.0},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"alias_surface":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias Surface"},"blocked_writes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Blocked Writes"},"sparse_cosine":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Sparse Cosine"},"shared_terms":{"items":{"type":"string"},"type":"array","title":"Shared Terms"},"divergent_terms_a":{"items":{"type":"string"},"type":"array","title":"Divergent Terms A"},"divergent_terms_b":{"items":{"type":"string"},"type":"array","title":"Divergent Terms B"},"llm_verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Verdict"},"llm_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Llm Confidence"},"llm_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm At"}},"type":"object","required":["key","entity_a","entity_b"],"title":"MergeProposal","description":"A dream-sweep merge proposal awaiting curation.\n\nThe ``sparse_*``/``*_terms`` fields carry pooled learned-sparse term\nevidence (what each side's linked memories actually talk about) when\nthe sparse channel was live at proposal time; empty otherwise."},"NamespaceConfig":{"properties":{"name":{"type":"string","title":"Name","description":"Namespace name, e.g. 'security_incidents'"},"display_title":{"type":"string","title":"Display Title","description":"Human-readable heading, e.g. 'Security Incidents'"},"fields":{"items":{"$ref":"#/components/schemas/NamespaceFieldConfig"},"type":"array","maxItems":20,"minItems":1,"title":"Fields","description":"1-20 field definitions"},"search_limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Search Limit","default":3},"consolidation_threshold":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Consolidation Threshold"},"supports_supersession":{"type":"boolean","title":"Supports Supersession","description":"Whether the supersede verdict may stale records here. Leave False for append-only/historical namespaces (e.g. episodes); set True only for revisable knowledge-style namespaces. Gated additionally by the global AMEM_SUPERSESSION_ENABLED.","default":false},"empty_message":{"type":"string","title":"Empty Message","default":"No relevant items found."},"search_tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Tool Name"},"search_tool_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Tool Instructions"},"manage_tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manage Tool Name"},"manage_tool_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manage Tool Instructions"}},"type":"object","required":["name","display_title","fields"],"title":"NamespaceConfig","description":"Configuration for a single memory namespace within a domain."},"NamespaceFieldConfig":{"properties":{"name":{"type":"string","title":"Name","description":"snake_case field name"},"field_type":{"type":"string","enum":["str","list[str]","float","int"],"title":"Field Type","description":"Python type for the field","default":"str"},"description":{"type":"string","title":"Description","description":"Field description for create_model()"},"required":{"type":"boolean","title":"Required","default":true},"display_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Label","description":"Label for formatter (auto-derived from name if None)"},"is_primary":{"type":"boolean","title":"Is Primary","description":"Primary fields shown in header line","default":false},"variants":{"anyOf":[{"items":{"$ref":"#/components/schemas/NamespaceFieldVariant"},"type":"array"},{"type":"null"}],"title":"Variants","description":"Per-schema breakdown when the same field exists in multiple schemas of a unified namespace. None for single-schema fields (the canonical case)."}},"type":"object","required":["name","description"],"title":"NamespaceFieldConfig","description":"Configuration for a single field within a namespace schema."},"NamespaceFieldRequest":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name"},"field_type":{"type":"string","title":"Field Type","default":"str"},"description":{"type":"string","minLength":1,"title":"Description"},"required":{"type":"boolean","title":"Required","default":true},"display_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Label"},"is_primary":{"type":"boolean","title":"Is Primary","default":false}},"type":"object","required":["name","description"],"title":"NamespaceFieldRequest","description":"Request schema for a namespace field definition."},"NamespaceFieldVariant":{"properties":{"schema_class":{"type":"string","title":"Schema Class","description":"Pydantic class name where this variant lives"},"field_type":{"type":"string","enum":["str","list[str]","float","int"],"title":"Field Type"},"description":{"type":"string","title":"Description"}},"type":"object","required":["schema_class","field_type","description"],"title":"NamespaceFieldVariant","description":"Per-schema description of a field that's declared in multiple schemas.\n\nUsed by built-in unified-namespace responses (e.g., ``knowledge``\nholds ``KnowledgePattern`` + ``DRPattern`` + ``Rubric``)\nwhere the same field name has different descriptions or types\ndepending on which discriminated-union variant the record is.\nCustom domains never populate this — their schemas are 1:1 with\nnamespaces."},"NamespaceRequest":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name"},"display_title":{"type":"string","maxLength":128,"minLength":1,"title":"Display Title"},"fields":{"items":{"$ref":"#/components/schemas/NamespaceFieldRequest"},"type":"array","maxItems":20,"minItems":1,"title":"Fields"},"search_limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Search Limit","default":3},"consolidation_threshold":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Consolidation Threshold"},"empty_message":{"type":"string","title":"Empty Message","default":"No relevant items found."},"search_tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Tool Name"},"search_tool_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search Tool Instructions"},"manage_tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manage Tool Name"},"manage_tool_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Manage Tool Instructions"}},"type":"object","required":["name","display_title","fields"],"title":"NamespaceRequest","description":"Request schema for a namespace definition."},"OAuthAuthorizeResponse":{"properties":{"authorize_url":{"type":"string","title":"Authorize Url"}},"type":"object","required":["authorize_url"],"title":"OAuthAuthorizeResponse","description":"Response with the OAuth authorize URL."},"OAuthCallbackRequest":{"properties":{"code":{"type":"string","minLength":1,"title":"Code"},"state":{"type":"string","minLength":1,"title":"State"}},"type":"object","required":["code","state"],"title":"OAuthCallbackRequest","description":"Request to exchange an OAuth code for profile linking."},"OAuthDiscoveryResponse":{"properties":{"issuer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issuer"},"authorization_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization Endpoint"},"token_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Endpoint"},"registration_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registration Endpoint"},"revocation_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revocation Endpoint"},"scopes_supported":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes Supported"},"grant_types_supported":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Grant Types Supported"},"persisted":{"type":"boolean","title":"Persisted","default":false},"discovery_status":{"type":"string","enum":["discovered","no_auth_required","no_oauth","unreachable"],"title":"Discovery Status","default":"no_oauth"},"discovery_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discovery Error"}},"type":"object","title":"OAuthDiscoveryResponse","description":"OAuth metadata discovery response.\n\nThe discovery_status field indicates the outcome of the discovery process:\n- \"discovered\": OAuth endpoints were found\n- \"no_auth_required\": Server returned 2xx without authentication (public access)\n- \"no_oauth\": Server requires auth but no OAuth endpoints found\n- \"unreachable\": Server did not respond (timeout, DNS failure, connection refused)"},"OAuthSetupResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"authorization_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization Endpoint"},"token_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token Endpoint"},"registration_endpoint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Registration Endpoint"},"scopes_supported":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes Supported"},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_registered":{"type":"boolean","title":"Client Registered","default":false},"dcr_attempted":{"type":"boolean","title":"Dcr Attempted","default":false},"dcr_succeeded":{"type":"boolean","title":"Dcr Succeeded","default":false},"dcr_error":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Dcr Error"},"alternatives":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Alternatives"},"authorization_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization Url"},"token_acquired":{"type":"boolean","title":"Token Acquired","default":false}},"type":"object","required":["success","message"],"title":"OAuthSetupResponse","description":"Response from one-click OAuth setup."},"OnAcceptAction":{"properties":{"action":{"type":"string","enum":["mint_task","channel_message","mcp_tool"],"title":"Action"},"note":{"type":"string","maxLength":300,"title":"Note","description":"Author note explaining the intent (audit display only). Action-policy matching: mcp_tool executions are intercepted under the real MCP tool name; mint_task and channel_message are intercepted as the builtin tool names 'dr_on_accept_mint_task' and 'dr_on_accept_channel_message', so policies can target them by tool_name.","default":""},"task_title":{"anyOf":[{"type":"string","maxLength":150},{"type":"null"}],"title":"Task Title","description":"Static title prefix for the minted follow-up task; the engine appends the candidate signature. Defaults to 'Follow up'."},"channel_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Id","description":"Connected channel plugin id (e.g. 'slack')."},"to":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"To","description":"Channel-native destination address for the message."},"message":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Message","description":"Static prose prepended to the engine-rendered acceptance line. Pure text; no template substitution."},"tool_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Tool Name","description":"Name of a connected MCP tool to invoke."},"tool_args":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Args","description":"Arguments for the MCP tool. Values exactly equal to $candidate_signature, $final_status, $rank_score, $confidence_delta, $rubric_id or $interest_query are replaced with the run's values; everything else is passed verbatim."},"version":{"type":"integer","title":"Version","default":1}},"additionalProperties":false,"type":"object","required":["action"],"title":"OnAcceptAction","description":"Customer-authored consequence of an auto-filed verdict.\n\nExecuted only when a run's ``auto`` gate verdict STANDS (decision\nautonomy earned, see ``agent/autonomy.py``), never for suggest or\nreview verdicts, and never while autonomy is unearned. One\nallowlisted action per rubric; every execution is routed through the\norg's action policies first, so a matching forbid / require_approval\n/ shadow policy suppresses it.\n\nWe deliberately do not interpret what an accepted candidate means:\nthe customer authors the consequence, the engine runs it."},"OntologyCategory":{"properties":{"label":{"type":"string","title":"Label","description":"Display spelling of the category"},"curated":{"type":"boolean","title":"Curated","description":"True when the label comes from the org's curated reference vocabulary; False for an emergent category the LLM minted outside it"},"adoption_count":{"type":"integer","title":"Adoption Count","description":"Live memories (superseded/absorbed excluded) whose _amem.category matches this label case-insensitively"}},"type":"object","required":["label","curated","adoption_count"],"title":"OntologyCategory","description":"One category in the vocabulary-adoption projection."},"OntologyOverviewResponse":{"properties":{"categories":{"items":{"$ref":"#/components/schemas/OntologyCategory"},"type":"array","title":"Categories"},"vocabulary_size":{"type":"integer","title":"Vocabulary Size","description":"Curated reference-vocabulary term count (0 = unseeded org)","default":0},"total_categorized":{"type":"integer","title":"Total Categorized","description":"Live memories carrying any non-empty category","default":0},"grounding":{"items":{"$ref":"#/components/schemas/GroundingEntry"},"type":"array","title":"Grounding","description":"Canonicals with the raw labels folded into them (ledger)"},"converged":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Converged","description":"True = a reconcile ledger exists and maps every label to itself (nothing is being folded — the grounding success state); False = the ledger folds labels; None = no reconcile has run yet"},"ledger_updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ledger Updated At","description":"ISO timestamp of the last reconcile ledger write, if any"},"trend":{"items":{"$ref":"#/components/schemas/TrendPoint"},"type":"array","title":"Trend","description":"Monthly per-category live-memory counts (sorted month, label)"},"connections":{"items":{"$ref":"#/components/schemas/CategoryConnection"},"type":"array","title":"Connections","description":"Cross-category edge aggregates (sorted by total desc)"},"link_provenance":{"additionalProperties":{"type":"integer"},"type":"object","title":"Link Provenance","description":"Audit at a glance: how many connections came from where, counted over deduped edges across ALL category pairs (not just cross-category ones). Keys are the provenance tiers (structural / inferred / confirmed / disputed); tiers with no edges are omitted. Answers 'how much of this graph has anyone actually checked'."},"truncated":{"type":"boolean","title":"Truncated","description":"True when the live-row sweep hit its page ceiling; every block (adoption counts included) is then computed from the same truncated population — consistently capped, never divergent across panels","default":false}},"type":"object","title":"OntologyOverviewResponse","description":"Vocabulary-adoption projection for the /brain/ontology panel.\n\nEmergent categories are the base layer — every org with memories has\nthem, so the panel is meaningful before a reference vocabulary is\nseeded. Curated terms overlay them, INCLUDING zero-adoption terms:\na curated term no memory carries is the \"dead vocabulary\" curation\nsignal and must stay visible.\n\n``grounding``/``converged`` project the dream reconcile ledger,\n``trend`` buckets live rows by creation month, and ``connections``\naggregates cross-category memory edges — every block folds labels with\nthe same rule as ``categories`` so the knowledge map, learning trend,\nand domain chord all agree on display names."},"Organization":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Organization name"},"slug":{"type":"string","maxLength":100,"minLength":1,"title":"Slug","description":"Organization slug (URL-friendly identifier)"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Organization description"},"max_members":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Members","description":"Maximum number of members allowed"},"id":{"type":"string","title":"Id","description":"Organization ID"},"created_by":{"type":"string","title":"Created By","description":"User ID of organization creator (UUID)"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether organization is active"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["name","slug","id","created_by","is_active","created_at","updated_at"],"title":"Organization","description":"Complete organization schema with all fields."},"OrganizationCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Organization name"},"slug":{"type":"string","maxLength":100,"minLength":1,"title":"Slug","description":"Organization slug (URL-friendly identifier)"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Organization description"},"max_members":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Members","description":"Maximum number of members allowed"}},"type":"object","required":["name","slug"],"title":"OrganizationCreate","description":"Schema for creating a new organization."},"OrganizationCreateRequest":{"properties":{"external_id":{"type":"string","title":"External Id","description":"External user ID (Auth0)"},"owner_email":{"type":"string","title":"Owner Email","description":"Owner's email address"},"owner_name":{"type":"string","title":"Owner Name","description":"Owner's full name"}},"type":"object","required":["external_id","owner_email","owner_name"],"title":"OrganizationCreateRequest","description":"Request schema for Landing Page organization creation."},"OrganizationCreateResponse":{"properties":{"organization_id":{"type":"string","title":"Organization Id","description":"Generated UUID"},"organization_name":{"type":"string","title":"Organization Name","description":"Organization name"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"}},"type":"object","required":["organization_id","organization_name","created_at"],"title":"OrganizationCreateResponse","description":"Response for Landing Page organization creation."},"OrganizationMemberAdd":{"properties":{"role":{"type":"string","title":"Role","description":"Member role: owner, admin, or member","default":"member"},"user_id":{"type":"string","title":"User Id","description":"User ID to add to organization (UUID)"}},"type":"object","required":["user_id"],"title":"OrganizationMemberAdd","description":"Schema for adding a member to an organization."},"OrganizationMemberResponse":{"properties":{"user_id":{"type":"string","title":"User Id","description":"User ID (UUID)"},"organization_id":{"type":"string","title":"Organization Id","description":"Organization ID"},"role":{"type":"string","title":"Role","description":"Member role"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username","description":"Username"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Membership creation timestamp"}},"type":"object","required":["user_id","organization_id","role","created_at"],"title":"OrganizationMemberResponse","description":"Response schema for organization member operations."},"OrganizationUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name","description":"Updated organization name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Updated organization description"},"max_members":{"anyOf":[{"type":"integer","exclusiveMinimum":0.0},{"type":"null"}],"title":"Max Members","description":"Updated maximum member limit"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Organization active status"}},"type":"object","title":"OrganizationUpdate","description":"Schema for updating organization details."},"OriginalTransactionSummary":{"properties":{"id":{"type":"string","title":"Id"},"amount":{"type":"integer","title":"Amount"},"reason":{"type":"string","title":"Reason"},"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"refunded_at":{"type":"string","format":"date-time","title":"Refunded At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","amount","reason","thread_id","run_id","refunded_at","created_at"],"title":"OriginalTransactionSummary","description":"Summary of the original transaction that was refunded."},"Output":{"properties":{"description":{"type":"string","title":"Description","default":""},"preamble":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preamble","description":"Optional decorative markdown rendered above the canonical verdict block.  Pure markdown — no template substitution. If you need a candidate-context field surfaced, configure ``candidate_context_labels`` below; the engine renders the canonical fields list."},"epilogue":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Epilogue","description":"Optional decorative markdown rendered below the canonical verdict block (e.g., outreach guidance, analyst notes). Pure markdown — no template substitution."},"candidate_context_labels":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Candidate Context Labels","description":"Pretty-print labels for keys in candidate_context.  The engine renders a '## Candidate Context' markdown list containing ONLY the keys declared here, with these labels: undeclared keys never surface, and a declared key absent from candidate_context is silently omitted (no auto-formatting fallback in this section).  Labels are also reused to name missing ``evidence_requirements`` keys in the ``incomplete`` diagnostic, where an unlabeled key falls back to Title Case.  Set to ``null`` or leave empty (the default) to suppress the candidate-context section entirely."},"evidence_requirements":{"items":{"type":"string"},"type":"array","title":"Evidence Requirements","description":"Snake_case keys that MUST be present in the caller-provided ``candidate_context`` dict before drafting (e.g. ['verified_quote_url']). These are CALLER-PROVIDED INPUT KEYS, not engine outputs: the engine does not synthesize them, so listing a key the caller never supplies makes every run terminate ``incomplete``, with the missing keys named in the diagnostic. NOTE: this differs from ``Pattern.evidence_requirements``, which uses plain prose describing evidence concepts; here keys are matched literally against ``candidate_context``."},"max_length_tokens":{"type":"integer","title":"Max Length Tokens","description":"Soft length budget for the rendered artifact","default":500},"on_accept":{"anyOf":[{"$ref":"#/components/schemas/OnAcceptAction"},{"type":"null"}],"description":"Optional consequence executed when a run's auto gate verdict stands (decision autonomy earned). See ``OnAcceptAction``; routed through the org's action policies before executing."},"version":{"type":"integer","title":"Version","default":2}},"additionalProperties":false,"type":"object","title":"Output","description":"Phase-3 (drafting) configuration for a Rubric.\n\nThe verdict artifact is rendered by the engine from a fixed\ncanonical structure populated by engine state and candidate_context.\nRubric authors no longer control the artifact's literal markup —\nonly its labels and optional decorative prose.  This eliminates\nthe class of bugs where author template-syntax errors bled through\nto customer-visible verdicts (e.g., the production\n``{(buyer_tier)}`` placeholder leak from 2026-05-04).\n\nSchema break vs. v1: ``template: str`` is removed and replaced by\n``preamble`` / ``epilogue`` (raw markdown, no substitution) plus\n``candidate_context_labels`` (label dict driving the engine's\ncanonical fields list).  The route layer rejects bodies carrying\nthe legacy ``template`` field with a 422 + migration message."},"OverageUsageResponse":{"properties":{"billing_model":{"type":"string","title":"Billing Model","description":"Billing model: 'prepaid' (Starter/Pro) or 'postpaid' (Enterprise)","default":"prepaid"},"period_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Period Start","description":"Current billing period start"},"period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Period End","description":"Current billing period end"},"included_credits_granted":{"type":"integer","title":"Included Credits Granted","description":"Included credits for this period"},"included_credits_remaining":{"type":"integer","title":"Included Credits Remaining","description":"Remaining included credits"},"included_credits_used":{"type":"integer","title":"Included Credits Used","description":"Included credits consumed"},"prepaid_credits_available":{"type":"integer","title":"Prepaid Credits Available","description":"Prepaid credits purchased (never expire)","default":0},"overage_credits_used":{"type":"integer","title":"Overage Credits Used","description":"Overage credits consumed (postpaid)"},"overage_spend_cents":{"type":"integer","title":"Overage Spend Cents","description":"Overage spend in cents (postpaid)"},"overage_spend_dollars":{"type":"number","title":"Overage Spend Dollars","description":"Overage spend in dollars (postpaid)"},"extra_usage_enabled":{"type":"boolean","title":"Extra Usage Enabled","description":"Whether postpaid overage is enabled (Enterprise only)"},"extra_usage_cap_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Extra Usage Cap Cents","description":"Overage cap in cents (postpaid)"},"at_cap":{"type":"boolean","title":"At Cap","description":"Whether user has hit their overage cap (postpaid)"},"price_per_credit_cents":{"type":"integer","title":"Price Per Credit Cents","description":"Price per credit in cents"}},"type":"object","required":["included_credits_granted","included_credits_remaining","included_credits_used","overage_credits_used","overage_spend_cents","overage_spend_dollars","extra_usage_enabled","at_cap","price_per_credit_cents"],"title":"OverageUsageResponse","description":"Response schema for usage summary (includes both prepaid and postpaid)."},"PairRequest":{"properties":{"other_id":{"type":"string","minLength":1,"title":"Other Id"}},"type":"object","required":["other_id"],"title":"PairRequest","description":"Body for merge/split: the other entity of the pair."},"PasswordUpdate":{"properties":{"old_password":{"type":"string","title":"Old Password","description":"Current password"},"new_password":{"type":"string","minLength":8,"title":"New Password","description":"New password (minimum 8 characters)"}},"type":"object","required":["old_password","new_password"],"title":"PasswordUpdate","description":"Schema for changing user password."},"Pattern":{"properties":{"name":{"type":"string","title":"Name","description":"Stable identifier (e.g. 'wrong_buyer_power')"},"description":{"type":"string","title":"Description","description":"One-sentence summary suitable for explanations"},"defeat_type":{"$ref":"#/components/schemas/DefeatType","description":"REBUT (attacks conclusion) or UNDERCUT (attacks inference)"},"detection_prompt":{"type":"string","title":"Detection Prompt","description":"LLM prompt template. Receives the candidate context as input; must return a structured judgement of whether the pattern fires and the supporting evidence."},"evidence_requirements":{"items":{"type":"string"},"type":"array","title":"Evidence Requirements","description":"Plain-prose descriptions of the evidence CONCEPTS this pattern needs to fire (e.g. [\"the candidate's company headcount\"]). Tool-agnostic — describe what the rule needs in the customer's vocabulary, not vendor field paths. NOTE: this differs from ``Output.evidence_requirements``, which uses snake_case keys matched literally against the caller-provided ``candidate_context``."},"priority":{"type":"integer","title":"Priority","description":"Authoring/precedence HINT only. The NDE evaluates every fired defeater uniformly (no priority sort / no short-circuit), so this does NOT control adjudication order or outcome; it documents intended cheap-fail ordering and is used by rubric-induction to clamp induced patterns below the curated floor.","default":100}},"additionalProperties":false,"type":"object","required":["name","description","defeat_type","detection_prompt"],"title":"Pattern","description":"One defeater pattern in a Disqualifiers sub-pack.\n\nA pattern says: \"given a candidate, here is a question to ask; if the\nanswer is yes, this candidate is defeated by this pattern.\""},"PendingAlias":{"properties":{"key":{"type":"string","title":"Key"},"surface_form":{"type":"string","title":"Surface Form","default":""},"candidates":{"items":{"type":"string"},"type":"array","title":"Candidates"},"candidate_names":{"items":{"type":"string"},"type":"array","title":"Candidate Names"},"provenance_count":{"type":"integer","title":"Provenance Count","default":0}},"type":"object","required":["key"],"title":"PendingAlias","description":"A graylisted alias awaiting confirmation."},"PendingIdentityResponse":{"properties":{"channel_id":{"type":"string","title":"Channel Id"},"sender_id":{"type":"string","title":"Sender Id"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"},"sender_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Email"},"first_seen":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Seen"},"last_seen":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Seen"},"message_count":{"type":"integer","title":"Message Count","default":0}},"type":"object","required":["channel_id","sender_id"],"title":"PendingIdentityResponse","description":"Response schema for an unlinked channel sender."},"PendingLinkRequest":{"properties":{"user_id":{"type":"string","maxLength":36,"minLength":1,"title":"User Id"}},"type":"object","required":["user_id"],"title":"PendingLinkRequest","description":"Request to link a pending sender to a user."},"PlanResponse":{"properties":{"id":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Plan identifier"},"name":{"type":"string","title":"Name","description":"Plan display name"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price","description":"Monthly price in USD (null for Enterprise)"},"currency":{"type":"string","title":"Currency","description":"Currency code","default":"usd"},"interval":{"type":"string","title":"Interval","description":"Billing interval","default":"month"},"credits_per_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credits Per Month","description":"Monthly credit allocation (null for Enterprise)"},"features":{"items":{"type":"string"},"type":"array","title":"Features","description":"List of plan features"},"description":{"type":"string","title":"Description","description":"Plan description"},"available_for_checkout":{"type":"boolean","title":"Available For Checkout","description":"Whether plan can be purchased via Stripe Checkout"}},"type":"object","required":["id","name","description","available_for_checkout"],"title":"PlanResponse","description":"Plan details response schema."},"PolicyMatch":{"properties":{"kind":{"anyOf":[{"type":"string","enum":["shell","mcp","builtin"]},{"type":"null"}],"title":"Kind"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"command_class":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Command Class"},"risk_tier":{"anyOf":[{"type":"string","enum":["read_only","reversible","disruptive"]},{"type":"null"}],"title":"Risk Tier"},"command_regex":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Command Regex"},"namespace":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Namespace"},"project":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Project"}},"type":"object","title":"PolicyMatch","description":"Conjunctive matcher; unset fields match everything.\n\n``namespace`` / ``project`` are RESOURCE SCOPE matchers (glob\nsyntax, e.g. ``prod-*``): they match against coordinates the\nclassifier derives from the command itself (kubectl ``-n``,\ngcloud ``--project``) — policy authors write globs, never parse\ncommands. A scoped policy does NOT match an action whose\ncoordinate could not be derived (same fail-closed rule as\n``command_regex`` against a command-less action). MCP tools carry\nno resource scope by design (no uniform argument convention);\ncluster scope is deferred until the executor plumbs the kubeconfig\ncontext through the seam."},"PortalSessionRequest":{"properties":{"return_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Return Url","description":"URL to redirect user after portal session"}},"type":"object","required":["return_url"],"title":"PortalSessionRequest","description":"Request schema for creating a billing portal session."},"PortalSessionResponse":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url","description":"Stripe Billing Portal URL"}},"type":"object","required":["url"],"title":"PortalSessionResponse","description":"Response schema for billing portal session."},"PredicateAliasIn":{"properties":{"variant":{"type":"string","maxLength":200,"minLength":1,"title":"Variant"},"canonical":{"type":"string","maxLength":200,"minLength":1,"title":"Canonical"}},"type":"object","required":["variant","canonical"],"title":"PredicateAliasIn","description":"Admin request to map a variant predicate to a canonical one."},"PredicateProposalRef":{"properties":{"predicate_a":{"type":"string","maxLength":200,"minLength":1,"title":"Predicate A"},"predicate_b":{"type":"string","maxLength":200,"minLength":1,"title":"Predicate B"}},"type":"object","required":["predicate_a","predicate_b"],"title":"PredicateProposalRef","description":"Reference to one reconcile proposal (the pair, order-insensitive)."},"ProfileCreateRequest":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z0-9][a-z0-9_-]*$","title":"Name"},"description":{"type":"string","title":"Description","default":""},"base_domain":{"type":"string","title":"Base Domain","default":"HD"},"executor_type":{"type":"string","title":"Executor Type","default":"reflective_shell"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"memory_section_titles":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Memory Section Titles"},"resolved_examples":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Examples"},"resolved_evidence_keywords":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Evidence Keywords"},"event_context_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Context Template"},"omit_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Criteria"},"omit_event_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Event Description"},"omit_event_reason_example":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Event Reason Example"},"executor_system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor System Prompt"},"executor_identity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Identity"},"executor_cloud_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Cloud Context"},"executor_web_search_guidance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Web Search Guidance"},"executor_workflows":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Workflows"},"executor_session_mode_header_investigation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Mode Header Investigation"},"executor_session_mode_header_remediation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Mode Header Remediation"},"executor_session_constraints":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Constraints"},"executor_report_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Report Format"},"executor_task_completion_investigation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Task Completion Investigation"},"executor_task_completion_remediation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Task Completion Remediation"},"executor_base_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Executor Base Tools"},"extraction_schemas":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extraction Schemas"},"extraction_instructions":{"anyOf":[{"type":"string","maxLength":8000,"minLength":1},{"type":"null"}],"title":"Extraction Instructions"},"chat_extraction_instructions":{"anyOf":[{"type":"string","maxLength":8000,"minLength":1},{"type":"null"}],"title":"Chat Extraction Instructions"},"empty_message_overrides":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Empty Message Overrides"}},"type":"object","required":["name"],"title":"ProfileCreateRequest","description":"Request schema for creating a custom investigation profile.\n\nAll prompt fields default to ``None`` = \"inherit the built-in default at\nruntime\".  This ensures that if the platform-level defaults evolve later,\nexisting profiles automatically pick up the new values instead of carrying\nstale frozen copies in the database.\n\nThe frontend can pre-fill creation forms by reading the current defaults\nfrom ``GET /profiles/defaults`` or from the built-in SRE profile response."},"ProfileDefaultsResponse":{"properties":{"system_prompt":{"type":"string","title":"System Prompt"},"resolved_examples":{"type":"string","title":"Resolved Examples"},"resolved_evidence_keywords":{"type":"string","title":"Resolved Evidence Keywords"},"event_context_template":{"type":"string","title":"Event Context Template"},"omit_criteria":{"type":"string","title":"Omit Criteria"},"omit_event_description":{"type":"string","title":"Omit Event Description"},"omit_event_reason_example":{"type":"string","title":"Omit Event Reason Example"}},"type":"object","required":["system_prompt","resolved_examples","resolved_evidence_keywords","event_context_template","omit_criteria","omit_event_description","omit_event_reason_example"],"title":"ProfileDefaultsResponse","description":"Current platform defaults for orchestrator and executor prompt fields.\n\nThe frontend uses this to pre-fill the profile creation form.  Values are\nresolved at request time so they always reflect the latest platform defaults."},"ProfileMetricRecord":{"properties":{"thread_id":{"type":"string","title":"Thread Id","description":"Thread ID (inv_ prefix for HD, dr_ prefix for DR — both stripped)"},"profile_name":{"type":"string","title":"Profile Name"},"graph_id":{"type":"string","title":"Graph Id","description":"Methodology discriminator. ``HDRAgent`` = Hypothetico-Deductive (HD) investigation, ``DefeasibleReasoningAgent`` = Defeasible Reasoning (DR) candidate evaluation. Defaults to HDRAgent for legacy records that predate the field.","default":"HDRAgent"},"timestamp":{"type":"string","title":"Timestamp","description":"ISO datetime"},"outcome":{"type":"string","title":"Outcome","description":"Cross-methodology aggregation key. HD: ``resolved | proposed | omitted | failed | skipped``. DR: ``resolved`` (warranted) | ``rejected`` (defeated) | ``skipped``. ``rejected`` is DR-specific and intentionally distinct from HD's ``omitted`` (which means 'alert was a false positive worth filtering' — opposite operational meaning from DR's 'candidate disqualified by a defeater')."},"iterations":{"type":"integer","title":"Iterations"},"alert_type":{"type":"string","title":"Alert Type","description":"HD: event title; DR: candidate_signature"},"provider":{"type":"string","title":"Provider","description":"HD: source name (datadog/gcp/...); DR: 'dr'"},"confidence":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Confidence","description":"HD only — LLM judge's self-rated confidence (0-100). None on DR."},"evidence_quality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Evidence Quality","description":"HD only — DEFINITIVE | STRONG | PARTIAL | WEAK. None on DR."},"escalated":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Escalated","description":"HD only — whether the run was escalated. None on DR."},"human_verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Human Verdict","description":"HD only — accepted | edited | ignored | auto_accepted. None until the notify gate resolves (or on DR/legacy records)."},"verdict_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verdict At","description":"ISO datetime the verdict was recorded. None until resolved."},"auto_approved":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Approved","description":"True when the autonomy gate auto-accepted without a human. Auto-approved records never count toward earned capability."},"autonomy_effective_level":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Autonomy Effective Level","description":"Effective autonomy level (0-100) at auto-approval time."},"remediation_outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remediation Outcome","description":"completed | failed — final remediation attempt status."},"diagnosis":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Diagnosis","description":"True for platform-internal diagnosis runs. These bypass the HITL gate, so they are excluded from capability volume counts."},"final_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Status","description":"warranted | defeated | skipped (DR only)"},"rank_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rank Score","description":"QBAF strength in [0, 1] — None for disqualified or HD records"},"confidence_delta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence Delta","description":"Dual-BAG |t_base − t_estimated| disagreement signal (DR only)"},"defeaters_fired_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Defeaters Fired Count","description":"Count of defeater patterns that fired with valid provenance"},"defeaters_rejected_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Defeaters Rejected Count","description":"Count of defeater proposals dropped by the provenance gate"},"verifications_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Verifications Count","description":"Count of source URLs verified during the DR run"},"verification_degraded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Verification Degraded","description":"True when UNDERCUT verification could not run (no MCP tools)"},"candidate_signature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Candidate Signature","description":"Compact identity summary (DR only)"},"rubric_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rubric Id","description":"Rubric used for the DR run"}},"type":"object","required":["thread_id","profile_name","timestamp","outcome","iterations","alert_type","provider"],"title":"ProfileMetricRecord","description":"A single per-run metric record (HD or DR).\n\nThe schema is **discriminated by ``graph_id``**. HD records leave\nthe DR-specific fields ``None``; DR records populate them and also\nmap their verdict into the HD-shaped legacy fields (``outcome``,\n``confidence``, ``iterations``, etc.) so dashboards that aggregate\nover the legacy fields still render mixed-methodology results.\n\nLegacy records persisted before the discriminator landed default\n``graph_id`` to ``\"HDRAgent\"`` — they predate DR entirely."},"ProfileMetricsResponse":{"properties":{"records":{"items":{"$ref":"#/components/schemas/ProfileMetricRecord"},"type":"array","title":"Records"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["records","total"],"title":"ProfileMetricsResponse","description":"Response for profile metrics endpoint."},"ProfilePinRecommendation":{"properties":{"provider":{"type":"string","title":"Provider"},"current_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Profile"},"recommended_profile":{"type":"string","title":"Recommended Profile"},"escalation_count":{"type":"integer","title":"Escalation Count"},"confidence":{"type":"string","title":"Confidence"}},"type":"object","required":["provider","current_profile","recommended_profile","escalation_count","confidence"],"title":"ProfilePinRecommendation","description":"Advisory recommendation to pin a webhook source to a profile."},"ProfileResponse":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"base_domain":{"type":"string","title":"Base Domain"},"executor_type":{"type":"string","title":"Executor Type"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"executor_system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor System Prompt"},"memory_section_titles":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Memory Section Titles"},"resolved_examples":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Examples"},"executor_identity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Identity"},"executor_cloud_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Cloud Context"},"executor_web_search_guidance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Web Search Guidance"},"executor_workflows":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Workflows"},"executor_session_mode_header_investigation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Mode Header Investigation"},"executor_session_mode_header_remediation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Mode Header Remediation"},"executor_session_constraints":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Constraints"},"executor_report_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Report Format"},"executor_task_completion_investigation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Task Completion Investigation"},"executor_task_completion_remediation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Task Completion Remediation"},"executor_base_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Executor Base Tools"},"resolved_evidence_keywords":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Evidence Keywords"},"event_context_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Context Template"},"omit_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Criteria"},"omit_event_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Event Description"},"omit_event_reason_example":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Event Reason Example"},"extraction_schemas":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extraction Schemas"},"extraction_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extraction Instructions"},"chat_extraction_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Chat Extraction Instructions"},"empty_message_overrides":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Empty Message Overrides"},"effective_extraction_schemas":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Effective Extraction Schemas"},"effective_extraction_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective Extraction Instructions"},"effective_chat_extraction_instructions":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective Chat Extraction Instructions"},"is_builtin":{"type":"boolean","title":"Is Builtin"},"field_conflicts":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Field Conflicts"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["name","description","base_domain","executor_type","system_prompt","executor_system_prompt","memory_section_titles","resolved_examples","resolved_evidence_keywords","is_builtin"],"title":"ProfileResponse","description":"Response schema for an investigation profile."},"ProfileUpdateRequest":{"properties":{"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"base_domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Base Domain"},"executor_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Type"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"executor_system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor System Prompt"},"memory_section_titles":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Memory Section Titles"},"resolved_examples":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Examples"},"executor_identity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Identity"},"executor_cloud_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Cloud Context"},"executor_web_search_guidance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Web Search Guidance"},"executor_workflows":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Workflows"},"executor_session_mode_header_investigation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Mode Header Investigation"},"executor_session_mode_header_remediation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Mode Header Remediation"},"executor_session_constraints":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Session Constraints"},"executor_report_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Report Format"},"executor_task_completion_investigation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Task Completion Investigation"},"executor_task_completion_remediation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Executor Task Completion Remediation"},"executor_base_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Executor Base Tools"},"resolved_evidence_keywords":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved Evidence Keywords"},"event_context_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Context Template"},"omit_criteria":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Criteria"},"omit_event_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Event Description"},"omit_event_reason_example":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Omit Event Reason Example"},"extraction_schemas":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Extraction Schemas"},"extraction_instructions":{"anyOf":[{"type":"string","maxLength":8000,"minLength":1},{"type":"null"}],"title":"Extraction Instructions"},"chat_extraction_instructions":{"anyOf":[{"type":"string","maxLength":8000,"minLength":1},{"type":"null"}],"title":"Chat Extraction Instructions"},"empty_message_overrides":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Empty Message Overrides"}},"type":"object","title":"ProfileUpdateRequest","description":"Request schema for updating a custom investigation profile (partial)."},"ProvisionedBy":{"type":"string","enum":["agent","manual"],"title":"ProvisionedBy","description":"Who created the BYO setup.\n\n``agent`` records that the ``MemoryDbOnboarding`` profile drove\nthe instance creation; ``manual`` records that an admin pointed\nus at an existing instance via the UI / REST. The distinction\nmatters for migration tooling — ``agent``-provisioned instances\nare guaranteed to have the schema set up by us, so migration\ncan skip the schema-check and head straight to the row copy."},"RankingFactor":{"properties":{"name":{"type":"string","title":"Name","description":"Stable identifier (e.g. 'public_engagement')"},"description":{"type":"string","title":"Description","description":"What this factor measures"},"weight":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Weight","description":"Contribution weight for this factor's edge in the QBAF aggregation. Rollout-staged: every ranked run records the edge-weighted rank on its audit trail (``rank_score_weighted``); the live ``rank_score`` switches to it when the rollout completes."},"polarity":{"$ref":"#/components/schemas/FactorPolarity","description":"SUPPORT raises the candidate's strength; ATTACK lowers it"},"base_score_prompt":{"type":"string","title":"Base Score Prompt","description":"LLM prompt template. Receives the candidate context; must return a numeric base score in [0, 1]."}},"additionalProperties":false,"type":"object","required":["name","description","weight","polarity","base_score_prompt"],"title":"RankingFactor","description":"One factor contributing to a candidate's QBAF strength."},"RefundCreateRequest":{"properties":{"run_id":{"type":"string","title":"Run Id","description":"LangGraph run ID to refund"},"reason":{"type":"string","maxLength":500,"minLength":1,"title":"Reason","description":"Reason for refund"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Additional context"}},"type":"object","required":["run_id","reason"],"title":"RefundCreateRequest","description":"Request to create a refund for a run."},"RefundCreateResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"refunds_created":{"type":"integer","title":"Refunds Created"},"total_credits_refunded":{"type":"integer","title":"Total Credits Refunded"},"refund_pairs":{"items":{"$ref":"#/components/schemas/RefundPairResponse"},"type":"array","title":"Refund Pairs"}},"type":"object","required":["run_id","refunds_created","total_credits_refunded","refund_pairs"],"title":"RefundCreateResponse","description":"Response after creating refunds."},"RefundListResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"refunds":{"items":{"$ref":"#/components/schemas/RefundTransactionResponse"},"type":"array","title":"Refunds"},"total_refunded":{"type":"integer","title":"Total Refunded"}},"type":"object","required":["run_id","refunds","total_refunded"],"title":"RefundListResponse","description":"List of refunds for a run."},"RefundPairResponse":{"properties":{"original_transaction":{"$ref":"#/components/schemas/OriginalTransactionSummary"},"refund_transaction":{"$ref":"#/components/schemas/RefundTransactionResponse"},"credits_refunded":{"type":"integer","title":"Credits Refunded"}},"type":"object","required":["original_transaction","refund_transaction","credits_refunded"],"title":"RefundPairResponse","description":"Response showing original transaction and its refund."},"RefundTransactionResponse":{"properties":{"id":{"type":"string","title":"Id"},"user_id":{"type":"string","title":"User Id"},"allocation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Allocation Id"},"amount":{"type":"integer","title":"Amount"},"reason":{"type":"string","title":"Reason"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"related_transaction_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Related Transaction Id"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","user_id","allocation_id","amount","reason","run_id","related_transaction_id","metadata","created_at"],"title":"RefundTransactionResponse","description":"Individual refund transaction details."},"RejectRequest":{"properties":{"candidate_id":{"type":"string","minLength":1,"title":"Candidate Id"}},"type":"object","required":["candidate_id"],"title":"RejectRequest","description":"Body for alias rejection: which candidate the name does NOT mean."},"ResubscribeRequest":{"properties":{"plan_id":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Plan to subscribe to (defaults to starter)","default":"starter"}},"type":"object","title":"ResubscribeRequest","description":"Request schema for resubscribing after a cancelled/expired subscription."},"ResubscribeResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url","description":"Stripe Checkout URL to redirect to"}},"type":"object","required":["checkout_url"],"title":"ResubscribeResponse","description":"Response schema for resubscription — returns checkout URL for redirect."},"Rubric":{"properties":{"type":{"type":"string","const":"rubric","title":"Type","description":"Decorative type tag (kept for back-compat; the namespace is the canonical discriminator). Marks the record as a config-shaped rubric distinct from memory patterns.","default":"rubric"},"rubric_id":{"type":"string","title":"Rubric Id","description":"Stable identifier (e.g. 'prospect')"},"description":{"type":"string","title":"Description","default":""},"disqualifiers":{"$ref":"#/components/schemas/Disqualifiers"},"scoring":{"$ref":"#/components/schemas/Scoring"},"output":{"$ref":"#/components/schemas/Output"},"version":{"type":"integer","title":"Version","default":1}},"additionalProperties":false,"type":"object","required":["rubric_id","disqualifiers","scoring","output"],"title":"Rubric","description":"Wraps the three sub-packs (Disqualifiers, Scoring, Output) for one DR profile.\n\nLives in the dedicated ``(\"config\", \"rubrics\", org_id)`` config\nnamespace keyed by plain ``rubric_id``. Profile builders pre-seed\na starter rubric on first activation; orgs are then free to fork\nand edit through the rubric REST API. Was ``DRPackBundle`` in\nearlier scaffolding.\n\n``extra=\"forbid\"`` — see ``_STRICT_MODEL_CONFIG`` at the top of\nthis module. The on-disk row carries audit fields\n(``created_at`` / ``updated_at`` / ``updated_by``) that ARE\nextras to this model; ``RubricStore.PersistedRubric.from_store_value``\npops them BEFORE validating so this model stays strict for\nuser-authored bodies without breaking storage round-trips.\n\nThe ``type: \"rubric\"`` discriminator is now decorative — the\nnamespace alone identifies the record class. Kept for back-compat\nwith rows written before the namespace move; can be removed in a\nfuture cleanup pass."},"RubricScenario":{"properties":{"id":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9_.-]+$","title":"Id"},"description":{"type":"string","title":"Description","default":""},"candidate_context":{"additionalProperties":true,"type":"object","title":"Candidate Context","description":"The candidate fields the rubric evaluates, exactly as the DR graph's candidate_context input."},"expect_final_status":{"anyOf":[{"type":"string","enum":["warranted","defeated","skipped","incomplete"]},{"type":"null"}],"title":"Expect Final Status"},"expect_gate_verdict":{"anyOf":[{"type":"string","enum":["auto","suggest","review"]},{"type":"null"}],"title":"Expect Gate Verdict"},"expect_defeaters_fired":{"items":{"type":"string"},"type":"array","title":"Expect Defeaters Fired"},"expect_defeaters_not_fired":{"items":{"type":"string"},"type":"array","title":"Expect Defeaters Not Fired"},"artifact_checks":{"items":{"$ref":"#/components/schemas/ArtifactCheck"},"type":"array","title":"Artifact Checks"}},"type":"object","required":["id","candidate_context"],"title":"RubricScenario","description":"One candidate to run through the rubric, plus its expectations."},"RunResponse":{"properties":{"technique":{"type":"string","title":"Technique"},"total_questions":{"type":"integer","title":"Total Questions"},"total_turns_seeded":{"type":"integer","title":"Total Turns Seeded"},"total_duration_s":{"type":"number","title":"Total Duration S"},"results":{"additionalProperties":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"type":"object","title":"Results","description":"Mem0-compatible results: {conv_index: [qa_dicts]}"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors"}},"type":"object","required":["technique","total_questions","total_turns_seeded","total_duration_s","results","errors"],"title":"RunResponse","description":"Response from the run phase."},"ScoreResponse":{"properties":{"overall_bleu":{"type":"number","title":"Overall Bleu"},"overall_f1":{"type":"number","title":"Overall F1"},"overall_llm":{"type":"number","title":"Overall Llm"},"total_questions":{"type":"integer","title":"Total Questions"},"category_summaries":{"items":{"$ref":"#/components/schemas/CategorySummaryResponse"},"type":"array","title":"Category Summaries"},"scored":{"additionalProperties":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"type":"object","title":"Scored","description":"Scored results: {conv_index: [{...bleu_score, f1_score, llm_score}]}"}},"type":"object","required":["overall_bleu","overall_f1","overall_llm","total_questions","category_summaries","scored"],"title":"ScoreResponse","description":"Response from the score phase."},"Scoring":{"properties":{"description":{"type":"string","title":"Description","default":""},"factors":{"items":{"$ref":"#/components/schemas/RankingFactor"},"type":"array","title":"Factors","description":"QBAF factors; weights need not sum to 1"},"semantics":{"type":"string","enum":["dfquad","qe","eb"],"title":"Semantics","description":"Gradual semantics for QBAF aggregation. dfquad = Sum/Product+Linear; qe = Sum+QuadraticMaximum; eb = Sum+EulerBased.","default":"dfquad"},"aggregator":{"type":"string","enum":["sum","product"],"title":"Aggregator","description":"Aggregation function; product is DfQUaD-equivalent","default":"product"},"use_dual_bag":{"type":"boolean","title":"Use Dual Bag","description":"If True, compute strength under both root prior 0.5 and LLM-estimated prior. Delta is a confidence signal — large deltas indicate cases that need human review.","default":true},"version":{"type":"integer","title":"Version","default":1}},"additionalProperties":false,"type":"object","title":"Scoring","description":"Phase-2 (ranking) configuration for a Rubric.\n\nWas ``RankingPack`` in earlier scaffolding."},"SecretCreate":{"properties":{"value":{"type":"string","title":"Value"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"type":"object","required":["value"],"title":"SecretCreate","description":"Request body for creating/updating a secret."},"SecretListResponse":{"properties":{"secrets":{"items":{"$ref":"#/components/schemas/SecretResponse"},"type":"array","title":"Secrets"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["secrets","total"],"title":"SecretListResponse","description":"Response for listing secrets."},"SecretResponse":{"properties":{"key":{"type":"string","title":"Key"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["key","description","created_at","updated_at"],"title":"SecretResponse","description":"Response for a single secret (value hidden)."},"SeedProposalEdit":{"properties":{"index":{"type":"integer","minimum":0.0,"title":"Index"},"kind":{"anyOf":[{"type":"string","enum":["episodes","knowledge"]},{"type":"null"}],"title":"Kind"},"event_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Time"},"clear_event_time":{"type":"boolean","title":"Clear Event Time","default":false}},"type":"object","required":["index"],"title":"SeedProposalEdit","description":"One constrained edit to a proposed row at commit time.\n\nOnly kind flips and date corrections are allowed — content is\nimmutable between preview and commit by design."},"SeedRow":{"properties":{"content":{"type":"string","maxLength":20000,"minLength":1,"title":"Content"},"namespace":{"type":"string","enum":["episodes","knowledge"],"title":"Namespace","default":"knowledge"},"event_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Time","description":"ISO-8601 time the underlying event occurred (not now)."},"idempotency_key":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Idempotency Key"}},"type":"object","required":["content"],"title":"SeedRow","description":"One row to import."},"SelfLinkRequest":{"properties":{"channel_id":{"type":"string","maxLength":64,"minLength":1,"title":"Channel Id"},"sender_id":{"type":"string","maxLength":255,"minLength":1,"title":"Sender Id"}},"type":"object","required":["channel_id","sender_id"],"title":"SelfLinkRequest","description":"Request for a user to link their own channel identity."},"ServerListResponse":{"properties":{"mcpServers":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Mcpservers"},"display":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Display","default":{}},"total":{"type":"integer","title":"Total"},"enabled_count":{"type":"integer","title":"Enabled Count"},"disabled_count":{"type":"integer","title":"Disabled Count"}},"type":"object","required":["mcpServers","total","enabled_count","disabled_count"],"title":"ServerListResponse","description":"Response for server list endpoint."},"ServiceCreationResult":{"properties":{"service_name":{"type":"string","title":"Service Name"},"status":{"type":"string","title":"Status","description":"success or skipped"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["service_name","status"],"title":"ServiceCreationResult","description":"Result for a single service creation within a batch."},"ServiceDiscoveryResult":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether discovery completed successfully"},"project_id":{"type":"string","title":"Project Id","description":"GCP project ID"},"services":{"items":{"$ref":"#/components/schemas/DiscoveredServiceInfo"},"type":"array","title":"Services","description":"Discovered services (empty on failure)","default":[]},"total_count":{"type":"integer","title":"Total Count","description":"Total services discovered"},"errors":{"items":{"type":"string"},"type":"array","title":"Errors","description":"Hard errors","default":[]},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings","description":"Soft warnings","default":[]},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code","description":"Machine-readable error code"},"error_details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Error Details","description":"Additional error context"},"suggested_actions":{"items":{"type":"string"},"type":"array","title":"Suggested Actions","description":"Actionable steps to resolve errors","default":[]},"auto_enabled_apis":{"items":{"type":"string"},"type":"array","title":"Auto Enabled Apis","description":"Prerequisite control-plane APIs PlatformPilot auto-enabled on the project during discovery (enabled or still propagating). Surfaced so the UI can confirm what was done on the customer's behalf.","default":[]},"platform_sa_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform Sa Email","description":"Platform service account identity PlatformPilot authenticates as. Surfaced so the UI templates the real principal into IAM grant commands instead of a hardcoded constant."}},"type":"object","required":["success","project_id","total_count"],"title":"ServiceDiscoveryResult","description":"Service discovery result with error handling."},"ServiceEnableResult":{"properties":{"service_name":{"type":"string","title":"Service Name"},"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"operation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operation Id"}},"type":"object","required":["service_name","success","message"],"title":"ServiceEnableResult","description":"Result of enabling or disabling a GCP API."},"ServiceIAMCheckResponse":{"properties":{"service_account_email":{"type":"string","title":"Service Account Email"},"platform_sa_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform Sa Email"},"current_roles":{"items":{"type":"string"},"type":"array","title":"Current Roles"},"recommendations":{"items":{"$ref":"#/components/schemas/IAMRecommendation"},"type":"array","title":"Recommendations"}},"type":"object","required":["service_account_email","current_roles","recommendations"],"title":"ServiceIAMCheckResponse","description":"Response for IAM check endpoint."},"StartTrialRequest":{"properties":{"plan_id":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Plan the trial anchors on (starter or professional). The anchor must be a non-zero price so the subscription auto-charges at trial end (card on file) unless canceled. Enterprise/unknown plans are rejected."},"success_url":{"type":"string","title":"Success Url","description":"URL Stripe Checkout redirects to after the card is collected. Mirrors checkout (the trial flow now goes through Stripe Checkout)."},"cancel_url":{"type":"string","title":"Cancel Url","description":"URL Stripe Checkout redirects to if the user abandons the card collection step."},"user_uid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Uid","description":"Auth0 User ID from the Landing Page onboarding flow. If provided, the trial is started for this user instead of the authenticated service account — mirrors the checkout flow."},"region":{"anyOf":[{"type":"string","enum":["us","eu"]},{"type":"null"}],"title":"Region","description":"Billing region from Landing Page geolocation. Ignored for existing customers (stored region wins). Defaults to 'us'."},"billing_period":{"type":"string","enum":["monthly","annual"],"title":"Billing Period","description":"Billing period the trial's anchor price uses; the user converts to this cadence if they upgrade. Defaults to 'monthly'.","default":"monthly"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata","description":"Optional passthrough metadata (e.g. onboarding context). The trial now flows through Stripe Checkout, which stamps the server-owned trial metadata (user_id, plan_id, region, trial_type, auth0_user_id, source) onto the subscription itself; client keys cannot override it."},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Origin identifier, e.g. 'landing_page_onboarding'."}},"type":"object","required":["plan_id","success_url","cancel_url"],"title":"StartTrialRequest","description":"Request to start a card-on-file Brain evaluation trial."},"StartTrialResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Subscription status, 'trialing' on success."},"plan_id":{"type":"string","title":"Plan Id","description":"Plan the trial anchors on."},"checkout_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkout Url","description":"Stripe Checkout URL the Landing Page redirects to so the card is collected. None when an existing trial was returned idempotently (no new card to collect; the Landing Page treats 'ok + no checkout_url' as 'go to success')."},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id","description":"Internal checkout session record ID for the new Checkout session. None on an idempotent existing-trial return."},"already_trialing":{"type":"boolean","title":"Already Trialing","description":"True when an existing trial was returned idempotently (re-click of 'Try Brain').","default":false}},"type":"object","required":["status","plan_id"],"title":"StartTrialResponse","description":"Result of starting (or idempotently re-fetching) a Brain trial."},"StarterSuggestion":{"properties":{"kind":{"type":"string","title":"Kind"},"title":{"type":"string","title":"Title"},"label":{"type":"string","title":"Label","default":""},"prompt":{"type":"string","title":"Prompt","default":""},"href":{"type":"string","title":"Href","default":""}},"type":"object","required":["kind","title"],"title":"StarterSuggestion","description":"One welcome-screen conversation opener the Brain can actually answer.\n\n``kind`` selects the frontend icon/hue (``resume`` / ``self`` / ``entity``\n/ ``task`` / ``contradiction`` / ``retraction`` / ``queue``; an unknown\nvalue renders with a default icon). ``prompt`` is sent verbatim through\nthe normal composer, so the answer rides the same memory recall and\ncitation seams a typed message would. ``href`` cards navigate instead of\nprompting (the queue card): the path is composed server-side from a\nconstant relative prefix plus validated ids only, and the frontend\nrenderer rejects non-relative schemes. A card carries a prompt OR an\nhref, never neither (the route filter enforces it)."},"SteerQueueItem":{"properties":{"steer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Steer Id"},"text":{"type":"string","title":"Text"},"sender_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Name"}},"type":"object","required":["text"],"title":"SteerQueueItem","description":"One queued-but-not-yet-drained steer."},"SteerQueueResponse":{"properties":{"steers":{"items":{"$ref":"#/components/schemas/SteerQueueItem"},"type":"array","title":"Steers"}},"type":"object","required":["steers"],"title":"SteerQueueResponse","description":"Pending steers for a thread, oldest first."},"SteerRequest":{"properties":{"text":{"type":"string","maxLength":8000,"minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"SteerRequest","description":"A user message aimed at the thread's live run."},"SteerResponse":{"properties":{"steered":{"type":"boolean","title":"Steered"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"steer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Steer Id"}},"type":"object","required":["steered"],"title":"SteerResponse","description":"Outcome of the steer attempt."},"SubscriptionCancelRequest":{"properties":{"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","description":"Cancel at end of billing period (true) or immediately (false)","default":true}},"type":"object","title":"SubscriptionCancelRequest","description":"Request schema for canceling subscription."},"SubscriptionPlan":{"type":"string","enum":["starter","professional","enterprise"],"title":"SubscriptionPlan","description":"Available subscription plans."},"SubscriptionResponse":{"properties":{"id":{"type":"string","title":"Id","description":"Subscription ID"},"user_id":{"type":"string","title":"User Id","description":"User ID"},"stripe_subscription_id":{"type":"string","title":"Stripe Subscription Id","description":"Stripe subscription ID"},"stripe_customer_id":{"type":"string","title":"Stripe Customer Id","description":"Stripe customer ID"},"plan_id":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Subscription plan"},"status":{"$ref":"#/components/schemas/SubscriptionStatus","description":"Subscription status"},"current_period_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period Start","description":"Current billing period start"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End","description":"Current billing period end"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","description":"Whether subscription will cancel at period end"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Subscription creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Subscription last update timestamp"}},"type":"object","required":["id","user_id","stripe_subscription_id","stripe_customer_id","plan_id","status","cancel_at_period_end","created_at","updated_at"],"title":"SubscriptionResponse","description":"Response schema for subscription details."},"SubscriptionStatus":{"type":"string","enum":["active","canceled","incomplete","incomplete_expired","past_due","trialing","unpaid"],"title":"SubscriptionStatus","description":"Stripe subscription statuses."},"SummaryResponse":{"properties":{"status":{"type":"string","enum":["pending","completed"],"title":"Status"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"key_points":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Key Points"},"generated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Generated At"}},"type":"object","required":["status"],"title":"SummaryResponse","description":"Response model for thread summary."},"TaskCreateRequest":{"properties":{"title":{"type":"string","maxLength":200,"minLength":1,"title":"Title"},"detail":{"type":"string","maxLength":4000,"title":"Detail","default":""},"assignee":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"org_wide":{"type":"boolean","title":"Org Wide","default":false}},"type":"object","required":["title"],"title":"TaskCreateRequest","description":"Create payload; scope defaults to creator-private."},"TaskListResponse":{"properties":{"tasks":{"items":{"$ref":"#/components/schemas/TaskRecord"},"type":"array","title":"Tasks"},"truncated":{"type":"boolean","title":"Truncated"}},"type":"object","required":["tasks","truncated"],"title":"TaskListResponse","description":"List page + the honest incompleteness signal."},"TaskPatchRequest":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":200,"minLength":1},{"type":"null"}],"title":"Title"},"detail":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Detail"},"assignee":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"org_wide":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Org Wide"},"working_thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Working Thread Id"},"review_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Review Note"},"status":{"anyOf":[{"type":"string","enum":["open","working","needs_review","done","dropped"]},{"type":"null"}],"title":"Status"}},"type":"object","title":"TaskPatchRequest","description":"Partial update; only provided fields change (read-modify-write)."},"TaskRecord":{"properties":{"type":{"type":"string","const":"task","title":"Type","default":"task"},"task_id":{"type":"string","title":"Task Id"},"title":{"type":"string","maxLength":200,"minLength":1,"title":"Title"},"detail":{"type":"string","maxLength":4000,"title":"Detail","default":""},"status":{"type":"string","enum":["open","working","needs_review","done","dropped"],"title":"Status","default":"open"},"assignee_entity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee Entity"},"assignee_surface":{"type":"string","title":"Assignee Surface","default":""},"assignee_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee User Id"},"requester":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requester"},"memory_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memory Key"},"source":{"$ref":"#/components/schemas/TaskSource"},"working_thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Working Thread Id"},"review_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Review Note"},"dedupe_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dedupe Key"},"team_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Id"},"allowed_teams":{"items":{"type":"string"},"type":"array","title":"Allowed Teams"},"created_at":{"type":"string","title":"Created At","default":""},"updated_at":{"type":"string","title":"Updated At","default":""},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"status_changed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Changed At"},"creator_user_id":{"type":"string","title":"Creator User Id","default":""},"created_by":{"type":"string","title":"Created By","default":""},"updated_by":{"type":"string","title":"Updated By","default":""}},"type":"object","required":["task_id","title"],"title":"TaskRecord","description":"One ledger row. ``task_id`` is also the store key."},"TaskSource":{"properties":{"thread_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Thread Id"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","title":"TaskSource","description":"Provenance of a task (all optional)."},"Team":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Team name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Team description"},"id":{"type":"string","title":"Id","description":"Team ID (UUID)"},"organization_id":{"type":"string","title":"Organization Id","description":"Organization ID"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["name","id","organization_id","created_at","updated_at"],"title":"Team","description":"Complete team schema with all fields."},"TeamCreate":{"properties":{"name":{"type":"string","maxLength":100,"minLength":1,"title":"Name","description":"Team name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Team description"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id","description":"Organization ID (defaults to user's organization)"}},"type":"object","required":["name"],"title":"TeamCreate","description":"Schema for creating a new team.\n\nNote: organization_id is optional. If not provided, it will default to the\nauthenticated user's primary_organization_id."},"TeamMemberAdd":{"properties":{"role":{"type":"string","title":"Role","description":"Member role: owner, admin, or member","default":"member"},"user_id":{"type":"string","title":"User Id","description":"User ID to add to team (UUID)"}},"type":"object","required":["user_id"],"title":"TeamMemberAdd","description":"Schema for adding a member to a team."},"TeamMemberResponse":{"properties":{"user_id":{"type":"string","title":"User Id","description":"User ID (UUID)"},"team_id":{"type":"string","title":"Team Id","description":"Team ID (UUID)"},"role":{"type":"string","title":"Role","description":"Member role"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username","description":"Username"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"Membership creation timestamp"}},"type":"object","required":["user_id","team_id","role","created_at"],"title":"TeamMemberResponse","description":"Response schema for team member operations."},"TeamUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name","description":"Updated team name"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description","description":"Updated team description"}},"type":"object","title":"TeamUpdate","description":"Schema for updating team details."},"TestProbeResult":{"properties":{"ok":{"type":"boolean","title":"Ok"},"provisioning_state":{"$ref":"#/components/schemas/integration__schemas__encryption_config__ProvisioningState"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Redacted KmsCallError message when ``ok=False``. Customer project_id is never present in this string."},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail","description":"Human-readable next-step guidance, e.g. \"grant roles/cloudkms.cryptoKeyEncrypterDecrypter to <platform SA email>\"."}},"type":"object","required":["ok","provisioning_state"],"title":"TestProbeResult","description":"``POST .../encryption/test`` response.\n\nThe probe attempts a real KMS ``encrypt`` call against the\ncustomer's KEK. Success flips ``provisioning_state`` to\n``active``; failure records the error and leaves the state\nunchanged (or flips to ``failed`` if it was previously active —\nthat's a meaningful regression worth surfacing)."},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type"},"expires_in":{"type":"integer","title":"Expires In"}},"type":"object","required":["access_token","token_type","expires_in"],"title":"Token","description":"Token response model"},"TokenResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"}},"type":"object","required":["success","message"],"title":"TokenResponse","description":"OAuth token response."},"TokenStatusResponse":{"properties":{"status":{"type":"string","title":"Status"},"has_token":{"type":"boolean","title":"Has Token"},"has_refresh_token":{"type":"boolean","title":"Has Refresh Token"},"expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Expires In"},"scope":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scope"}},"type":"object","required":["status","has_token","has_refresh_token"],"title":"TokenStatusResponse","description":"Token status response."},"TransactionType":{"type":"string","enum":["allocation","usage","refund","adjustment","overage_usage","prepaid_purchase","prepaid_usage"],"title":"TransactionType","description":"Credit transaction types."},"TrendPoint":{"properties":{"month":{"type":"string","title":"Month","description":"Calendar month the memories were created, YYYY-MM"},"label":{"type":"string","title":"Label","description":"Category display label (same case-insensitive folding and curated-spelling precedence as ``categories``)"},"count":{"type":"integer","title":"Count","description":"Live memories created that month in this category"}},"type":"object","required":["month","label","count"],"title":"TrendPoint","description":"Live-memory count for one category in one calendar month."},"TruncateRequest":{"properties":{"namespaces":{"items":{"items":{"type":"string"},"type":"array"},"type":"array","minItems":1,"title":"Namespaces","description":"Namespace prefixes to truncate (e.g. ``[['episodes'], ['knowledge']]``). The org_id is appended by the helper. For a re-onboard wipe also include ``['_amem_meta']`` + ``['_amem_redirects']`` + any custom-domain heads, or stale rows will mismatch the next forward migration's reconciliation."},"dry_run":{"type":"boolean","title":"Dry Run","description":"When True (the default) returns counts without deleting. Set False to actually wipe rows.","default":true}},"type":"object","required":["namespaces"],"title":"TruncateRequest","description":"POST body for ``/memory-db/truncate``.\n\n``namespaces`` is a list of namespace tuples (e.g.\n``[[\"episodes\"], [\"knowledge\"]]``) — the tuple shape lets a caller\ntarget sub-namespaces if needed. ``dry_run`` defaults to ``True``\nso an accidental click counts rather than deletes.\n\nReminder for operators running a wipe-and-re-onboard sequence\n(DELETE → re-register → migrate): the OPERATIONAL heads\n``_amem_meta`` (evolution counters) and ``_amem_redirects`` (A-mem\nredirect chains) persist on the BYO instance independent of\n``episodes`` / ``knowledge`` / ``profile_metrics`` / ``playbooks``.\nA truncate that omits them leaves stale counter + redirect rows\nthat mismatch the next forward migration's reconciliation phase\n(``report.ok=False``) → the operator sees \"migration broken\" when\nthey actually have residue from the prior cycle. To wipe the\nBYO instance comprehensively, include ALL of:\n    [[\"episodes\"], [\"knowledge\"], [\"profile_metrics\"],\n     [\"playbooks\"], [\"_amem_meta\"], [\"_amem_redirects\"]]\nplus any custom-domain heads the org has registered."},"UnsupportedFact":{"properties":{"entity_id":{"type":"string","title":"Entity Id"},"entity_name":{"type":"string","title":"Entity Name","default":""},"predicate":{"type":"string","title":"Predicate"},"value":{"type":"string","title":"Value"},"unsupported_at":{"type":"string","title":"Unsupported At"}},"type":"object","required":["entity_id","predicate","value","unsupported_at"],"title":"UnsupportedFact","description":"A fact whose value the grounding ladder could not support anywhere.\n\nQueue item for the curation rail: the dream pass established that no\nmemory in the Brain states this value (stamped ``unsupported_at``),\nwhich makes it a stale-fact/contradiction candidate awaiting a human\nruling: remove (DELETE the fact, writes a value veto) or keep."},"UpgradeRequest":{"properties":{"target_plan":{"$ref":"#/components/schemas/SubscriptionPlan","description":"Target plan to upgrade to (e.g., 'professional')"}},"type":"object","required":["target_plan"],"title":"UpgradeRequest","description":"Request schema for upgrading subscription to a higher tier."},"UpgradeResponse":{"properties":{"success":{"type":"boolean","title":"Success","description":"Whether upgrade was successful"},"subscription_id":{"type":"string","title":"Subscription Id","description":"Stripe subscription ID"},"previous_plan":{"type":"string","title":"Previous Plan","description":"Previous plan name"},"new_plan":{"type":"string","title":"New Plan","description":"New plan name after upgrade"},"credits_added":{"type":"integer","title":"Credits Added","description":"Additional credits added for the upgrade"}},"type":"object","required":["success","subscription_id","previous_plan","new_plan","credits_added"],"title":"UpgradeResponse","description":"Response schema for subscription upgrade."},"UsagePackPreset":{"type":"string","enum":["10","25","50"],"title":"UsagePackPreset","description":"Available preset usage pack amounts."},"UserCreate":{"properties":{"username":{"type":"string","maxLength":50,"minLength":3,"title":"Username","description":"Username (3-50 characters)"},"password":{"type":"string","minLength":8,"title":"Password","description":"Password (minimum 8 characters)"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Email address"},"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name","description":"Full name"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id","description":"Organization ID (slug)"},"is_superuser":{"type":"boolean","title":"Is Superuser","description":"Whether user has superuser privileges","default":false}},"type":"object","required":["username","password"],"title":"UserCreate","description":"Schema for creating a new internal user."},"UserListResponse":{"properties":{"users":{"items":{"$ref":"#/components/schemas/UserResponse"},"type":"array","title":"Users","description":"List of users"},"total":{"type":"integer","title":"Total","description":"Total number of users"}},"type":"object","required":["users","total"],"title":"UserListResponse","description":"Response schema for listing users."},"UserResponse":{"properties":{"id":{"type":"string","title":"Id","description":"User ID (UUID)"},"username":{"type":"string","title":"Username","description":"Username"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Email address"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name","description":"Full name"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id","description":"Organization ID"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether user is active"},"is_superuser":{"type":"boolean","title":"Is Superuser","description":"Whether user is superuser"},"auth_source":{"type":"string","title":"Auth Source","description":"Authentication source (internal/external)"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"User creation timestamp"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["id","username","is_active","is_superuser","auth_source","created_at","updated_at"],"title":"UserResponse","description":"Public user response schema (no password)."},"UserSyncData":{"properties":{"external_id":{"type":"string","title":"External Id","description":"User ID from Landing/Auth app"},"username":{"type":"string","title":"Username","description":"Username"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"User email address"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name","description":"Full name"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id","description":"Organization ID"},"roles":{"items":{"type":"string"},"type":"array","title":"Roles","description":"User roles","default":["user"]},"is_active":{"type":"boolean","title":"Is Active","description":"Whether user is active","default":true},"stripe_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Region","description":"Stripe region: 'us' or 'eu' (from geolocation)"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Verified phone number from Auth0 (E.164 format)"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"Last update timestamp"}},"type":"object","required":["external_id","username","updated_at"],"title":"UserSyncData","description":"User data from Landing/Auth app for synchronization."},"UserSyncPayload":{"properties":{"action":{"type":"string","title":"Action","description":"Action: created, updated, deleted"},"user_id":{"type":"string","title":"User Id","description":"External user ID"},"user_data":{"anyOf":[{"$ref":"#/components/schemas/UserSyncData"},{"type":"null"}],"description":"User data (for create/update)"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp","description":"Event timestamp"}},"type":"object","required":["action","user_id"],"title":"UserSyncPayload","description":"Complete payload for user synchronization webhook."},"UserSyncResponse":{"properties":{"status":{"type":"string","title":"Status","description":"Sync status: success, failed"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message","description":"Optional message"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"Local user ID if created/updated"}},"type":"object","required":["status"],"title":"UserSyncResponse","description":"Response from user sync webhook."},"UserUpdate":{"properties":{"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Updated email address"},"full_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Full Name","description":"Updated full name"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id","description":"Updated organization ID"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active","description":"Whether user is active"},"roles":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Roles","description":"Updated user roles"}},"type":"object","title":"UserUpdate","description":"Schema for updating user details."},"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"},"WebhookSourceCreateRequest":{"properties":{"provider":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z0-9][a-z0-9_-]*$","title":"Provider"},"name":{"type":"string","maxLength":128,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":2000,"title":"Description","default":""},"default_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Profile"}},"type":"object","required":["provider","name"],"title":"WebhookSourceCreateRequest","description":"Request schema for creating/updating a webhook source."},"WebhookSourceResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"default_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Profile"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"}},"type":"object","required":["provider","name","description","default_profile"],"title":"WebhookSourceResponse","description":"Response schema for a webhook source."},"WebhookSourceUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Description"},"default_profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Profile"}},"type":"object","title":"WebhookSourceUpdateRequest","description":"Request schema for updating a webhook source (partial)."},"_Attachment":{"properties":{"kind":{"type":"string","enum":["reference","template","script"],"title":"Kind"},"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name"},"content":{"type":"string","maxLength":100000,"minLength":1,"title":"Content"}},"type":"object","required":["kind","name","content"],"title":"_Attachment"},"_CreatePlaybook":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"title":"Name"},"trigger_description":{"type":"string","maxLength":4000,"minLength":1,"title":"Trigger Description"},"body":{"type":"string","maxLength":8000,"minLength":1,"title":"Body"},"target":{"type":"string","enum":["reasoning","execution"],"title":"Target"}},"type":"object","required":["name","trigger_description","body","target"],"title":"_CreatePlaybook"},"_DenyListEntry":{"properties":{"pattern":{"type":"string","minLength":1,"title":"Pattern","description":"Regex pattern or literal prefix"},"is_regex":{"type":"boolean","title":"Is Regex","description":"Treat pattern as regex","default":false},"description":{"type":"string","title":"Description","description":"Human-readable reason","default":""},"category":{"type":"string","title":"Category","description":"Grouping: kubectl, gcloud, general","default":""}},"type":"object","required":["pattern"],"title":"_DenyListEntry","description":"Schema for a single deny list entry."},"_DenyListResponse":{"properties":{"entries":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Entries","description":"Current deny list entries"},"count":{"type":"integer","title":"Count","description":"Number of entries"},"level":{"type":"string","title":"Level","description":"Deny list level: provider or cluster"},"resource_key":{"type":"string","title":"Resource Key","description":"Provider key or cluster name"}},"type":"object","required":["entries","count","level","resource_key"],"title":"_DenyListResponse","description":"Response schema for a deny list."},"_DenyListUpdate":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/_DenyListEntry"},"type":"array","title":"Entries","description":"Full replacement deny list entries"}},"type":"object","required":["entries"],"title":"_DenyListUpdate","description":"Request schema for replacing a deny list."},"_DismissBody":{"properties":{"watermark_ts":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Watermark Ts","description":"The generation shown on the card. Required in practice: without it a stale card can suppress a window nobody reviewed."}},"type":"object","title":"_DismissBody","description":"Which readiness generation the caller believes it is dismissing."},"_DisqualifiersMetadataPatch":{"properties":{"interest_seed_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Interest Seed Template"},"verification_protocol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verification Protocol"},"info_seeker_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Info Seeker Prompt"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"additionalProperties":false,"type":"object","title":"_DisqualifiersMetadataPatch","description":"Patch the top-level ``Disqualifiers`` metadata (NOT patterns).\n\nAll fields default to ``None`` = \"leave alone\". Use the patterns\nsub-resource to edit individual rules.\n\nM-4: ``extra=\"forbid\"`` so a typo like ``verifcation_protocol``\nreturns 422 instead of silently accepting the body and updating\nnothing — the kind of bug that makes a customer think the API is\nbroken.\n\nAdversarial-pass-2 H-A: a non-``None`` ``interest_seed_template``\nis run through ``_validate_interest_seed_template`` here. The\nfield-validator on ``Disqualifiers`` doesn't fire when the store\nconstructs the new sub-pack via ``model_copy(update=...)``, so\nenforcing it at the route boundary is the only path that catches\nbad templates introduced via PATCH. Defense in depth at the\nstore layer is in ``RubricStore.replace_disqualifiers_metadata``.\n\nSub-pack ``version`` is intentionally NOT patchable from this\nsurface; it's engine-managed. Bump via full-rubric PUT if needed."},"_DraftApplyRequest":{"properties":{"pattern_names":{"items":{"type":"string"},"type":"array","title":"Pattern Names"},"factor_names":{"items":{"type":"string"},"type":"array","title":"Factor Names"}},"additionalProperties":false,"type":"object","title":"_DraftApplyRequest","description":"Selected names from the staged draft (content immutable)."},"_DraftApplyResponse":{"properties":{"rubric_id":{"type":"string","title":"Rubric Id"},"applied_patterns":{"items":{"type":"string"},"type":"array","title":"Applied Patterns"},"applied_factors":{"items":{"type":"string"},"type":"array","title":"Applied Factors"}},"type":"object","required":["rubric_id","applied_patterns","applied_factors"],"title":"_DraftApplyResponse","description":"What apply promoted into the active rubric."},"_DraftDetail":{"properties":{"key":{"type":"string","title":"Key"},"rubric_id":{"type":"string","title":"Rubric Id"},"profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile"},"created_at":{"type":"string","title":"Created At"},"staged_by":{"type":"string","title":"Staged By"},"status":{"type":"string","title":"Status"},"new_patterns":{"type":"integer","title":"New Patterns"},"kept_weights":{"type":"integer","title":"Kept Weights"},"decision_count":{"type":"integer","title":"Decision Count"},"patch":{"additionalProperties":true,"type":"object","title":"Patch"}},"type":"object","required":["key","rubric_id","created_at","staged_by","status","new_patterns","kept_weights","decision_count","patch"],"title":"_DraftDetail","description":"A staged draft with its full induction patch."},"_DraftDigest":{"properties":{"key":{"type":"string","title":"Key"},"rubric_id":{"type":"string","title":"Rubric Id"},"profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile"},"created_at":{"type":"string","title":"Created At"},"staged_by":{"type":"string","title":"Staged By"},"status":{"type":"string","title":"Status"},"new_patterns":{"type":"integer","title":"New Patterns"},"kept_weights":{"type":"integer","title":"Kept Weights"},"decision_count":{"type":"integer","title":"Decision Count"}},"type":"object","required":["key","rubric_id","created_at","staged_by","status","new_patterns","kept_weights","decision_count"],"title":"_DraftDigest","description":"One staged-draft summary row."},"_DraftInduceRequest":{"properties":{"profile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile","description":"Scope harvesting to one profile."}},"additionalProperties":false,"type":"object","title":"_DraftInduceRequest","description":"Body for POST /{rubric_id}/drafts/induce."},"_DraftInduceResponse":{"properties":{"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"},"decisions":{"type":"integer","title":"Decisions"},"new_patterns":{"type":"integer","title":"New Patterns"},"kept_weights":{"type":"integer","title":"Kept Weights"}},"type":"object","required":["key","decisions","new_patterns","kept_weights"],"title":"_DraftInduceResponse","description":"Induction outcome; ``key`` is None when nothing was proposed."},"_DraftListResponse":{"properties":{"drafts":{"items":{"$ref":"#/components/schemas/_DraftDigest"},"type":"array","title":"Drafts"}},"type":"object","required":["drafts"],"title":"_DraftListResponse","description":"Staged drafts, newest first."},"_GateDecisionSummary":{"properties":{"total":{"type":"integer","title":"Total"},"needs_review":{"type":"integer","title":"Needs Review"},"by_gate_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Gate Status"},"by_lifecycle_state":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Lifecycle State"}},"type":"object","required":["total","needs_review","by_gate_status","by_lifecycle_state"],"title":"_GateDecisionSummary"},"_MaterialRequest":{"properties":{"filename":{"type":"string","maxLength":200,"minLength":1,"title":"Filename"},"size_bytes":{"type":"integer","minimum":1.0,"title":"Size Bytes"},"content_type":{"type":"string","maxLength":100,"minLength":3,"title":"Content Type","default":"text/plain"}},"type":"object","required":["filename","size_bytes"],"title":"_MaterialRequest","description":"Upload intent for one file of raw import material."},"_MediaStorageSetupRequest":{"properties":{"provider_key":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Provider Key"},"bucket":{"anyOf":[{"type":"string","maxLength":222,"minLength":3,"pattern":"^[a-z0-9][a-z0-9._-]+$"},{"type":"null"}],"title":"Bucket"}},"type":"object","title":"_MediaStorageSetupRequest","description":"One-call media-storage setup (durable chat/channel attachments)."},"_OrgPlaybookListResponse":{"properties":{"summary":{"$ref":"#/components/schemas/_GateDecisionSummary"},"playbooks":{"items":{"$ref":"#/components/schemas/_PlaybookResponse"},"type":"array","title":"Playbooks"}},"type":"object","required":["summary","playbooks"],"title":"_OrgPlaybookListResponse"},"_PlaybookListResponse":{"properties":{"playbooks":{"items":{"$ref":"#/components/schemas/_PlaybookResponse"},"type":"array","title":"Playbooks"}},"type":"object","required":["playbooks"],"title":"_PlaybookListResponse"},"_PlaybookResponse":{"properties":{"key":{"type":"string","title":"Key"},"name":{"type":"string","title":"Name"},"trigger_description":{"type":"string","title":"Trigger Description"},"body":{"type":"string","title":"Body"},"target":{"type":"string","enum":["reasoning","execution"],"title":"Target"},"profile_name":{"type":"string","title":"Profile Name"},"created_by":{"type":"string","title":"Created By"},"lifecycle_state":{"type":"string","title":"Lifecycle State"},"pinned":{"type":"boolean","title":"Pinned"},"event_time":{"type":"string","title":"Event Time","default":""},"attachments":{"items":{"$ref":"#/components/schemas/_Attachment"},"type":"array","title":"Attachments","default":[]},"gate_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gate Status"},"gate_rank_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gate Rank Score"},"gate_confidence_delta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gate Confidence Delta"},"gate_fired_defeaters":{"items":{"type":"string"},"type":"array","title":"Gate Fired Defeaters","default":[]},"gate_shadow_verdict":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gate Shadow Verdict"},"gate_shadow_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gate Shadow Score"},"gate_decided_at":{"type":"string","title":"Gate Decided At","default":""}},"type":"object","required":["key","name","trigger_description","body","target","profile_name","created_by","lifecycle_state","pinned"],"title":"_PlaybookResponse"},"_PolicyBody":{"properties":{"match":{"$ref":"#/components/schemas/PolicyMatch"},"effect":{"type":"string","enum":["forbid","require_approval","shadow","allow"],"title":"Effect"},"enforce":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enforce","description":"Omit to follow the rollout rule (non-enforcing on create and on every edit); pass true to promote explicitly."},"note":{"type":"string","maxLength":500,"title":"Note","default":""},"compensation":{"anyOf":[{"$ref":"#/components/schemas/CompensationSpec"},{"type":"null"}],"description":"Declarative undo metadata ({description, command?}) rendered wherever a matched action is held for approval."},"capture_prior":{"type":"boolean","title":"Capture Prior","description":"Attach a derived prior-state read (mutating kubectl only) to log rows and held-action messages.","default":false}},"type":"object","required":["effect"],"title":"_PolicyBody","description":"Policy body for PUT (policy_id comes from the path)."},"_PolicyListResponse":{"properties":{"policies":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Policies"}},"type":"object","required":["policies"],"title":"_PolicyListResponse"},"_PreviewRequest":{"properties":{"source":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9_.\\- ]+$","title":"Source"},"text":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Text"},"material_id":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Material Id"}},"type":"object","required":["source"],"title":"_PreviewRequest","description":"Raw source material to distill into proposed memories.\n\nExactly one of ``text`` (small inline paste) or ``material_id`` (a\nregistered bulk material in the org's own bucket)."},"_PreviewResponse":{"properties":{"preview_id":{"type":"string","title":"Preview Id"},"proposals":{"items":{"$ref":"#/components/schemas/SeedRow"},"type":"array","title":"Proposals"},"proposed_count":{"type":"integer","title":"Proposed Count"},"note":{"type":"string","title":"Note"},"unchanged_since_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Unchanged Since Version","description":"Set when the material's checksum matches the source's last imported version: nothing changed, nothing was analyzed, and there is nothing to commit"},"media_entry":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Media Entry","description":"For image materials: the attachment pointer (original object in the customer's bucket) that will ride every committed row. Renders as the chip on the review card; descriptions are not editable (the commit contract keeps content immutable)."}},"type":"object","required":["preview_id","proposals","proposed_count","note"],"title":"_PreviewResponse","description":"Persisted proposal set for the admin to review before committing."},"_ReflectNowResponse":{"properties":{"status":{"type":"string","title":"Status"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["status","detail"],"title":"_ReflectNowResponse"},"_ReflectionAudit":{"properties":{"run_id":{"type":"string","title":"Run Id"},"profile_name":{"type":"string","title":"Profile Name"},"mode":{"type":"string","title":"Mode"},"reason":{"items":{"type":"string"},"type":"array","title":"Reason","default":[]},"touched":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Touched","default":[]},"cited_run_ids":{"items":{"type":"string"},"type":"array","title":"Cited Run Ids","default":[]},"reverted":{"type":"boolean","title":"Reverted","default":false},"created_at":{"type":"string","title":"Created At","default":""},"reverted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reverted At"}},"type":"object","required":["run_id","profile_name","mode"],"title":"_ReflectionAudit"},"_ReflectionAuditList":{"properties":{"runs":{"items":{"$ref":"#/components/schemas/_ReflectionAudit"},"type":"array","title":"Runs"}},"type":"object","required":["runs"],"title":"_ReflectionAuditList"},"_ReplayRequest":{"properties":{"sample_size":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Sample Size","default":3}},"type":"object","title":"_ReplayRequest","description":"Replay batch parameters (item 4b)."},"_RevertResponse":{"properties":{"run_id":{"type":"string","title":"Run Id"},"archived":{"items":{"type":"string"},"type":"array","title":"Archived"},"skipped":{"items":{"type":"string"},"type":"array","title":"Skipped"}},"type":"object","required":["run_id","archived","skipped"],"title":"_RevertResponse"},"_RubricListResponse":{"properties":{"rubrics":{"items":{"$ref":"#/components/schemas/_RubricResponse"},"type":"array","title":"Rubrics"}},"type":"object","required":["rubrics"],"title":"_RubricListResponse","description":"List view for ``GET /rubrics``."},"_RubricResponse":{"properties":{"type":{"type":"string","const":"rubric","title":"Type","description":"Decorative type tag (kept for back-compat; the namespace is the canonical discriminator). Marks the record as a config-shaped rubric distinct from memory patterns.","default":"rubric"},"rubric_id":{"type":"string","title":"Rubric Id","description":"Stable identifier (e.g. 'prospect')"},"description":{"type":"string","title":"Description","default":""},"disqualifiers":{"$ref":"#/components/schemas/Disqualifiers"},"scoring":{"$ref":"#/components/schemas/Scoring"},"output":{"$ref":"#/components/schemas/Output"},"version":{"type":"integer","title":"Version","default":1},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At"},"updated_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated By"}},"additionalProperties":false,"type":"object","required":["rubric_id","disqualifiers","scoring","output"],"title":"_RubricResponse","description":"Rubric body + storage-layer audit fields.\n\nInherits the full Rubric shape so the response is the canonical\nPydantic model — no field drift between the DR engine's\n``_load_rubric`` view and the admin REST view. Audit fields default\nto ``None`` so older rows that pre-date the metadata still\nserialize cleanly.\n\nAdversarial-pass-3 M-2: this subclass inherits the parent's\n``extra=\"forbid\"`` (M-A) — the audit fields are DECLARED here so\nthey aren't \"extras\" and pass strict validation. A prior version\noverrode with ``extra=\"ignore\"`` to be permissive on future drift,\nbut that contradicts the M-A intent of catching mismatches early.\nBetter to surface a clear ValidationError if ``Rubric`` ever gains\na field this response forgets to mirror."},"_RubricTestRequest":{"properties":{"scenarios":{"items":{"$ref":"#/components/schemas/RubricScenario"},"type":"array","minItems":1,"title":"Scenarios"}},"type":"object","required":["scenarios"],"title":"_RubricTestRequest","description":"Scenario batch to run through the rubric."},"_RubricTestStartResponse":{"properties":{"test_id":{"type":"string","title":"Test Id"},"status":{"type":"string","title":"Status"},"scenario_count":{"type":"integer","title":"Scenario Count"},"note":{"type":"string","title":"Note"}},"type":"object","required":["test_id","status","scenario_count","note"],"title":"_RubricTestStartResponse","description":"202 response for a started test run."},"_ScoringMetadataPatch":{"properties":{"semantics":{"anyOf":[{"type":"string","enum":["dfquad","qe","eb"]},{"type":"null"}],"title":"Semantics"},"aggregator":{"anyOf":[{"type":"string","enum":["sum","product"]},{"type":"null"}],"title":"Aggregator"},"use_dual_bag":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Dual Bag"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"}},"additionalProperties":false,"type":"object","title":"_ScoringMetadataPatch","description":"Patch the top-level ``Scoring`` metadata (NOT factors).\n\nSame ``extra=\"forbid\"`` rationale as ``_DisqualifiersMetadataPatch``.\nSub-pack ``version`` is intentionally NOT patchable."},"_SeedRequest":{"properties":{"source":{"anyOf":[{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9_.\\- ]+$"},{"type":"null"}],"title":"Source","description":"Label for where these rows came from (e.g. 'hubspot-export'). Required in rows mode; preview mode carries the preview's own source label."},"rows":{"anyOf":[{"items":{"$ref":"#/components/schemas/SeedRow"},"type":"array","minItems":1},{"type":"null"}],"title":"Rows"},"preview_id":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Preview Id"},"selected":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Selected"},"edits":{"anyOf":[{"items":{"$ref":"#/components/schemas/SeedProposalEdit"},"type":"array"},{"type":"null"}],"title":"Edits"}},"type":"object","title":"_SeedRequest","description":"Batch commit: inline rows OR an approved preview subset.\n\nTwo modes, exactly one:\n- ``rows`` (+ required ``source``): the original programmatic path.\n- ``preview_id`` + ``selected`` (+ optional constrained ``edits``):\n  the reviewed-import path — commit can only produce rows that\n  exist verbatim in the persisted preview."},"_SeedStartResponse":{"properties":{"batch_id":{"type":"string","title":"Batch Id"},"status":{"type":"string","title":"Status"},"row_count":{"type":"integer","title":"Row Count"},"note":{"type":"string","title":"Note"}},"type":"object","required":["batch_id","status","row_count","note"],"title":"_SeedStartResponse","description":"202 response for a started batch."},"_StorageSetupRequest":{"properties":{"provider_key":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Provider Key"},"bucket":{"anyOf":[{"type":"string","maxLength":222,"minLength":3,"pattern":"^[a-z0-9][a-z0-9._-]+$"},{"type":"null"}],"title":"Bucket"},"origin":{"anyOf":[{"type":"string","maxLength":200,"pattern":"^https?://[^\\s/]+$"},{"type":"null"}],"title":"Origin","description":"Browser origin to allow for direct uploads (CORS)."}},"type":"object","title":"_StorageSetupRequest","description":"One-call storage connect: the platform does every step it can."},"integration__schemas__encryption_config__ProvisioningState":{"type":"string","enum":["pending","active","failed"],"title":"ProvisioningState","description":"Lifecycle state of the per-org encryption configuration.\n\n- ``pending``  — admin started onboarding; we haven't yet\n                 verified our SA can call ``encrypt`` on the\n                 resource. ``derive_context`` ignores pending\n                 configs (falls back to platform default) so\n                 a half-configured BYOK doesn't break writes.\n- ``active``   — ``/test`` probe passed; ``derive_context``\n                 routes the org's encrypts through this KEK.\n- ``failed``   — terminal. Admin must fix IAM and rerun\n                 ``/test``. Pending state would be acceptable\n                 here too; ``failed`` exists so the UI can show\n                 an actionable error instead of a stuck spinner."},"integration__schemas__memory_db__ProvisioningState":{"type":"string","enum":["pending","active","failed"],"title":"ProvisioningState","description":"Lifecycle state of the BYO memory DB.\n\n- ``pending``  — admin started the onboarding flow; instance may\n                 not exist yet, schema not run, IAM user not\n                 created. Dispatcher raises ``BYODBNotReadyError``\n                 to surface 503 rather than silently spilling\n                 data to the platform DB.\n- ``active``   — health probe passed end-to-end; dispatcher\n                 routes memory ops to this instance. Set only\n                 via ``AgentEnvironmentStore.set_memory_db_active``\n                 (the deterministic ``/memory-db/test`` probe\n                 pass path).\n- ``failed``   — terminal \"gave up\" state. Set via\n                 ``AgentEnvironmentStore.set_memory_db_failed``\n                 (admin tooling / future onboarding-agent\n                 \"give up\" flow). Dispatcher raises\n                 ``BYODBNotReadyError`` identically to\n                 ``pending``; the distinction is purely an\n                 operator-UX signal so polling clients can tell\n                 \"still onboarding\" from \"stuck, please\n                 intervene\". The PENDING→FAILED transition is\n                 ENFORCED in the setter (an ACTIVE cfg must be\n                 torn down via DELETE, not flag-flipped)."},"routes__eval__CheckpointResponse":{"properties":{"exists":{"type":"boolean","title":"Exists"},"technique":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Technique"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"run_tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Tag"},"conversations":{"additionalProperties":{"$ref":"#/components/schemas/CheckpointConvProgress"},"type":"object","title":"Conversations","default":{}}},"type":"object","required":["exists"],"title":"CheckpointResponse","description":"Server-side checkpoint snapshot."},"routes__eval__CleanupResponse":{"properties":{"technique":{"type":"string","title":"Technique"},"cleaned_conversations":{"items":{"type":"integer"},"type":"array","title":"Cleaned Conversations"},"checkpoint_deleted":{"type":"boolean","title":"Checkpoint Deleted","default":false}},"type":"object","required":["technique","cleaned_conversations"],"title":"CleanupResponse","description":"Response from the cleanup phase."},"routes__eval_longmemeval__CheckpointResponse":{"properties":{"exists":{"type":"boolean","title":"Exists"},"technique":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Technique"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"in_progress":{"type":"boolean","title":"In Progress","default":false},"total_sessions_seeded":{"type":"integer","title":"Total Sessions Seeded","default":0},"examples":{"additionalProperties":{"$ref":"#/components/schemas/CheckpointExampleProgress"},"type":"object","title":"Examples","default":{}}},"type":"object","required":["exists"],"title":"CheckpointResponse","description":"Server-side checkpoint snapshot."},"routes__eval_longmemeval__CleanupResponse":{"properties":{"technique":{"type":"string","title":"Technique"},"cleaned_questions":{"type":"integer","title":"Cleaned Questions"},"checkpoint_deleted":{"type":"boolean","title":"Checkpoint Deleted","default":false},"example_rows_deleted":{"type":"integer","title":"Example Rows Deleted","default":0},"orphan_rows_swept":{"type":"integer","title":"Orphan Rows Swept","default":0}},"type":"object","required":["technique","cleaned_questions"],"title":"CleanupResponse","description":"Response from the cleanup phase."},"routes__eval_memoryagentbench__CheckpointResponse":{"properties":{"exists":{"type":"boolean","title":"Exists"},"technique":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Technique"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At"},"records":{"additionalProperties":{"$ref":"#/components/schemas/CheckpointRecordProgress"},"type":"object","title":"Records","default":{}}},"type":"object","required":["exists"],"title":"CheckpointResponse","description":"Server-side checkpoint snapshot."},"routes__eval_memoryagentbench__CleanupResponse":{"properties":{"technique":{"type":"string","title":"Technique"},"cleaned_records":{"type":"integer","title":"Cleaned Records"},"checkpoint_deleted":{"type":"boolean","title":"Checkpoint Deleted","default":false}},"type":"object","required":["technique","cleaned_records"],"title":"CleanupResponse","description":"Response from the cleanup phase."}},"headers":{},"parameters":{},"responses":{"GetItemResponse":{"description":"Successful retrieval of an item.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Item"}}}},"PutItemResponse":{"description":"Item successfully stored or updated.","content":{}},"DeleteItemResponse":{"description":"Item successfully deleted.","content":{}},"SearchItemsResponse":{"description":"Successful search operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchItemsResponse"}}}},"ListNamespacesResponse":{"description":"Successful retrieval of namespaces.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListNamespaceResponse"}}}},"ErrorResponse":{"description":"An error occurred.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"callbacks":{},"requestBodies":{},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}},"examples":{}},"security":[{"x-api-key":[]}],"servers":[]}