{"openapi":"3.1.0","info":{"title":"bidauthor API","version":"1.0.0"},"servers":[{"url":"/v1"}],"paths":{"/documents/upload":{"post":{"tags":["public-api"],"summary":"Upload Document","description":"Upload a new document.\n\nThe document is saved to storage immediately and returned.\nEmbedding/indexing happens in the background.\nCheck processing_status field to see if indexing is complete.\n\nAccess checks (via OperationConfig \"document_upload\"):\n- Limit: max_documents\n- Storage: max_storage_gb","operationId":"upload_document_documents_upload_post","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document_documents_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/upload-text":{"post":{"tags":["public-api"],"summary":"Upload Document Text","description":"Upload a document by sending raw markdown / plaintext as a JSON\nbody — no multipart, no synthetic file required.\n\nThe same ``document_upload`` operation gates this route as the\nmultipart sibling: same scope (``documents:write``), same limit\ndispatches (count, storage, rolling window), same atomic credit\ncommit. The handler composes :meth:`DocumentService.upload_document`\nrather than re-implementing dedup, the storage-cap check, or the\nDC mirror handoff — single source of truth for \"what happens when a\ndocument is created.\"\n\nAccepted formats: ``.md`` and ``.txt`` only. Binary formats (PDF,\nDOCX, etc.) require the multipart route — they're not text and\ndon't round-trip cleanly through a JSON string field.","operationId":"upload_document_text_documents_upload_text_post","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTextUploadRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents":{"get":{"tags":["public-api"],"summary":"List Documents","description":"List documents with flexible filtering.\n\nUnified endpoint for document listing:\n- Filter by workspace_id to get documents for a specific workspace\n- Filter by category_id for a specific category\n- Filter by tags (category names) for RFP-related documents\n- Filter by kind ('kb' / 'guideline') for role-scoped lists\n- Filter by visibility_mode for guideline workspace-scoping\n- Use include_shared=true to also include org-wide shared documents\n\nExamples:\n- GET /api/documents - Documents in current workspace + shared\n- GET /api/documents?workspace_id=xxx - Documents in specific workspace\n- GET /api/documents?tags=Case%20Studies - filter by one tag\n- GET /api/documents?kind=guideline&visibility_mode=workspace - my workspace's scoped guidelines","operationId":"list_documents_documents_get","parameters":[{"name":"category_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by specific category ID","title":"Category Id"},"description":"Filter by specific category ID"},{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by workspace ID (uses current workspace if not specified)","title":"Workspace Id"},"description":"Filter by workspace ID (uses current workspace if not specified)"},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated category names to filter by","title":"Tags"},"description":"Comma-separated category names to filter by"},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"enum":["kb","guideline"],"type":"string"},{"type":"null"}],"description":"Filter by document role. ``kb`` returns only knowledge-base documents (the wizard's KB-doc step uses this); ``guideline`` returns only guideline documents. Omit to list every kind.","title":"Kind"},"description":"Filter by document role. ``kb`` returns only knowledge-base documents (the wizard's KB-doc step uses this); ``guideline`` returns only guideline documents. Omit to list every kind."},{"name":"visibility_mode","in":"query","required":false,"schema":{"enum":["both","global","workspace"],"type":"string","description":"Visibility scoping for guideline documents (mig 123). Ignored for non-guideline queries. ``both`` (default) merges org-wide globals with the current workspace's scoped guidelines — the wizard / Guidelines tab default. ``global`` returns only org-wide guidelines. ``workspace`` returns only the current workspace's scoped guidelines.","default":"both","title":"Visibility Mode"},"description":"Visibility scoping for guideline documents (mig 123). Ignored for non-guideline queries. ``both`` (default) merges org-wide globals with the current workspace's scoped guidelines — the wizard / Guidelines tab default. ``global`` returns only org-wide guidelines. ``workspace`` returns only the current workspace's scoped guidelines."},{"name":"active_data_workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User's session data-workspace id, used to scope guideline visibility (mig 123). Required for ``visibility_mode='both'`` or ``'workspace'`` to surface workspace-scoped guidelines; without it we degrade to globals-only. Distinct from the ``X-Workspace-ID`` request header / ``workspace_id`` query param, which scope where the docs LIVE — the Documents pane's Guidelines tab points X-Workspace-ID at the singleton guideline workspace (where bytes live) but the user's actual data workspace stays in the session and gets passed here.","title":"Active Data Workspace Id"},"description":"User's session data-workspace id, used to scope guideline visibility (mig 123). Required for ``visibility_mode='both'`` or ``'workspace'`` to surface workspace-scoped guidelines; without it we degrade to globals-only. Distinct from the ``X-Workspace-ID`` request header / ``workspace_id`` query param, which scope where the docs LIVE — the Documents pane's Guidelines tab points X-Workspace-ID at the singleton guideline workspace (where bytes live) but the user's actual data workspace stays in the session and gets passed here."},{"name":"include_shared","in":"query","required":false,"schema":{"type":"boolean","description":"Include org-wide shared documents (workspace_id=null)","default":true,"title":"Include Shared"},"description":"Include org-wide shared documents (workspace_id=null)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Maximum documents to return","default":15,"title":"Limit"},"description":"Maximum documents to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of documents to skip","default":0,"title":"Offset"},"description":"Number of documents to skip"},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}":{"get":{"tags":["public-api"],"summary":"Get Document","description":"Get document details","operationId":"get_document_documents__document_id__get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["public-api"],"summary":"Delete Document","description":"Delete a document","operationId":"delete_document_documents__document_id__delete","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/categories/{category_id}":{"post":{"tags":["public-api"],"summary":"Add Document To Category","description":"Add document to category","operationId":"add_document_to_category_documents__document_id__categories__category_id__post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}},{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Category Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["public-api"],"summary":"Remove Document From Category","description":"Remove document from category","operationId":"remove_document_from_category_documents__document_id__categories__category_id__delete","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}},{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Category Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/content":{"get":{"tags":["public-api"],"summary":"Get Document Content","description":"Get document text content for editing.\n\nExposed on both ``/api/documents/{id}/content`` (dashboard) and\n``/v1/documents/{id}/content`` (SDK). Returns the extracted text\nfor txt/md documents; refuses other file types so the surface\ncontract is \"what comes out is what you can replace via PUT.\"","operationId":"get_document_content_documents__document_id__content_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["public-api"],"summary":"Update Document Content","description":"Update document text content.\n\nExposed on both ``/api/documents/{id}/content`` (dashboard, admin\nrole) and ``/v1/documents/{id}/content`` (SDK, ``documents:write``\nscope). Idempotency-Key required — the mutating contract is\nenforced via ``requires_idempotency_key=True`` on the spec, so a\nflaky retry doesn't double-write conflicting content.","operationId":"update_document_content_documents__document_id__content_put","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentContentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/documents/{document_id}/diagnostics":{"get":{"tags":["public-api"],"summary":"Get Document Diagnostics","description":"DC ingest lifecycle diagnostic for a single document.\n\nReads the document row and computes a typed deviation list the\nSDK / FE can branch on without parsing strings. Free read; the\ndocuments:read scope is sufficient.","operationId":"get_document_diagnostics_documents__document_id__diagnostics_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Document Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentDiagnosticsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categories":{"post":{"tags":["public-api"],"summary":"Create Category","description":"Create a category in the caller's workspace, or org-globally.\n\n``applies_to`` constrains which document kinds the category may\ntag; ``is_meta`` makes it surface as a wizard chip-bar toggle;\n``make_global=True`` forces ``workspace_id=NULL`` so the category\nis visible from every workspace in the organization.","operationId":"create_category_categories_post","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["public-api"],"summary":"List Categories","description":"List all categories visible to the current workspace.\n\nEach row carries ``document_count`` scoped to the same tenant the\ndocuments pane uses, so the category cards stay consistent with\nwhat the user sees when they drill in.","operationId":"list_categories_categories_get","parameters":[{"name":"include_shared","in":"query","required":false,"schema":{"type":"boolean","description":"Include org-wide shared categories","default":true,"title":"Include Shared"},"description":"Include org-wide shared categories"},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/categories/{category_id}":{"get":{"tags":["public-api"],"summary":"Get Category","description":"Get category details and a document count.","operationId":"get_category_categories__category_id__get","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Category Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["public-api"],"summary":"Update Category","description":"Update a category. Editable: name, description, applies_to, is_meta.","operationId":"update_category_categories__category_id__put","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Category Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["public-api"],"summary":"Delete Category","description":"Delete a category. Documents stay; their tag is removed.","operationId":"delete_category_categories__category_id__delete","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Category Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat":{"get":{"tags":["public-api","chat-v1"],"summary":"List Chats","description":"List the caller's chats within the current organization, newest\nfirst. Org-scoped (chats persist across workspace switches) — uses\norg_viewer_scope so an org-spanning API key works without\nrequiring an X-Workspace-ID header for a resource that doesn't\nlive under a workspace.","operationId":"list_chats_chat_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["public-api","chat-v1"],"summary":"Create Chat","description":"Create a new chat. Org-scoped (visible across workspace switches).","operationId":"create_chat_chat_post","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/{chat_id}":{"get":{"tags":["public-api","chat-v1"],"summary":"Get Chat","description":"Fetch a chat plus its message history.\n\nThe message history is the persisted ``messages`` rows; in-flight\nstreaming events (deltas, tool calls) are NOT part of this\nresponse — those flow through the streaming endpoint and the\npersisted message captures the final assistant text once the run\nterminates.","operationId":"get_chat_chat__chat_id__get","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["public-api","chat-v1"],"summary":"Delete Chat","description":"Delete a chat. The cascade clears its messages.","operationId":"delete_chat_chat__chat_id__delete","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatDeletedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/{chat_id}/messages":{"post":{"tags":["public-api","chat-v1"],"summary":"Send Message Stream","description":"Send a message and receive a streaming SSE response.\n\nEvent types emitted (canonical v1 envelope, all carry ``id``,\n``chat_id``, ``created_at``):\n\n  message.thinking      — typing indicator before each LLM call\n  tool.call_started     — a tool call begins\n  tool.call_completed   — a tool call ends\n  message.delta         — token-shaped streaming text\n  message.content_block — a complete content block (text or block)\n  message.completed     — terminal frame; status ∈ {success, error,\n                          cancelled, timeout, cost_limit, max_steps}\n\nThe customer's HTTP client should consume until ``message.completed``\narrives. UI-only events (panel toggles, navigation suggestions)\nare filtered out so the customer doesn't see the FE's vocabulary.\n\nCost: ``agent_message`` reserves credits at request entry; the\nworker commits on terminal success, refunds on failure or the\ncancellation marker triggered by client disconnect.","operationId":"send_message_stream_chat__chat_id__messages_post","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/{chat_id}/messages/ask":{"post":{"tags":["public-api","chat-v1"],"summary":"Send Message Ask","description":"Send a message and block until the agent terminates.\n\nDrains the same SSE stream internally and returns the persisted\nassistant message once the run reaches ``message.completed``. For\nlong-running multi-step agent runs prefer the streaming route\nabove; this endpoint exists for SDK use-cases where the customer\nwants a single request/response shape.\n\nReturns a typed envelope carrying:\n\n  * ``user_message``      — the persisted user row.\n  * ``assistant_message`` — the persisted assistant row, or None\n                            if the run terminated without one\n                            (timeout / error / cancellation).\n  * ``terminal``          — the terminal status as emitted in the\n                            v1 stream's ``message.completed``.\n  * ``error``             — error string when terminal is \"error\"\n                            or \"timeout\".","operationId":"send_message_ask_chat__chat_id__messages_ask_post","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendMessageRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/{chat_id}/diagnostics":{"get":{"tags":["public-api","chat-v1"],"summary":"Get Chat Diagnostics","description":"Composite canonical-success-shape assertion for a chat session.\n\nReads the chat's persisted messages (no Redis-stream consumption,\nno live-tail), inspects the most recent assistant message's\n``message_metadata`` (populated by the worker post-run with\n``status``, ``steps``, ``tool_calls``, ``cost_usd``,\n``duration_ms``), and returns a typed deviation list the SDK can\nbranch on without parsing strings.\n\nOrg-scoped (chats are org-scoped, not workspace-scoped — see\n:data:`NO_WORKSPACE` usage in the parent CRUD routes); free read\nvia the canonical free-read OperationSpec pattern.","operationId":"get_chat_diagnostics_chat__chat_id__diagnostics_get","parameters":[{"name":"chat_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Chat Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatDiagnosticsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/answer":{"post":{"tags":["public-api","Answering"],"summary":"Answer Selection","description":"Execute an answer request in the worker.\n\nThe route re-plans (freshness), fails fast when the estimate exceeds\navailable credits, then dispatches. Per-item charges open in the\nworker at each item's execution under the existing\n``rfp.item.regenerate`` op — same price as a single regenerate\ntoday; the route's ``rfp.item.chat`` gate is the $0 anchor event the\nworker binds cost context to. Progress streams on the generation's\nexisting Redis stream — the UI needs no new wire.","operationId":"answer_selection_rfp_versions__version_id__answer_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerSelectionBody"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/proposals":{"post":{"tags":["public-api","Briefs"],"summary":"Create Proposal","description":"Create a bare proposal — the from-scratch entry.\n\nZero briefs is legal; the user (or Arthur) authors requirements\nnext via POST /proposals/{id}/requirements. Same ``proposal_create``\nop + limits as the upload entry — a proposal is a proposal however\nit starts.","operationId":"create_proposal_rfp_proposals_post","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProposalBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["public-api","Proposals"],"summary":"Get Rfp Proposals","description":"Get all RFP proposals for current user within the organization/workspace.","operationId":"get_rfp_proposals_rfp_proposals_get","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by workspace ID","title":"Workspace Id"},"description":"Filter by workspace ID"},{"name":"include_shared","in":"query","required":false,"schema":{"type":"boolean","description":"Include org-wide shared proposals","default":true,"title":"Include Shared"},"description":"Include org-wide shared proposals"},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/proposals/{proposal_id}/briefs":{"post":{"tags":["public-api","Briefs"],"summary":"Add File Brief","description":"Attach another inbound document (addendum, scope doc, …).\n\n$0 anchor event on the ``proposal_create`` op — the brief is\nmaterial on an existing proposal, not a new proposal; downstream\nDC extraction cost attributes to this event via the worker bind.","operationId":"add_file_brief_rfp_proposals__proposal_id__briefs_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proposal Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_add_file_brief_rfp_proposals__proposal_id__briefs_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/proposals/{proposal_id}/requirements":{"post":{"tags":["public-api","Requirements"],"summary":"Author Requirements","description":"Author a requirement set by hand — the from-scratch path.\n\nFree ($0 anchor on the extraction op — same ledger family, no LLM).\nMints an authored set derived from the current active one and makes\nit active; existing generations stay pinned to their sets.","operationId":"author_requirements_rfp_proposals__proposal_id__requirements_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proposal Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorRequirementsBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/proposals/{proposal_id}/requirements/clone":{"post":{"tags":["public-api","Requirements"],"summary":"Clone Requirements","description":"Copy another proposal's requirement set onto this one.\n\nThe recompete door. Free, no LLM — the source set is lowered back\ninto authored items by :func:`authored_items_from_set` and written\nby the same :func:`create_authored_set` the from-scratch door uses,\nso structure, ordering, nesting, and dependency edges all survive\nby construction rather than by a second copy routine.\n\n``derived_from_set_id`` points at the SOURCE set, not this\nproposal's previous active one — lineage should record where the\ncontent actually came from. Existing versions on this proposal stay\npinned to their own sets; cloning is never retroactive.","operationId":"clone_requirements_rfp_proposals__proposal_id__requirements_clone_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proposal Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloneRequirementsBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/proposals/{proposal_id}/requirements/extract":{"post":{"tags":["public-api","Requirements"],"summary":"Reextract Requirements","description":"(Re-)extract requirements from the proposal's briefs.\n\nWithout ``force`` this is the idempotent library-flow trigger (an\nalready-completed extraction short-circuits, reservation released).\nWith ``force`` a NEW set is minted from the current brief text —\nthe \"an addendum landed, re-shred the requirements\" action.\nExisting generations keep their pinned sets untouched.","operationId":"reextract_requirements_rfp_proposals__proposal_id__requirements_extract_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proposal Id"}},{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions":{"post":{"tags":["public-api","Versions"],"summary":"Create Version","description":"Create a generation, reserve credits, and dispatch the worker.\n\nAccess checks (via OperationConfig `rfp.generation`):\n  - Feature: rfp_generation_enabled\n  - Limit:   rfp_max_concurrent_generations (declarative\n             ACTIVE_INSTANCE dispatch, run by AccessService inside\n             ``require_access`` automatically). The per-tier\n             lifetime cap (``max_generations``) was retired in\n             migration 144 — credits are the canonical throttle on\n             total volume.\n  - Credits: reserves the per-run cost.\n\nReturns immediately with `{id, status: 'queued'}`. The client then opens\nGET /api/rfp/generations/{id}/stream?since=0-0 to watch live progress.","operationId":"create_version_rfp_versions_post","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVersionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["public-api","Version Queries"],"summary":"List Versions","description":"Get all RFP generations for current user within the organization/workspace (paginated).","operationId":"list_versions_rfp_versions_get","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"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search name + proposal filename","title":"Q"},"description":"Search name + proposal filename"},{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by workspace ID","title":"Workspace Id"},"description":"Filter by workspace ID"},{"name":"include_shared","in":"query","required":false,"schema":{"type":"boolean","description":"Include org-wide shared generations","default":true,"title":"Include Shared"},"description":"Include org-wide shared generations"},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}":{"delete":{"tags":["public-api","History"],"summary":"Delete Version","description":"Delete a proposal version.","operationId":"delete_version_rfp_versions__version_id__delete","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/cancel":{"post":{"tags":["public-api","Versions"],"summary":"Cancel Version Run","description":"Cancel an in-flight generation. Pro-rated credit refund.\n\nMounted on both ``/api/rfp/generations/{id}/cancel`` (dashboard)\nand ``/v1/rfp/generations/{id}/cancel`` (SDK / agent) — same\nhandler, same lifecycle, same cost-ledger row. The parent\n``rfp.generation`` reservation is resolved via\n:meth:`UsageTracker.commit_by_event_id` (above-threshold) or\n:meth:`UsageTracker.refund_by_event_id` (below-threshold).","operationId":"cancel_version_run_rfp_versions__version_id__cancel_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/answers/{answer_id}/chat":{"post":{"tags":["public-api","Answers"],"summary":"Chat With Item","description":"Per-item chat — refine, research, clarify, escalate, mark complete.\n\nReturns SSE events as the intent executes. The intent is auto-classified\nfrom the message text unless `intent` is explicitly provided.","operationId":"chat_with_item_rfp_versions__version_id__answers__answer_id__chat_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"answer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Answer Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/answers/{answer_id}/retry":{"post":{"tags":["public-api","Answers"],"summary":"Retry Item","description":"User-initiated retry for a failed or groundless answer.\n\nDispatches a per-item re-run via the thread service's refine\nhandler which re-executes the LLM pipeline for this single answer.","operationId":"retry_item_rfp_versions__version_id__answers__answer_id__retry_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"answer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Answer Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/finalize":{"post":{"tags":["public-api","Finalize"],"summary":"Finalize","description":"Kick off deferred finalization: LLM polish + render + R2 upload.\n\nGeneration must be in ``complete`` or ``finalize_failed`` status.\nTransitions to ``finalizing`` and dispatches the worker task. If the\ntask dispatch itself fails (broker unreachable, serialization error),\nthe status is reverted so the user can retry — without this rollback\nthe row would wedge in ``finalizing`` forever and the UI would never\nre-surface the Finalize button.","operationId":"finalize_rfp_versions__version_id__finalize_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinalizeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinalizeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/document.md":{"get":{"tags":["public-api","Finalize"],"summary":"Get Document Markdown","description":"The deliverable as markdown — exactly what finalize hands the renderer.\n\nOne assembler serves this route and the PDF, so the Document tab is\na preview of the file, never an approximation of it. ETag is the\nnewest write across sections and answers; the tab revalidates on\nevery focus and gets a 304 when nothing changed.","operationId":"get_document_markdown_rfp_versions__version_id__document_md_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"shape","in":"query","required":false,"schema":{"anyOf":[{"enum":["document","questionnaire","combined"],"type":"string"},{"type":"null"}],"description":"Which walk to render. Defaults to the version's own deliverable_shape.","title":"Shape"},"description":"Which walk to render. Defaults to the version's own deliverable_shape."},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/outputs":{"get":{"tags":["public-api","Finalize"],"summary":"List Outputs","description":"List all rendered outputs for a version.","operationId":"list_outputs_rfp_versions__version_id__outputs_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/outputs/{output_id}/url":{"get":{"tags":["public-api","Finalize"],"summary":"Get Output Url","description":"Get a fresh presigned download URL for a completed export.\n\nURL expires in 15 minutes. Re-issuable anytime — the R2 key is permanent.\nThe download filename is derived from the generation title so users get\nsomething meaningful instead of every file landing as ``rfp-response.pdf``.","operationId":"get_output_url_rfp_versions__version_id__outputs__output_id__url_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"output_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Output Id"}},{"name":"disposition","in":"query","required":false,"schema":{"enum":["attachment","inline"],"type":"string","description":"Content-Disposition for the download","default":"attachment","title":"Disposition"},"description":"Content-Disposition for the download"},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/files":{"post":{"tags":["public-api","Answer files"],"summary":"Upload File To Version","description":"Upload a file scoped to a version (not a specific answer).","operationId":"upload_file_to_version_rfp_versions__version_id__files_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_to_version_rfp_versions__version_id__files_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerFileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["public-api","Answer files"],"summary":"List Version Files","operationId":"list_version_files_rfp_versions__version_id__files_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/answers/{answer_id}/files":{"post":{"tags":["public-api","Answer files"],"summary":"Upload File To Answer","description":"Upload a file scoped to one answer within a version.","operationId":"upload_file_to_answer_rfp_versions__version_id__answers__answer_id__files_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"answer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Answer Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_file_to_answer_rfp_versions__version_id__answers__answer_id__files_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerFileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["public-api","Answer files"],"summary":"List Answer Files","operationId":"list_answer_files_rfp_versions__version_id__answers__answer_id__files_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"answer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Answer Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/files/{file_id}/url":{"get":{"tags":["public-api","Answer files"],"summary":"Get File Url","operationId":"get_file_url_rfp_versions__version_id__files__file_id__url_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerFileUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/proposals/upload":{"post":{"tags":["public-api","Proposals"],"summary":"Upload Rfp Proposal","description":"Upload a file and create an RFP proposal within the organization/workspace.\n\nThis is the NEW primary entry point for file uploads in Step 1.\nIt creates the Proposal immediately, validates if it looks like an RFP,\nand starts background text extraction.\n\nAccess checks (via OperationConfig \"proposal_create\"):\n- Limit: max_proposals\n\nReturns:\n    - proposal_id: The created proposal ID\n    - is_valid_rfp: Whether the document looks like an RFP\n    - validation_message: Explanation of validation result\n    - extraction_status: Current status (extracting, pending, etc.)","operationId":"upload_rfp_proposal_rfp_proposals_upload_post","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_rfp_proposal_rfp_proposals_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/proposals/{proposal_id}/force-continue":{"post":{"tags":["public-api","Proposals"],"summary":"Force Continue Extraction","description":"Force continue with extraction even if validation failed.\nCalled when user clicks \"Continue Anyway\" in the UI.\n\nMints a no-charge ``usage_event_id`` (all check_* flags False)\npurely so the extraction worker's ``require_usage_event_id`` gate\npasses and downstream DC/LLM costs land on a real ledger row.\nThe original ``proposal_create`` event from the upload already\ncharged credits; this is a recovery retry, not a re-charge.","operationId":"force_continue_extraction_rfp_proposals__proposal_id__force_continue_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","title":"Proposal Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/proposals/{proposal_id}/extract-questions":{"post":{"tags":["public-api","Proposals"],"summary":"Extract Proposal Questions Route","description":"Run the question extractor on a proposal as a standalone step.\n\nLibrary upload flow calls this after text extraction completes.\nThe wizard flow does NOT call this — its proposal stays without a\ntree and the orchestrator runs the extractor inline at Generate\nclick time, then backfills the proposal so subsequent generations\nskip the LLM call.\n\nIdempotent: if the tree is already extracted, the worker fast-path\nreturns it without an LLM call.","operationId":"extract_proposal_questions_route_rfp_proposals__proposal_id__extract_questions_post","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","title":"Proposal Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/proposals/{proposal_id}":{"get":{"tags":["public-api","Proposals"],"summary":"Get Rfp Proposal Detail","description":"Get a specific RFP proposal with its generations.","operationId":"get_rfp_proposal_detail_rfp_proposals__proposal_id__get","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","title":"Proposal Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/proposals/{proposal_id}/requirements/{requirement_key}/answers":{"get":{"tags":["public-api","Proposals"],"summary":"Get Answers Across Versions","description":"Every version's answer to ONE requirement, newest version first.\n\nPowers the question view's answers-across-versions dropdown and the\n\"use this answer\" swap (paired with the per-item import-answer\nroute). Free, read-only.\n\nThe path segment is the requirement KEY (``q-2-a``); rows are\nmatched on ``requirement_id`` — every version of this proposal\npins a set whose rows share keys, so the key resolves to one\nrequirement id per set and the join is by FK.","operationId":"get_answers_across_versions_rfp_proposals__proposal_id__requirements__requirement_key__answers_get","parameters":[{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","title":"Proposal Id"}},{"name":"requirement_key","in":"path","required":true,"schema":{"type":"string","title":"Requirement Key"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/detail":{"get":{"tags":["public-api","Version Queries"],"summary":"Get Version Detail","description":"Get a specific RFP generation with its items.","operationId":"get_version_detail_rfp_versions__version_id__detail_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/answers/{answer_id}/retrieval-details":{"get":{"tags":["public-api","Forensics"],"summary":"Get Item Retrieval Details","description":"Forensic detail for a single RFP item.\n\nCombines the persisted retrieval telemetry (mig 115 columns) with\na JOIN to ``llm_usage_logs`` for the LLM-side cost / token rollup —\nLLM cost ledger is the single source of truth there, snapshot\nroutes JOIN rather than duplicate.","operationId":"get_item_retrieval_details_rfp_versions__version_id__answers__answer_id__retrieval_details_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"answer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Answer Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetrievalDetailsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/dependency-gates":{"get":{"tags":["public-api","Forensics"],"summary":"List Dependency Gate Verdicts","description":"Every persisted gate verdict for the generation, in chronological\norder.\n\nSource: ``rfp_status_events`` rows whose ``metadata_json`` carries\na ``kind`` field. ``kind=\"partial_sufficient\"`` rows came from the\ncascade gate; ``kind=\"conditional\"`` rows came from conditional\nskips. Older rows without ``kind`` are ignored — they predate the\nmetadata extension and have no verdict envelope.","operationId":"list_dependency_gate_verdicts_rfp_versions__version_id__dependency_gates_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GateVerdictsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/extraction-tree":{"get":{"tags":["public-api","Forensics"],"summary":"Get Extraction Tree","description":"Reconstructed requirement tree for the version's answer rows.\n\nWalks the version's ``answers`` and nests each under the nearest\nANCESTOR requirement that has a row of its own — hierarchy is read\nfrom the pinned set (``requirements.parent_id``); headings carry no\nanswer row, so the walk steps past them. Cross-dependencies\n(``Requirement.depends_on_keys``) appear on each node so customers\nsee the full DAG shape, not just the spanning tree.","operationId":"get_extraction_tree_rfp_versions__version_id__extraction_tree_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionTreeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/diagnostics":{"get":{"tags":["public-api","Forensics"],"summary":"Get Generation Diagnostics","description":"Composite canonical-success-shape assertion for a generation.\n\nCombines the data the three single-snapshot routes return (item\nretrieval state, dependency-gate verdicts, extraction-tree\nintegrity) and returns a typed deviation list the SDK / FE can\nbranch on without three separate polls. Free read; rfp:read\nscope.","operationId":"get_generation_diagnostics_rfp_versions__version_id__diagnostics_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiagnosticsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/sections":{"post":{"tags":["public-api","Sections"],"summary":"Create Section","operationId":"create_section_rfp_versions__version_id__sections_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSectionBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/sections/{section_id}":{"patch":{"tags":["public-api","Sections"],"summary":"Update Section","operationId":"update_section_rfp_versions__version_id__sections__section_id__patch","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"section_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Section Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSectionBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["public-api","Sections"],"summary":"Delete Section","operationId":"delete_section_rfp_versions__version_id__sections__section_id__delete","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"section_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Section Id"}},{"name":"mode","in":"query","required":false,"schema":{"enum":["subtree","promote"],"type":"string","default":"subtree","title":"Mode"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/sections/{section_id}/move":{"post":{"tags":["public-api","Sections"],"summary":"Move Section","operationId":"move_section_rfp_versions__version_id__sections__section_id__move_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"section_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Section Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/sections/{section_id}/split":{"post":{"tags":["public-api","Sections"],"summary":"Split Section","operationId":"split_section_rfp_versions__version_id__sections__section_id__split_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"section_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Section Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/sections/merge":{"post":{"tags":["public-api","Sections"],"summary":"Merge Sections","operationId":"merge_sections_rfp_versions__version_id__sections_merge_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/sections/{section_id}/revisions/{revision_id}/activate":{"post":{"tags":["public-api","Sections"],"summary":"Activate Section Revision","operationId":"activate_section_revision_rfp_versions__version_id__sections__section_id__revisions__revision_id__activate_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"section_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Section Id"}},{"name":"revision_id","in":"path","required":true,"schema":{"type":"integer","title":"Revision Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/sections/{section_id}/requirements":{"post":{"tags":["public-api","Sections"],"summary":"Link Section Requirements","operationId":"link_section_requirements_rfp_versions__version_id__sections__section_id__requirements_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"section_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Section Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/sections/{section_id}/requirements/{requirement_id}":{"delete":{"tags":["public-api","Sections"],"summary":"Unlink Section Requirement","operationId":"unlink_section_requirement_rfp_versions__version_id__sections__section_id__requirements__requirement_id__delete","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"section_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Section Id"}},{"name":"requirement_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Requirement Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/sections/{section_id}/inject":{"post":{"tags":["public-api","Sections"],"summary":"Inject Section","operationId":"inject_section_rfp_versions__version_id__sections__section_id__inject_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"section_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Section Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InjectBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/sections/project":{"post":{"tags":["public-api","Sections"],"summary":"Project Sections","operationId":"project_sections_rfp_versions__version_id__sections_project_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MutationResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/sections/compose":{"post":{"tags":["public-api","Sections"],"summary":"Dispatch Compose","description":"Reserve the run anchor and enqueue the drain.","operationId":"dispatch_compose_rfp_versions__version_id__sections_compose_post","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComposeBody"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComposeAcceptedOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/coverage":{"get":{"tags":["public-api","Coverage"],"summary":"Get Coverage","description":"The matrix: every requirement in the version's pinned set with its\nanswer, the sections that address it, both derived states, and drift.","operationId":"get_coverage_rfp_versions__version_id__coverage_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoverageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/coverage/gates":{"get":{"tags":["public-api","Coverage"],"summary":"Get Coverage Gates","description":"Shippability. ``blocking`` / ``warnings`` are resolved for the\nversion's own ``deliverable_shape``; the three raw gates ride along\nso the UI can explain them.","operationId":"get_coverage_gates_rfp_versions__version_id__coverage_gates_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoverageGates"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/rfp/versions/{version_id}/coverage/search":{"get":{"tags":["public-api","Coverage"],"summary":"Search Coverage","description":"The \"search the matrix from a section\" call. Ranked: key exact >\nlabel prefix > text contains; capped at 200.","operationId":"search_coverage_rfp_versions__version_id__coverage_search_get","parameters":[{"name":"version_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Version Id"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":500,"description":"Text match on key, label, text.","default":"","title":"Q"},"description":"Text match on key, label, text."},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated requirement kinds.","title":"Kind"},"description":"Comma-separated requirement kinds."},{"name":"level","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated levels.","title":"Level"},"description":"Comma-separated levels."},{"name":"response_state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated response states.","title":"Response State"},"description":"Comma-separated response states."},{"name":"coverage_state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated coverage states.","title":"Coverage State"},"description":"Comma-separated coverage states."},{"name":"under","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"description":"Restrict to the subtree of this requirement key.","title":"Under"},"description":"Restrict to the subtree of this requirement key."},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoverageSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces":{"get":{"tags":["public-api","workspaces"],"summary":"List Workspaces","description":"List user-facing workspaces (kind=data) in the current organization.\n\nGuideline and simulation workspaces are intentionally excluded —\nthe guideline workspace is reached via ``GET /workspaces/guideline``\n(its only consumer is the RFP-generation surface), and the\nsimulation workspace is admin-only. Without this filter both leak\ninto the user-visible workspace switcher.","operationId":"list_workspaces_workspaces_get","parameters":[{"name":"include_stats","in":"query","required":false,"schema":{"type":"boolean","description":"Include document/proposal counts","default":false,"title":"Include Stats"},"description":"Include document/proposal counts"},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["public-api","workspaces"],"summary":"Create Workspace","description":"Create a new workspace in the current organization.\n\nUses :data:`org_admin_scope` rather than the workspace-bound\n:data:`admin_scope` because a workspace cannot be resolved before\nit exists. The org-spanning API-key flow's\n``workspace_id_required`` gate would otherwise refuse this route\nwith a 400, which is structurally wrong: the route's job IS to\nmint the workspace.\n\nType B operation. ``require_access(\"workspace_create\")`` runs the\n``max_workspaces`` quota check via the operations system and opens\na ``usage_events`` row uniformly with every other gated action. The\nquota itself is declared as a ``LimitDispatch(method=DENORMALIZED,\ndenormalized_count_column=\"workspace_count\")`` on the\n``workspace_create`` OperationSpec; the admin lever in\n``/admin/operations`` edits the live ``operation_configs`` row.","operationId":"create_workspace_workspaces_post","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/workspaces/{workspace_id}":{"get":{"tags":["public-api","workspaces"],"summary":"Get Workspace","description":"Get a specific workspace by ID.","operationId":"get_workspace_workspaces__workspace_id__get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"include_stats","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Stats"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}},{"name":"X-Workspace-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Workspace-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["public-api","workspaces"],"summary":"Update Workspace","description":"Update a workspace. Type B (no cost; admin can disable via\n``operation_configs.is_active=False`` for emergency feature kill).\n\nThe target workspace is named in the path; the route does not need\nworkspace context from the request, so it uses :data:`org_admin_scope`\nrather than :data:`admin_scope`. This keeps it reachable through\norg-spanning API keys without forcing callers to also set\n``X-Workspace-ID`` to the same id that is already in the URL.","operationId":"update_workspace_workspaces__workspace_id__patch","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["public-api","workspaces"],"summary":"Delete Workspace","description":"Delete a workspace and all its data.\n\nCannot delete the default workspace.\n\nUses :data:`org_admin_scope` for the same reason as ``PATCH``:\nworkspace identity comes from the URL, not from the request\ncontext, so requiring an additional ``X-Workspace-ID`` header is\nredundant and breaks org-spanning API keys.","operationId":"delete_workspace_workspaces__workspace_id__delete","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks":{"get":{"tags":["public-api","webhooks"],"summary":"List Endpoints","description":"List the org's registered webhook endpoints.","operationId":"list_endpoints_webhooks_get","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["public-api","webhooks"],"summary":"Create Endpoint","description":"Register a webhook endpoint and mint a fresh signing secret.\n\nThe signing secret is shown ONCE in this response — the customer\nstores it in their secrets manager. bidauthor stores only the\nencrypted-at-rest copy + SHA-256 hash. Rotation requires a fresh\nPOST to ``/rotate``.\n\nEach requested event_type is validated against the canonical\nregistry: it must (a) correspond to a registered OperationSpec\nand (b) have ``webhook_event_visibility=customer``. The route\nrefuses unknown event types with 400 ``webhook_event_unknown``\nand platform-internal events with 403\n``webhook_event_not_subscribable``. The synthetic ``webhook.test``\nevent is accepted (it's the customer's verifier-validation hook\nand has no owning spec by design).","operationId":"create_endpoint_webhooks_post","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEndpointRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/{endpoint_id}":{"get":{"tags":["public-api","webhooks"],"summary":"Read Endpoint","description":"Read a single endpoint's metadata.","operationId":"read_endpoint_webhooks__endpoint_id__get","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["public-api","webhooks"],"summary":"Delete Endpoint","description":"Delete an endpoint. Cascade clears its delivery audit.","operationId":"delete_endpoint_webhooks__endpoint_id__delete","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeletedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/{endpoint_id}/rotate":{"post":{"tags":["public-api","webhooks"],"summary":"Rotate Endpoint","description":"Rotate the signing secret. Returns the new raw secret ONCE.\n\nAll deliveries enqueued AFTER this rotation sign with the new\nsecret; in-flight deliveries already in the dispatcher's\nmaterialised batch may sign with the old. Customers should\naccept BOTH for a brief grace window during rotation.","operationId":"rotate_endpoint_webhooks__endpoint_id__rotate_post","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/{endpoint_id}/test":{"post":{"tags":["public-api","webhooks"],"summary":"Test Endpoint","description":"Fire a synthetic test event at the endpoint.\n\nThe response carries the ``delivery_id`` so the customer can\npoll ``GET /v1/webhooks/{id}/deliveries`` to see the outcome.\nTest events are subject to the same retry+DLQ semantics as\nproduction events.","operationId":"test_endpoint_webhooks__endpoint_id__test_post","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/{endpoint_id}/deliveries":{"get":{"tags":["public-api","webhooks"],"summary":"List Deliveries","description":"List recent deliveries for the endpoint, newest first.\n\nSurfaces the dispatcher's audit so customers can debug failures\n(HTTP status, response body preview, retry schedule) without\noperator intervention.","operationId":"list_deliveries_webhooks__endpoint_id__deliveries_get","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/{endpoint_id}/diagnostics":{"get":{"tags":["public-api","webhooks"],"summary":"Get Webhook Diagnostics","description":"Composite delivery-health diagnostic for a single webhook endpoint.\n\nReads the endpoint row + every delivery row (bounded by the\nnatural per-endpoint count), computes summary counts, and\nemits typed deviations the SDK / FE can branch on.","operationId":"get_webhook_diagnostics_webhooks__endpoint_id__diagnostics_get","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDiagnosticsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tasks":{"get":{"tags":["public-api","tasks"],"summary":"List Tasks","operationId":"list_tasks_tasks_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"open","title":"Status"}},{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"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"}}}}}}},"/tasks/{task_id}/complete":{"post":{"tags":["public-api","tasks"],"summary":"Complete Task","operationId":"complete_task_tasks__task_id__complete_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tasks/{task_id}/dismiss":{"post":{"tags":["public-api","tasks"],"summary":"Dismiss Task","operationId":"dismiss_task_tasks__task_id__dismiss_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/current":{"get":{"tags":["public-api","organizations-v1"],"summary":"Read Current Org","description":"Read the caller's current organization.","operationId":"read_current_org_organizations_current_get","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["public-api","organizations-v1"],"summary":"Update Current Org","description":"Update org name / billing email / settings.\n\nAudit lands automatically — ``OrganizationService.update_organization``\nwraps the mutation in ``audit_changes`` so the row + the\naudit_log entry commit atomically. ``ORGANIZATION_RENAMED`` fires\niff ``name`` actually changed; otherwise ``ORGANIZATION_UPDATED``.","operationId":"update_current_org_organizations_current_patch","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/current/members":{"get":{"tags":["public-api","organizations-v1"],"summary":"List Members","description":"List every member of the caller's org.","operationId":"list_members_organizations_current_members_get","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MemberPublic"},"title":"Response List Members Organizations Current Members Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/current/members/{user_id}":{"patch":{"tags":["public-api","organizations-v1"],"summary":"Update Member","description":"Change a member's role.\n\nThe service emits ``ORG_MEMBER_ROLE_CHANGED`` on the audit log\nand refuses the last-owner-demote case (`RemoveMemberError`).","operationId":"update_member_organizations_current_members__user_id__patch","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberRoleUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["public-api","organizations-v1"],"summary":"Remove Member","description":"Remove a member from the org. Cascades API-key revocation for\nkeys this member owned (handled by the service).","operationId":"remove_member_organizations_current_members__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"User Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberDeletedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/current/invitations":{"get":{"tags":["public-api","organizations-v1"],"summary":"List Invitations","description":"List pending (unaccepted, unexpired) invitations.","operationId":"list_invitations_organizations_current_invitations_get","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InvitationPublic"},"title":"Response List Invitations Organizations Current Invitations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["public-api","organizations-v1"],"summary":"Create Invitation","description":"Invite a new member to the org. Triggers the ``member_invite``\nOperationSpec — its ``max_members`` limit dispatch fires uniformly\nacross the agent-tool path AND this /v1 route. The\n``ORG_INVITATION_SENT`` audit row lands in the same commit as\nthe invitation insert.","operationId":"create_invitation_organizations_current_invitations_post","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvitationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPublic"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/organizations/current/invitations/{invitation_id}":{"delete":{"tags":["public-api","organizations-v1"],"summary":"Revoke Invitation","description":"Revoke a pending invitation.\n\nConfirms the invitation belongs to the caller's org BEFORE\ndelegating to the service — prevents cross-org invitation deletion\neven with the right scope. The service itself takes only the\ninvitation_id.","operationId":"revoke_invitation_organizations_current_invitations__invitation_id__delete","parameters":[{"name":"invitation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invitation Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationDeletedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api-keys":{"get":{"tags":["public-api","organizations-v1"],"summary":"List Api Keys","description":"List the caller's own API keys (org-bound).","operationId":"list_api_keys_api_keys_get","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyOut"},"title":"Response List Api Keys Api Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["public-api"],"summary":"Create Api Key Programmatic","description":"Mint a fresh API key from the public API.\n\nAuth: API-key only (parent key carrying ``keys:write``). JWT\nrequests are refused — see :func:`_require_api_key_auth`.\n\nConstraints (all three structural, returned as typed errors):\n\n  * Parent must hold ``keys:write`` (enforced by ``require_access``).\n  * Org must have ``programmatic_api_keys_enabled=True`` (enforced\n    by ``require_access`` via the OperationSpec's feature_key).\n  * New scopes ⊆ parent scopes (enforced inline; cannot escalate).\n  * New scopes do NOT include ``keys:write`` (enforced inline;\n    no recursion).\n  * The same per-tier ``max_api_keys`` and ``max_scopes_per_key``\n    caps the dashboard route applies — single chokepoint via\n    ``ApiKeyService.create_key``.","operationId":"create_api_key_programmatic_api_keys_post","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api-keys/scopes":{"get":{"tags":["public-api","organizations-v1"],"summary":"List Api Key Scopes","description":"List every OAuth scope a customer key may carry. Useful for\nSDKs auto-completing scope arrays at create time.","operationId":"list_api_key_scopes_api_keys_scopes_get","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ScopeCatalogEntry"},"title":"Response List Api Key Scopes Api Keys Scopes Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api-keys/{key_id}/revoke":{"post":{"tags":["public-api","organizations-v1"],"summary":"Revoke Api Key","description":"Revoke an API key. Idempotent — revoking an already-revoked\nkey returns the same shape with ``revoked_at`` populated.","operationId":"revoke_api_key_api_keys__key_id__revoke_post","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me":{"get":{"tags":["public-api","account-v1"],"summary":"Read Caller Identity","description":"Return the caller's resolved identity in one shape.","operationId":"read_caller_identity_me_get","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/balance":{"get":{"tags":["public-api","billing-v1"],"summary":"Get Credit Balance","description":"Read the current credit balance.\n\nMirrors ``/api/billing/credits`` — same ``UsageService.get_balance``\nprimitive, same shape. Renamed from ``/credits`` to ``/balance`` on\nthe SDK surface because \"balance\" is the verb a consumer reaches\nfor (\"how many credits do I have left?\"), and it pairs naturally\nwith the upcoming ``/v1/billing/transactions`` (history) without\nnesting under a noun-loaded ``credits`` namespace.","operationId":"get_credit_balance_billing_balance_get","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalance"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/subscription":{"get":{"tags":["public-api","billing-v1"],"summary":"Get Subscription","description":"Read the org's current subscription (tier, status, period window).","operationId":"get_subscription_billing_subscription_get","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionInfo"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/invoices":{"get":{"tags":["public-api","billing-v1"],"summary":"Get Invoices","description":"List invoices with cursor-based pagination.\n\nEmpty list when the org has never had a Stripe customer (free tier\npre-checkout) — that's the right shape, not a 404.","operationId":"get_invoices_billing_invoices_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Limit"}},{"name":"starting_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Starting After"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceInfo"},"title":"Response Get Invoices Billing Invoices Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/usage":{"get":{"tags":["public-api","billing-v1"],"summary":"Get Usage Summary","description":"Read the usage summary for the current billing period.","operationId":"get_usage_summary_billing_usage_get","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/transactions":{"get":{"tags":["public-api","billing-v1"],"summary":"List Credit Transactions","description":"List credit-transaction history with cursor-style offset pagination.\n\nEach row carries ``balance_after`` so a consumer can reconstruct\nthe running balance without a separate query. Optional\n``transaction_type`` narrows to one verb (charge / refund / grant /\npurchase). Validation is closed against the ``TransactionType`` enum;\na malformed value yields a typed ``invalid_request`` error.","operationId":"list_credit_transactions_billing_transactions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"transaction_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transaction Type"}},{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CreditTransaction"},"title":"Response List Credit Transactions Billing Transactions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/entitlements":{"get":{"tags":["public-api","billing-v1"],"summary":"Get Entitlements","description":"Read the org's resolved entitlements (features + numeric limits).","operationId":"get_entitlements_billing_entitlements_get","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitlementsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/models":{"get":{"tags":["public-api","models-v1"],"summary":"List Models","description":"Return chat-capable models grouped by provider.\n\nShape mirrors the FE-shaped ``/api/chat/models`` for parity, but\nevery entry is a stable JSON envelope (no pre-fetched runtime\nstate, no in-flight cookies). Capability flags forward in two\nforms: fixed top-level keys for hot ones (vision / function-\ncalling / streaming / etc.) and a ``supports`` blob for the long\ntail so a new LiteLLM-reported capability shows up without a\nbackend release.","operationId":"list_models_models_get","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","additionalProperties":true}},"title":"Response List Models Models Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/tools":{"get":{"tags":["public-api","agent-v1"],"summary":"List Agent Tools","description":"Return every tool domain the agent may use for the caller's org.\n\nThe result is the union of:\n  * ``feature_key == \"\"`` domains (always-on; not gated)\n  * ``feature_key != \"\"`` domains where the org's resolved\n    entitlement for that key is truthy\n\nEach entry carries ``name``, ``feature_key``, ``description``,\n``context`` (app vs sales), and ``tool_count`` — enough for an\nSDK consumer to render a \"what can the agent do\" UI without a\nsecond call.","operationId":"list_agent_tools_agent_tools_get","parameters":[{"name":"X-Organization-ID","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Organization-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Agent Tools Agent Tools Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"tags":["public-api"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}}}}},"components":{"schemas":{"AddressedIn":{"properties":{"section_id":{"type":"string","format":"uuid","title":"Section Id"},"address":{"type":"string","title":"Address"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"review_state":{"type":"string","title":"Review State"},"role":{"type":"string","title":"Role"},"seeded_from_revision_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seeded From Revision Id"}},"type":"object","required":["section_id","address","review_state","role"],"title":"AddressedIn"},"AnswerFileResponse":{"properties":{"id":{"type":"string","title":"Id"},"filename":{"type":"string","title":"Filename"},"scope":{"type":"string","title":"Scope"},"size_bytes":{"type":"integer","title":"Size Bytes"},"mime_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mime Type"},"char_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Char Count"},"extracted_text_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extracted Text Preview"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","filename","scope","size_bytes","mime_type","char_count","extracted_text_preview","created_at"],"title":"AnswerFileResponse"},"AnswerFileUrlResponse":{"properties":{"url":{"type":"string","title":"Url"},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds"}},"type":"object","required":["url","expires_in_seconds"],"title":"AnswerFileUrlResponse"},"AnswerSelectionBody":{"properties":{"item_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":500},{"type":"null"}],"title":"Item Ids","description":"Item row ids to answer. Null = the default set."},"steering":{"anyOf":[{"type":"string","maxLength":2500},{"type":"null"}],"title":"Steering","description":"One extra instruction applied to this pass only."},"include_human_flagged":{"type":"boolean","title":"Include Human Flagged","default":false}},"type":"object","title":"AnswerSelectionBody","description":"Shared body for plan + answer.\n\n``item_ids`` omitted/null → the default set (everything that needs\nwork). ``steering`` rides this pass only. ``include_human_flagged``\nopts human-routed questions into the default set — explicit ids\nalways win regardless."},"ApiKeyCreateRequest":{"properties":{"name":{"type":"string","maxLength":128,"title":"Name"},"scopes":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Scopes"},"is_test_mode":{"type":"boolean","title":"Is Test Mode","default":false},"workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"},"expires_in_days":{"anyOf":[{"type":"integer","maximum":730.0,"minimum":1.0},{"type":"null"}],"title":"Expires In Days"}},"type":"object","required":["name","scopes"],"title":"ApiKeyCreateRequest","description":"Inputs to ``POST /api/v1/account/api-keys``.\n\n``expires_in_days`` is the user-supplied TTL, clamped to the\nSafetyLimit floor; an explicit ``None`` means \"never expires\".\n``workspace_id`` pins the key to a single workspace; ``None`` means\nthe key spans every workspace in the org."},"ApiKeyCreated":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"last_four":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Four"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"is_active":{"type":"boolean","title":"Is Active"},"is_test_mode":{"type":"boolean","title":"Is Test Mode"},"workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"secret":{"type":"string","title":"Secret"}},"type":"object","required":["id","name","prefix","last_four","scopes","is_active","is_test_mode","workspace_id","expires_at","created_at","last_used_at","revoked_at","secret"],"title":"ApiKeyCreated","description":"Reveal-once create / rotate response. ``secret`` is the only\nfield that exists here and not on :class:`ApiKeyOut`."},"ApiKeyOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"last_four":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Four"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"is_active":{"type":"boolean","title":"Is Active"},"is_test_mode":{"type":"boolean","title":"Is Test Mode"},"workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","name","prefix","last_four","scopes","is_active","is_test_mode","workspace_id","expires_at","created_at","last_used_at","revoked_at"],"title":"ApiKeyOut","description":"Public read shape — never carries the plaintext ``secret``."},"AskResponse":{"properties":{"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"user_message":{"$ref":"#/components/schemas/ChatMessage"},"assistant_message":{"anyOf":[{"$ref":"#/components/schemas/ChatMessage"},{"type":"null"}]},"terminal":{"type":"string","title":"Terminal"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["chat_id","user_message","terminal"],"title":"AskResponse","description":"Response shape for the one-shot ``/messages/ask`` route."},"AuthorRequirementsBody":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AuthoredRequirement"},"type":"array","maxItems":500,"minItems":1,"title":"Items"}},"type":"object","required":["items"],"title":"AuthorRequirementsBody"},"AuthoredRequirement":{"properties":{"prompt":{"type":"string","maxLength":8000,"minLength":1,"title":"Prompt"},"kind":{"type":"string","pattern":"^(section|question|obligation|deliverable|attestation|instruction|evaluation)$","title":"Kind","default":"question"},"level":{"anyOf":[{"type":"string","pattern":"^(mandatory|desirable|optional|informational)$"},{"type":"null"}],"title":"Level"},"subkind":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Subkind"},"topics":{"items":{"type":"string"},"type":"array","maxItems":4,"title":"Topics"},"key":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Key"},"label":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Label"},"parent_key":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Parent Key"},"depends_on":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Depends On"},"requires_human":{"type":"boolean","title":"Requires Human","default":false}},"additionalProperties":false,"type":"object","required":["prompt"],"title":"AuthoredRequirement","description":"One authored node. ``key`` optional — autogenerated when absent."},"Body_add_file_brief_rfp_proposals__proposal_id__briefs_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"kind":{"type":"string","title":"Kind","default":"addendum"},"include_in_extraction":{"type":"boolean","title":"Include In Extraction","default":true},"effective_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective At"},"supersedes_brief_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Supersedes Brief Id"}},"type":"object","required":["file"],"title":"Body_add_file_brief_rfp_proposals__proposal_id__briefs_post"},"Body_upload_document_documents_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"category_ids":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category Ids"},"kind":{"anyOf":[{"type":"string","enum":["kb","guideline"]},{"type":"null"}],"title":"Kind","description":"Document role override. When omitted, the document inherits the parent workspace's kind (data → kb, guideline → guideline) — the legacy implicit behaviour preserved for every existing caller. The KB pane upload defaults the kind via the workspace; the Guidelines pane upload routes through ``X-Workspace-ID`` to the guideline workspace and the kind seeds from there."},"visible_in_workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Visible In Workspace Id","description":"Per-workspace visibility scope for guideline documents (mig 123). NULL (default) = org-wide visibility (today's behavior, preserved). Set to a data workspace id = the guideline is only visible from that workspace's wizard / Guidelines tab. Meaningful only for guideline-kind uploads; the service layer rejects this field on KB-kind uploads with a 400, mirroring the DB-level CHECK."}},"type":"object","required":["file"],"title":"Body_upload_document_documents_upload_post"},"Body_upload_file_to_answer_rfp_versions__version_id__answers__answer_id__files_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"scope":{"type":"string","const":"ephemeral","title":"Scope","default":"ephemeral"}},"type":"object","required":["file"],"title":"Body_upload_file_to_answer_rfp_versions__version_id__answers__answer_id__files_post"},"Body_upload_file_to_version_rfp_versions__version_id__files_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"scope":{"type":"string","const":"ephemeral","title":"Scope","default":"ephemeral"}},"type":"object","required":["file"],"title":"Body_upload_file_to_version_rfp_versions__version_id__files_post"},"Body_upload_rfp_proposal_rfp_proposals_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"skip_validation":{"type":"boolean","title":"Skip Validation","default":false}},"type":"object","required":["file"],"title":"Body_upload_rfp_proposal_rfp_proposals_upload_post"},"CategoryCreate":{"properties":{"name":{"type":"string","maxLength":100,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"applies_to":{"type":"string","enum":["kb","guideline","any"],"title":"Applies To","description":"Role-affinity: 'kb' tags only knowledge-base documents, 'guideline' tags only guideline documents, 'any' tags either.","default":"any"},"is_meta":{"type":"boolean","title":"Is Meta","description":"When True the RFP wizard surfaces this category as a bulk-toggle chip above its matching-kind doc grid.","default":false},"make_global":{"type":"boolean","title":"Make Global","description":"When True the category is visible from every workspace in the organization (workspace_id NULL); otherwise scoped to the caller's current workspace.","default":false}},"type":"object","required":["name"],"title":"CategoryCreate"},"CategoryUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Description"},"applies_to":{"anyOf":[{"type":"string","enum":["kb","guideline","any"]},{"type":"null"}],"title":"Applies To"},"is_meta":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Meta"}},"type":"object","title":"CategoryUpdate"},"ChatCreateRequest":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Title"}},"type":"object","title":"ChatCreateRequest","description":"Body for ``POST /v1/chat``."},"ChatDeletedResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"deleted":{"type":"boolean","title":"Deleted","default":true}},"type":"object","required":["id"],"title":"ChatDeletedResponse"},"ChatDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"title":{"type":"string","title":"Title"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","title":"Messages"}},"type":"object","required":["id","title","created_at","updated_at","messages"],"title":"ChatDetail","description":"Response to ``GET /v1/chat/{id}``."},"ChatDiagnosticDeviation":{"properties":{"kind":{"type":"string","enum":["max_steps_hit","max_cost_hit","timeout_hit","agent_error","cancelled","tool_call_failed","no_assistant_message","assistant_content_empty"],"title":"Kind"},"severity":{"type":"string","enum":["error","warning","info"],"title":"Severity"},"message_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Message Id"},"details":{"type":"string","title":"Details"},"remediation_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remediation Hint"}},"type":"object","required":["kind","severity","details"],"title":"ChatDiagnosticDeviation","description":"One typed deviation from the canonical-success shape.\n\nErrors are typed values (closed Literal); SDK consumers branch\non ``kind`` without parsing strings. Severity is intrinsic to\nthe kind via :func:`_classify_chat_severity` — same kind, same\nseverity, no per-call discretion."},"ChatDiagnosticsResponse":{"properties":{"chat_id":{"type":"string","format":"uuid","title":"Chat Id"},"is_canonical_success":{"type":"boolean","title":"Is Canonical Success"},"summary":{"$ref":"#/components/schemas/ChatDiagnosticsSummary"},"deviations":{"items":{"$ref":"#/components/schemas/ChatDiagnosticDeviation"},"type":"array","title":"Deviations"}},"type":"object","required":["chat_id","is_canonical_success","summary","deviations"],"title":"ChatDiagnosticsResponse","description":"Composite chat diagnostic — the single read every polling\nclient uses to verify the chat's most recent run actually\nsucceeded semantically."},"ChatDiagnosticsSummary":{"properties":{"total_messages":{"type":"integer","title":"Total Messages"},"assistant_messages":{"type":"integer","title":"Assistant Messages"},"last_run_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Run Status"},"last_run_duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Run Duration Ms"},"last_run_steps":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Run Steps"},"last_run_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Last Run Cost Usd"},"last_run_tool_calls":{"type":"integer","title":"Last Run Tool Calls","default":0},"last_run_failed_tool_calls":{"type":"integer","title":"Last Run Failed Tool Calls","default":0}},"type":"object","required":["total_messages","assistant_messages"],"title":"ChatDiagnosticsSummary","description":"Aggregate stats over the chat's recent agent runs."},"ChatListResponse":{"properties":{"chats":{"items":{"$ref":"#/components/schemas/ChatSummary"},"type":"array","title":"Chats"},"count":{"type":"integer","title":"Count"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["chats","count","limit","offset"],"title":"ChatListResponse","description":"Paginated chat listing."},"ChatMessage":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","role","content","created_at"],"title":"ChatMessage","description":"Canonical message shape for ``GET /v1/chat/{id}``.\n\nDrops UI-internal content_parts (action prompts, FE-runtime block\nkeys) — those live in ``message_metadata.content_parts`` for the\nUI but are not part of the customer contract. The customer sees\nrole + content + created_at; if they want richer payloads later,\nwe'll version the response shape rather than dribble UI fields in."},"ChatSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"title":{"type":"string","title":"Title"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","title","created_at","updated_at"],"title":"ChatSummary","description":"One row in the ``GET /v1/chat`` listing.\n\nNo message history — fetch ``GET /v1/chat/{id}`` for that. Stable\nshape across pagination so customer SDKs can render lists cheaply."},"CitedSource":{"properties":{"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"text_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Preview"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"type":"object","title":"CitedSource","description":"One row from ``Answer.cited_sources`` JSONB."},"CloneRequirementsBody":{"properties":{"source_proposal_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Source Proposal Id"},"source_set_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Source Set Id"}},"additionalProperties":false,"type":"object","title":"CloneRequirementsBody","description":"Where to copy a requirement set FROM.\n\n``source_proposal_id`` names a proposal in the caller's org; its\nACTIVE set is the one copied. Naming the proposal rather than the\nset is deliberate — \"start from last year's bid\" is the user's\nsentence, and the active set is what \"last year's bid\" currently\nmeans. Callers that need a specific historical ordinal pass\n``source_set_id`` instead; exactly one of the two is required."},"ComposeAcceptedOut":{"properties":{"mode":{"type":"string","enum":["compose","refine","expand","summarize"],"title":"Mode"},"requested":{"type":"integer","title":"Requested"},"total_to_compose":{"type":"integer","title":"Total To Compose"},"skipped":{"additionalProperties":{"type":"string"},"type":"object","title":"Skipped"},"estimated_credits":{"type":"integer","title":"Estimated Credits"},"items":{"items":{"$ref":"#/components/schemas/ComposePlanItemOut"},"type":"array","title":"Items"},"run_id":{"type":"string","format":"uuid","title":"Run Id"},"dispatched":{"type":"boolean","title":"Dispatched","default":true}},"type":"object","required":["mode","requested","total_to_compose","skipped","estimated_credits","items","run_id"],"title":"ComposeAcceptedOut"},"ComposeBody":{"properties":{"section_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":100,"minItems":1,"title":"Section Ids"},"mode":{"type":"string","enum":["compose","refine","expand","summarize"],"title":"Mode","default":"compose"},"steering":{"anyOf":[{"type":"string","maxLength":2500},{"type":"null"}],"title":"Steering"}},"additionalProperties":false,"type":"object","required":["section_ids"],"title":"ComposeBody","description":"One compose request — plan and dispatch share this shape, the same\ncontract the answering surface established (the quote and the act\nmust never diverge in what they describe)."},"ComposePlanItemOut":{"properties":{"section_id":{"type":"string","format":"uuid","title":"Section Id"},"address":{"type":"string","title":"Address"},"kind_hint":{"type":"string","title":"Kind Hint"}},"type":"object","required":["section_id","address","kind_hint"],"title":"ComposePlanItemOut"},"CoverageAnswer":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"type":"string","title":"Status"},"compliance":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Compliance"},"acknowledged":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Acknowledged"},"has_body":{"type":"boolean","title":"Has Body"},"provided":{"type":"boolean","title":"Provided"},"current_revision_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Revision Id"},"confidence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidence"}},"type":"object","required":["id","status","has_body","provided"],"title":"CoverageAnswer","description":"The matrix cell — absent entirely when no answer row exists."},"CoverageGates":{"properties":{"version_id":{"type":"string","format":"uuid","title":"Version Id"},"deliverable_shape":{"type":"string","enum":["document","questionnaire","combined"],"title":"Deliverable Shape"},"questionnaire":{"$ref":"#/components/schemas/QuestionnaireGate"},"document":{"$ref":"#/components/schemas/DocumentGate"},"submission":{"$ref":"#/components/schemas/SubmissionGate"},"blocking":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Blocking"},"warnings":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Warnings"}},"type":"object","required":["version_id","deliverable_shape","questionnaire","document","submission"],"title":"CoverageGates"},"CoverageRequirement":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"key":{"type":"string","title":"Key"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"text":{"type":"string","title":"Text"},"kind":{"type":"string","title":"Kind"},"level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level"},"subkind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subkind"},"topics":{"items":{"type":"string"},"type":"array","title":"Topics","default":[]},"weight":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight"},"page_budget":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Budget"},"route":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route"},"disposition":{"type":"string","title":"Disposition","default":"ai"},"requires_human":{"type":"boolean","title":"Requires Human","default":false},"skip_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Skip Reason"},"not_applicable":{"type":"boolean","title":"Not Applicable","default":false},"source_page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Source Page"},"parent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Id"},"depth":{"type":"integer","title":"Depth","default":0}},"type":"object","required":["id","key","text","kind"],"title":"CoverageRequirement"},"CoverageResponse":{"properties":{"version_id":{"type":"string","format":"uuid","title":"Version Id"},"requirement_set_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Requirement Set Id"},"rows":{"items":{"$ref":"#/components/schemas/CoverageRow"},"type":"array","title":"Rows"},"totals":{"$ref":"#/components/schemas/CoverageRollup"}},"type":"object","required":["version_id","rows","totals"],"title":"CoverageResponse"},"CoverageRollup":{"properties":{"total":{"type":"integer","title":"Total","default":0},"response":{"additionalProperties":{"type":"integer"},"type":"object","title":"Response"},"coverage":{"additionalProperties":{"type":"integer"},"type":"object","title":"Coverage"}},"type":"object","title":"CoverageRollup"},"CoverageRow":{"properties":{"requirement":{"$ref":"#/components/schemas/CoverageRequirement"},"answer":{"anyOf":[{"$ref":"#/components/schemas/CoverageAnswer"},{"type":"null"}]},"addressed_in":{"items":{"$ref":"#/components/schemas/AddressedIn"},"type":"array","title":"Addressed In"},"response_state":{"type":"string","enum":["none","auto","manual","flagged","human","exception"],"title":"Response State"},"coverage_state":{"type":"string","enum":["unaddressed","addressed","composed"],"title":"Coverage State"},"drift":{"type":"boolean","title":"Drift","default":false},"rollup":{"anyOf":[{"$ref":"#/components/schemas/CoverageRollup"},{"type":"null"}]}},"type":"object","required":["requirement","response_state","coverage_state"],"title":"CoverageRow"},"CoverageSearchResponse":{"properties":{"version_id":{"type":"string","format":"uuid","title":"Version Id"},"query":{"type":"string","title":"Query"},"rows":{"items":{"$ref":"#/components/schemas/CoverageRow"},"type":"array","title":"Rows"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["version_id","query","rows","total"],"title":"CoverageSearchResponse"},"CreateEndpointRequest":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"},"events_subscribed":{"items":{"type":"string"},"type":"array","minItems":1,"title":"Events Subscribed"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Description"}},"type":"object","required":["url","events_subscribed"],"title":"CreateEndpointRequest","description":"Body for ``POST /v1/webhooks``."},"CreateInvitationRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"role":{"type":"string","pattern":"^(owner|admin|member|viewer)$","title":"Role","default":"member"}},"type":"object","required":["email"],"title":"CreateInvitationRequest"},"CreateProposalBody":{"properties":{"name":{"type":"string","maxLength":500,"minLength":1,"title":"Name"},"solicitation_type":{"type":"string","pattern":"^(unspecified|rfp|rfq|rfi|ifb|rft|eoi|soq|ddq|security_questionnaire|supplier_onboarding|grant|task_order|framework_quote|renewal|unsolicited|pitch|oral_presentation|bafo|sole_source|capability_statement|services_proposal|change_order|insurance_rfp|construction_bid|p3|reverse_auction|prequalification|contract_response)$","title":"Solicitation Type","default":"unspecified"},"issuer":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Issuer"},"reference_number":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Reference Number"},"due_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due At"},"created_from_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created From Id"}},"type":"object","required":["name"],"title":"CreateProposalBody","description":"The minimum that makes a pursuit real, plus its optional identity.\n\nOnly ``name`` is required — everything else is metadata the user\nmay not know yet when the RFI lands, and none of it gates any\ndownstream machinery."},"CreateSectionBody":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Title"},"body":{"anyOf":[{"type":"string","maxLength":2000000},{"type":"null"}],"title":"Body"},"kind_hint":{"type":"string","enum":["prose","qa","file_slot","matrix","placeholder","register"],"title":"Kind Hint","default":"prose"},"title_visible":{"type":"boolean","title":"Title Visible","default":true},"role":{"anyOf":[{"type":"string","enum":["transmittal","exec_summary","understanding","approach","management","staffing","past_performance","transition","quality","price_narrative","exceptions_register","compliance_matrix","appendix"]},{"type":"null"}],"title":"Role"},"page_budget":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":1.0},{"type":"null"}],"title":"Page Budget"},"weight":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Weight"},"after_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"After Id"},"parent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Id"},"at_start":{"type":"boolean","title":"At Start","description":"With parent_id (or as a root): insert as the FIRST child instead of the last.","default":false}},"additionalProperties":false,"type":"object","title":"CreateSectionBody","description":"Insert one section. Exactly one placement: ``after_id`` (a new\nsibling right after that section) or ``parent_id`` (a new last child\nof that section). Both absent = a new last root."},"CreateVersionResponse":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","status"],"title":"CreateVersionResponse"},"CreditBalance":{"properties":{"balance":{"type":"integer","title":"Balance","description":"Total credit balance (sum of active lot remaining)"},"reserved":{"type":"integer","title":"Reserved","description":"Credits reserved for in-progress operations"},"available":{"type":"integer","title":"Available","description":"Credits available for use (balance - reserved)"},"lots":{"items":{"$ref":"#/components/schemas/CreditLotSummary"},"type":"array","title":"Lots","description":"Active lots by expiry order"},"next_plan_refill_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Plan Refill At","description":"When the soonest-expiring plan_cycle lot expires; the user's next 'refill date'"},"consumption_order":{"type":"string","title":"Consumption Order","description":"Documented order of lot consumption (informational)","default":"soonest expiry first"}},"type":"object","required":["balance","reserved","available"],"title":"CreditBalance","description":"Credit balance + per-lot breakdown.\n\n``balance`` and ``reserved`` are denormalized cache values from the org\nrow. ``lots`` is the authoritative breakdown drawn directly from the\n``credit_lots`` ledger; consumption walks lots in\n``expires_at ASC NULLS LAST`` order so subscription credits are spent\nbefore purchased credits before never-expiring grants."},"CreditLotSummary":{"properties":{"id":{"type":"string","title":"Id"},"source":{"type":"string","title":"Source","description":"signup | plan_cycle | plan_rollover | purchase | bonus | adjustment"},"amount":{"type":"integer","title":"Amount","description":"Remaining credits in this lot"},"amount_initial":{"type":"integer","title":"Amount Initial","description":"Credits originally granted to this lot"},"granted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Granted At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"NULL means never expires"},"source_tier_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Tier Key"}},"type":"object","required":["id","source","amount","amount_initial"],"title":"CreditLotSummary","description":"One active credit lot rendered for the API."},"CreditTransaction":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"amount":{"type":"integer","title":"Amount","description":"Positive = added, negative = consumed"},"balance_after":{"type":"integer","title":"Balance After"},"transaction_type":{"type":"string","title":"Transaction Type"},"operation_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operation Key"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","amount","balance_after","transaction_type","created_at"],"title":"CreditTransaction","description":"Credit transaction record."},"DiagnosticDeviation":{"properties":{"kind":{"type":"string","enum":["retrieval_failed","no_citations_on_complete","item_error","item_no_answer_found","answer_run_failed","gate_fail_open","orphaned_item","confidence_none_on_complete","route_fallback_rate_high","routed_item_reassigned"],"title":"Kind"},"severity":{"type":"string","enum":["error","warning","info"],"title":"Severity"},"answer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Answer Id"},"requirement_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requirement Key"},"details":{"type":"string","title":"Details"},"remediation_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remediation Hint"}},"type":"object","required":["kind","severity","details"],"title":"DiagnosticDeviation","description":"One deviation from the canonical-success shape.\n\nErrors are typed (``kind`` is a closed Literal) so SDK consumers\ncan branch on the code without parsing strings. ``severity`` is\nadvisory; ``details`` is human-readable; ``remediation_hint`` is\nthe closest the route gets to telling the customer what to do."},"DiagnosticsResponse":{"properties":{"version_id":{"type":"string","format":"uuid","title":"Version Id"},"version_run_status":{"type":"string","title":"Version Run Status"},"is_terminal":{"type":"boolean","title":"Is Terminal"},"is_canonical_success":{"type":"boolean","title":"Is Canonical Success"},"summary":{"$ref":"#/components/schemas/DiagnosticsSummary"},"deviations":{"items":{"$ref":"#/components/schemas/DiagnosticDeviation"},"type":"array","title":"Deviations"}},"type":"object","required":["version_id","version_run_status","is_terminal","is_canonical_success","summary","deviations"],"title":"DiagnosticsResponse","description":"Composite generation diagnostic — the single read every\ncustomer / FE / SDK polls during a generation to verify it's\nprogressing correctly."},"DiagnosticsSummary":{"properties":{"total_items":{"type":"integer","title":"Total Items"},"items_by_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"Items By Status"},"items_with_citations":{"type":"integer","title":"Items With Citations"},"items_with_failed_retrieval":{"type":"integer","title":"Items With Failed Retrieval"},"items_with_no_confidence":{"type":"integer","title":"Items With No Confidence"},"gate_verdicts_count":{"type":"integer","title":"Gate Verdicts Count"},"gate_fail_open_count":{"type":"integer","title":"Gate Fail Open Count"},"items_by_route":{"additionalProperties":{"type":"integer"},"type":"object","title":"Items By Route","default":{}},"route_fallback_count":{"type":"integer","title":"Route Fallback Count","default":0},"items_routed_to_human":{"type":"integer","title":"Items Routed To Human","default":0},"pinned_guideline_document_ids":{"items":{"type":"string"},"type":"array","title":"Pinned Guideline Document Ids","default":[]},"pinned_category_ids":{"items":{"type":"string"},"type":"array","title":"Pinned Category Ids","default":[]}},"type":"object","required":["total_items","items_by_status","items_with_citations","items_with_failed_retrieval","items_with_no_confidence","gate_verdicts_count","gate_fail_open_count"],"title":"DiagnosticsSummary","description":"Aggregate counts for a generation's items + verdicts."},"DocumentContentRequest":{"properties":{"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"DocumentContentRequest"},"DocumentDiagnosticDeviation":{"properties":{"kind":{"type":"string","enum":["processing_stuck","processing_failed","extracted_text_empty","token_amount_missing","last_processed_event_id_null"],"title":"Kind"},"severity":{"type":"string","enum":["error","warning","info"],"title":"Severity"},"details":{"type":"string","title":"Details"},"remediation_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Remediation Hint"}},"type":"object","required":["kind","severity","details"],"title":"DocumentDiagnosticDeviation"},"DocumentDiagnosticsResponse":{"properties":{"document_id":{"type":"string","format":"uuid","title":"Document Id"},"is_canonical_success":{"type":"boolean","title":"Is Canonical Success"},"summary":{"$ref":"#/components/schemas/DocumentDiagnosticsSummary"},"deviations":{"items":{"$ref":"#/components/schemas/DocumentDiagnosticDeviation"},"type":"array","title":"Deviations"}},"type":"object","required":["document_id","is_canonical_success","summary"],"title":"DocumentDiagnosticsResponse"},"DocumentDiagnosticsSummary":{"properties":{"processing_status":{"type":"string","title":"Processing Status"},"processing_completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Processing Completed At"},"extracted_char_count":{"type":"integer","title":"Extracted Char Count","default":0},"token_amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Token Amount"},"last_processed_event_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Last Processed Event Id"},"file_size_bytes":{"type":"integer","title":"File Size Bytes","default":0},"age_seconds":{"type":"integer","title":"Age Seconds","default":0},"seconds_since_terminal":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seconds Since Terminal"}},"type":"object","required":["processing_status"],"title":"DocumentDiagnosticsSummary"},"DocumentGate":{"properties":{"mandatory_unaddressed":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Mandatory Unaddressed"}},"type":"object","title":"DocumentGate"},"DocumentTextUploadRequest":{"properties":{"filename":{"type":"string","maxLength":250,"title":"Filename"},"content":{"type":"string","title":"Content"},"category_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array"},{"type":"null"}],"title":"Category Ids"}},"type":"object","required":["filename","content"],"title":"DocumentTextUploadRequest","description":"JSON body for ``POST /upload-text`` — the raw-markdown / plaintext\nsibling of the multipart ``POST /upload`` route.\n\nBoth routes funnel into :meth:`DocumentService.upload_document`; the\nonly difference is how the bytes arrive (multipart file part vs.\nJSON string). Keeping a single service chokepoint is what lets the\ndedup + storage-cap + credit-commit invariants stay single-sourced."},"EntitlementsResponse":{"properties":{"tier":{"type":"string","title":"Tier"},"tier_name":{"type":"string","title":"Tier Name"},"status":{"$ref":"#/components/schemas/SubscriptionStatus"},"features":{"additionalProperties":{"$ref":"#/components/schemas/FeatureValue"},"type":"object","title":"Features"},"limits":{"additionalProperties":{"$ref":"#/components/schemas/FeatureValue"},"type":"object","title":"Limits"},"credits":{"$ref":"#/components/schemas/CreditBalance"}},"type":"object","required":["tier","tier_name","status","credits"],"title":"EntitlementsResponse","description":"Complete entitlements for an organization."},"ExportUrlResponse":{"properties":{"url":{"type":"string","title":"Url"},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds"}},"type":"object","required":["url","expires_in_seconds"],"title":"ExportUrlResponse"},"ExtractionTreeNode":{"properties":{"answer_id":{"type":"string","format":"uuid","title":"Answer Id"},"requirement_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requirement Key"},"position":{"type":"integer","title":"Position"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"confidence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confidence"},"conditional_rule":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conditional Rule"},"route":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route"},"route_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Route Source"},"depends_on":{"items":{"type":"string"},"type":"array","title":"Depends On"},"children":{"items":{"$ref":"#/components/schemas/ExtractionTreeNode"},"type":"array","title":"Children"}},"type":"object","required":["answer_id","position"],"title":"ExtractionTreeNode","description":"One node in the reconstructed extraction tree.\n\nOrdering: children appear in increasing ``position`` so the\ntree renders in source order. ``depends_on`` lists ext_ids of\nOTHER nodes in the tree this node depends on (the cross-edges\nthat aren't strict parent/child)."},"ExtractionTreeResponse":{"properties":{"version_id":{"type":"string","format":"uuid","title":"Version Id"},"nodes":{"items":{"$ref":"#/components/schemas/ExtractionTreeNode"},"type":"array","title":"Nodes"},"orphans":{"items":{"$ref":"#/components/schemas/ExtractionTreeNode"},"type":"array","title":"Orphans"}},"type":"object","required":["version_id","nodes"],"title":"ExtractionTreeResponse"},"FeatureValue":{"properties":{"value":{"title":"Value"},"source":{"type":"string","title":"Source","description":"tier, override, or default"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},"type":"object","required":["value","source","name"],"title":"FeatureValue","description":"Feature value with metadata."},"FinalizeRequest":{"properties":{"formats":{"items":{"type":"string","enum":["pdf","docx"]},"type":"array","minItems":1,"title":"Formats","description":"pdf, docx, or both","default":["pdf"]}},"additionalProperties":false,"type":"object","title":"FinalizeRequest","description":"Render the RFP response to one or more file formats.\n\nThe render engine is configured in the admin UI\n(``proposals.finalize.render_engine``) and resolved server-side; the client\ncannot pick it.\n\nStrict schema: unknown keys raise 422 so a typo\n(``output_formats`` vs ``formats``) fails at the trust edge instead\nof silently falling back to the default and rendering only PDF when\nthe caller asked for both."},"FinalizeResponse":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","status"],"title":"FinalizeResponse"},"GateVerdictRow":{"properties":{"answer_id":{"type":"string","format":"uuid","title":"Answer Id"},"kind":{"type":"string","title":"Kind"},"sufficient":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sufficient"},"failed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Failed"},"evaluated_to":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Evaluated To"},"predicate":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Predicate"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"parent_ext_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Ext Id"},"child_ext_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Child Ext Id"},"parent_answer_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Answer Id"},"decided_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decided At"}},"type":"object","required":["answer_id","kind"],"title":"GateVerdictRow","description":"One persisted gate verdict, derived from a status_event row."},"GateVerdictsResponse":{"properties":{"version_id":{"type":"string","format":"uuid","title":"Version Id"},"verdicts":{"items":{"$ref":"#/components/schemas/GateVerdictRow"},"type":"array","title":"Verdicts"}},"type":"object","required":["version_id","verdicts"],"title":"GateVerdictsResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InjectBody":{"properties":{"requirement_id":{"type":"string","format":"uuid","title":"Requirement Id"}},"additionalProperties":false,"type":"object","required":["requirement_id"],"title":"InjectBody"},"InvitationDeletedResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"deleted":{"type":"boolean","title":"Deleted","default":true}},"type":"object","required":["id"],"title":"InvitationDeletedResponse"},"InvitationPublic":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"role":{"type":"string","title":"Role"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Accepted At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","role","expires_at","created_at"],"title":"InvitationPublic"},"InvoiceInfo":{"properties":{"id":{"type":"string","title":"Id"},"number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Number"},"status":{"type":"string","title":"Status"},"amount_due":{"type":"integer","title":"Amount Due","description":"Amount in cents"},"amount_paid":{"type":"integer","title":"Amount Paid","description":"Amount paid in cents"},"currency":{"type":"string","title":"Currency","default":"usd"},"created":{"type":"string","format":"date-time","title":"Created"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid At"},"invoice_pdf":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Pdf","description":"URL to download PDF"},"hosted_invoice_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hosted Invoice Url","description":"URL to view invoice"}},"type":"object","required":["id","status","amount_due","amount_paid","created"],"title":"InvoiceInfo","description":"Invoice information."},"ItemChatRequest":{"properties":{"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message"},"intent":{"anyOf":[{"type":"string","enum":["rewrite","regenerate","clarify","escalate_human","mark_complete"]},{"type":"null"}],"title":"Intent","description":"Override auto-classified action. One of: rewrite (no KB), regenerate (fresh KB retrieval), clarify (read-only Q&A), escalate_human (mark for review), mark_complete (accept current answer). When omitted, the service classifies the action from the message."},"request_research":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Request Research","description":"Force-enable KB retrieval on regenerate"},"attachment_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Attachment Ids"},"kb_document_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Kb Document Ids"},"guideline_document_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Guideline Document Ids"}},"type":"object","required":["message"],"title":"ItemChatRequest"},"ItemResponse":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"revision":{"type":"integer","title":"Revision"},"current_revision_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Revision Id"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"}},"type":"object","required":["id","status","revision"],"title":"ItemResponse","description":"Post-mutation item state, sufficient to patch the client's row.\n\n``body`` is on the wire because the two pointer-moving\nroutes (``activate_revision``, ``import_answer``) change the answer\nBODY without changing status. Their SSE events carry it, but the\nstream is only open for a live generation (``useResponse`` opens it\nfor queued/running/finalizing only) — and version switching is\nsomething users do on FINISHED generations, where no subscriber\nexists. Returning the body makes the response self-sufficient: the\ncaller patches its row from the authoritative server copy instead\nof depending on an event nobody is listening for."},"LLMUsageRow":{"properties":{"operation_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operation Type"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Input Tokens"},"output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Output Tokens"},"total_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Tokens"},"cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Usd"}},"type":"object","title":"LLMUsageRow","description":"One ``llm_usage_logs`` row — token / cost breakdown for an\nLLM call attributed to the per-item ``resource_id``."},"LinkBody":{"properties":{"requirement_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":500,"minItems":1,"title":"Requirement Ids"},"role":{"type":"string","enum":["addresses","references"],"title":"Role","default":"addresses"}},"additionalProperties":false,"type":"object","required":["requirement_ids"],"title":"LinkBody"},"LinkedRequirement":{"properties":{"requirement_id":{"type":"string","format":"uuid","title":"Requirement Id"},"key":{"type":"string","title":"Key"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"kind":{"type":"string","title":"Kind"},"level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level"},"role":{"type":"string","enum":["addresses","references"],"title":"Role"},"seeded_from_revision_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seeded From Revision Id"}},"type":"object","required":["requirement_id","key","label","kind","level","role","seeded_from_revision_id"],"title":"LinkedRequirement"},"MeResponse":{"properties":{"organization":{"$ref":"#/components/schemas/_OrgBlock"},"api_key":{"anyOf":[{"$ref":"#/components/schemas/_ApiKeyBlock"},{"type":"null"}]},"user":{"anyOf":[{"$ref":"#/components/schemas/_UserBlock"},{"type":"null"}]}},"type":"object","required":["organization"],"title":"MeResponse","description":"Self-introspection envelope.\n\n``api_key`` is populated only for API-key auth. ``user`` is\npopulated whenever a user resolved (true on every JWT call, true on\nAPI-key calls bound to a user — most are; bot keys may not be)."},"MemberDeletedResponse":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"},"deleted":{"type":"boolean","title":"Deleted","default":true}},"type":"object","required":["user_id"],"title":"MemberDeletedResponse"},"MemberPublic":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"user_id":{"type":"string","format":"uuid","title":"User Id"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"role":{"type":"string","title":"Role"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","user_id","role","created_at"],"title":"MemberPublic"},"MemberRoleUpdateRequest":{"properties":{"role":{"type":"string","pattern":"^(owner|admin|member|viewer)$","title":"Role"}},"type":"object","required":["role"],"title":"MemberRoleUpdateRequest"},"MergeBody":{"properties":{"section_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":500,"minItems":2,"title":"Section Ids"}},"additionalProperties":false,"type":"object","required":["section_ids"],"title":"MergeBody","description":"Merge ``section_ids`` (document order) into the first one."},"MoveBody":{"properties":{"parent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Id"},"after_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"After Id"}},"additionalProperties":false,"type":"object","title":"MoveBody","description":"Re-parent and/or reorder. ``parent_id=None`` moves to the roots.\n``after_id=None`` means first among the new siblings."},"MutationResult":{"properties":{"section_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Section Ids"},"tree":{"$ref":"#/components/schemas/SectionTreeResponse"}},"type":"object","required":["section_ids","tree"],"title":"MutationResult","description":"What every mutation returns: the touched ids plus the fresh tree,\nso the client never has to reconcile two representations."},"OrgPublic":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"subscription_status":{"type":"string","title":"Subscription Status"},"member_count":{"type":"integer","title":"Member Count"},"document_count":{"type":"integer","title":"Document Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","name","slug","subscription_tier","subscription_status","member_count","document_count","created_at"],"title":"OrgPublic","description":"Customer-facing organization shape. Drops the resolved\n``features`` dict (mig 089 dropped the column; tier features\nresolve via FeatureService and aren't part of the public envelope)\nand drops domain-settings (sensitive auto-join machinery; admin\nsurface only)."},"OrgUpdateRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"billing_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Billing Email"},"settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Settings"}},"type":"object","title":"OrgUpdateRequest"},"ProjectBody":{"properties":{"requirement_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":5000},{"type":"null"}],"title":"Requirement Ids"},"parent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Id"}},"additionalProperties":false,"type":"object","title":"ProjectBody","description":"One section per requirement. ``requirement_ids=None`` = the whole\nactive set; ``parent_id`` places the projection under a section\n(default: at the roots, after existing roots)."},"QuestionnaireGate":{"properties":{"answered":{"type":"integer","title":"Answered"},"total":{"type":"integer","title":"Total"},"blocking":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Blocking"}},"type":"object","required":["answered","total"],"title":"QuestionnaireGate"},"RetrievalDetailsResponse":{"properties":{"answer_id":{"type":"string","format":"uuid","title":"Answer Id"},"version_id":{"type":"string","format":"uuid","title":"Version Id"},"requirement_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requirement Key"},"retrieval_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Retrieval Status"},"retrieval_method_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Retrieval Method Used"},"retrieval_sub_methods":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Retrieval Sub Methods"},"retrieval_cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Retrieval Cost Usd"},"retrieval_duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retrieval Duration Ms"},"cited_sources":{"items":{"$ref":"#/components/schemas/CitedSource"},"type":"array","title":"Cited Sources"},"llm_calls":{"items":{"$ref":"#/components/schemas/LLMUsageRow"},"type":"array","title":"Llm Calls"}},"type":"object","required":["answer_id","version_id"],"title":"RetrievalDetailsResponse","description":"Response for the per-item retrieval-details route."},"ScopeCatalogEntry":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"description":{"type":"string","title":"Description"},"group":{"type":"string","title":"Group"}},"type":"object","required":["key","label","description","group"],"title":"ScopeCatalogEntry","description":"One entry in the public scope catalog. The frontend's create\ndialog renders these as checkboxes; the docs site lists them in the\nAuthentication article."},"SectionNodeOut":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"parent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Parent Id"},"position":{"type":"integer","title":"Position"},"depth":{"type":"integer","title":"Depth"},"number":{"type":"string","title":"Number"},"address":{"type":"string","title":"Address"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"title_visible":{"type":"boolean","title":"Title Visible"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"kind_hint":{"type":"string","enum":["prose","qa","file_slot","matrix","placeholder","register"],"title":"Kind Hint"},"review_state":{"type":"string","enum":["draft","reviewed","approved"],"title":"Review State"},"role":{"anyOf":[{"type":"string","enum":["transmittal","exec_summary","understanding","approach","management","staffing","past_performance","transition","quality","price_narrative","exceptions_register","compliance_matrix","appendix"]},{"type":"null"}],"title":"Role"},"page_budget":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Budget"},"weight":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight"},"current_revision_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current Revision Id"},"revision_count":{"type":"integer","title":"Revision Count"},"links":{"items":{"$ref":"#/components/schemas/LinkedRequirement"},"type":"array","title":"Links"},"sources":{"items":{"$ref":"#/components/schemas/SectionSourceOut"},"type":"array","title":"Sources"},"children":{"items":{"$ref":"#/components/schemas/SectionNodeOut"},"type":"array","title":"Children"}},"type":"object","required":["id","parent_id","position","depth","number","address","title","title_visible","body","kind_hint","review_state","current_revision_id","revision_count","links"],"title":"SectionNodeOut","description":"One node of the tree as the outline, the exporter, and Arthur see it."},"SectionSourceOut":{"properties":{"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"filename":{"type":"string","title":"Filename"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["document_id","filename","count"],"title":"SectionSourceOut","description":"One source document a section's current revision cites — the\nsources-beside-the-text rail (D2). Grouped per document."},"SectionTreeResponse":{"properties":{"version_id":{"type":"string","format":"uuid","title":"Version Id"},"numbering_mode":{"type":"string","enum":["auto","rfp_native","none"],"title":"Numbering Mode"},"total":{"type":"integer","title":"Total"},"roots":{"items":{"$ref":"#/components/schemas/SectionNodeOut"},"type":"array","title":"Roots"}},"type":"object","required":["version_id","numbering_mode","total","roots"],"title":"SectionTreeResponse"},"SendMessageRequest":{"properties":{"content":{"type":"string","maxLength":32000,"minLength":1,"title":"Content"},"features":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Features"},"max_steps":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":1.0},{"type":"null"}],"title":"Max Steps","default":15}},"type":"object","required":["content"],"title":"SendMessageRequest","description":"Body for ``POST /v1/chat/{id}/messages`` (streaming) and\n``POST /v1/chat/{id}/messages/ask`` (one-shot).\n\nModel selection is slot-driven (``model.agent``) — the customer\ndoes not pick a model. Tool features intersect with org\nentitlements server-side; an empty list means \"every tool the\norg's tier permits.\""},"SplitBody":{"properties":{"at_char":{"type":"integer","maximum":2000000.0,"minimum":1.0,"title":"At Char"},"new_title":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"New Title"}},"additionalProperties":false,"type":"object","required":["at_char"],"title":"SplitBody"},"SubmissionGate":{"properties":{"instructions_unacknowledged":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Instructions Unacknowledged"}},"type":"object","title":"SubmissionGate"},"SubscriptionInfo":{"properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Id","description":"Stripe subscription ID"},"status":{"$ref":"#/components/schemas/SubscriptionStatus"},"tier":{"type":"string","title":"Tier","description":"Current tier key"},"tier_name":{"type":"string","title":"Tier Name","description":"Human-readable tier name"},"current_period_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period Start"},"current_period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Current Period End"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End","default":false},"cancel_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Cancel At"},"price_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price Id"},"amount":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount","description":"Price in cents"},"currency":{"type":"string","title":"Currency","default":"usd"},"interval":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Interval","description":"Billing interval"}},"type":"object","required":["status","tier","tier_name"],"title":"SubscriptionInfo","description":"Current subscription information."},"SubscriptionStatus":{"type":"string","enum":["active","past_due","canceled","canceling","paused","unpaid","incomplete","suspended"],"title":"SubscriptionStatus","description":"Subscription status states.\n\nBacked by the Postgres ENUM ``subscription_status_enum`` (mig 094).\n\nFreemium-only product: no TRIALING state. Free-tier orgs are always\n``active`` with no Stripe subscription. Paid subscriptions transition\nthrough ``past_due`` → ``grace_period`` (FSM in\n``organization_dunning_states``) → ``suspended`` on payment failures,\nnever through a trial."},"TaskListResponse":{"properties":{"tasks":{"items":{"$ref":"#/components/schemas/TaskRow"},"type":"array","title":"Tasks"},"total_open":{"type":"integer","title":"Total Open"}},"type":"object","required":["tasks","total_open"],"title":"TaskListResponse"},"TaskRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"kind":{"type":"string","title":"Kind"},"scope":{"type":"string","title":"Scope"},"priority":{"type":"string","title":"Priority"},"status":{"type":"string","title":"Status"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"action_payload":{"additionalProperties":true,"type":"object","title":"Action Payload"},"workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"},"source_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Kind"},"source_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Id"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"dismissed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dismissed At"}},"type":"object","required":["id","kind","scope","priority","status","title","action_payload","created_at"],"title":"TaskRow"},"UpdateSectionBody":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Title"},"clear_title":{"type":"boolean","title":"Clear Title","default":false},"body":{"anyOf":[{"type":"string","maxLength":2000000},{"type":"null"}],"title":"Body"},"clear_body":{"type":"boolean","title":"Clear Body","default":false},"title_visible":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Title Visible"},"kind_hint":{"anyOf":[{"type":"string","enum":["prose","qa","file_slot","matrix","placeholder","register"]},{"type":"null"}],"title":"Kind Hint"},"review_state":{"anyOf":[{"type":"string","enum":["draft","reviewed","approved"]},{"type":"null"}],"title":"Review State"},"role":{"anyOf":[{"type":"string","enum":["transmittal","exec_summary","understanding","approach","management","staffing","past_performance","transition","quality","price_narrative","exceptions_register","compliance_matrix","appendix"]},{"type":"null"}],"title":"Role"},"clear_role":{"type":"boolean","title":"Clear Role","default":false},"page_budget":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":1.0},{"type":"null"}],"title":"Page Budget"},"clear_page_budget":{"type":"boolean","title":"Clear Page Budget","default":false},"weight":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Weight"},"clear_weight":{"type":"boolean","title":"Clear Weight","default":false}},"additionalProperties":false,"type":"object","title":"UpdateSectionBody","description":"Partial update — absent means unchanged. ``title=None`` explicitly\nclears the title (a section may be body-only)."},"UsageSummary":{"properties":{"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"total_consumed":{"type":"integer","title":"Total Consumed"},"total_added":{"type":"integer","title":"Total Added"},"by_operation":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Operation"},"current_balance":{"type":"integer","title":"Current Balance"},"reserved":{"type":"integer","title":"Reserved"},"transaction_count":{"type":"integer","title":"Transaction Count"}},"type":"object","required":["period_start","period_end","total_consumed","total_added","current_balance","reserved","transaction_count"],"title":"UsageSummary","description":"Usage summary for a period."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VersionCreateRequest":{"properties":{"guideline_document_ids":{"items":{"type":"string"},"type":"array","title":"Guideline Document Ids","description":"Document IDs of guideline-kind documents to inject as style/tone context into generation. Order is preserved — the first ID's extracted text comes first in the concatenated prompt. Validation: each must be ``Document.kind == 'guideline'``, owned by the tenant, and have ``token_amount`` populated (DC indexing complete)."},"current_rfp_document_ids":{"items":{"type":"string"},"type":"array","title":"Current Rfp Document Ids","description":"List of current RFP document IDs containing questions to answer."},"raw_text":{"anyOf":[{"type":"string","maxLength":10000000},{"type":"null"}],"title":"Raw Text","description":"Current RFP raw text content with questions to answer."},"ephemeral_guideline":{"anyOf":[{"type":"string","maxLength":2500},{"type":"null"}],"title":"Ephemeral Guideline","description":"One last guideline for this run only — the ephemeral companion to the picked library guidelines. Max 500 words / 2500 chars. For anything longer or reusable, save it as a guideline document and select it via ``guideline_document_ids``."},"output_formats":{"items":{"type":"string","enum":["pdf","docx","text"]},"type":"array","maxItems":8,"title":"Output Formats","description":"Desired output formats. Bounded so a buggy client cannot drive thousands of downstream renders or pass an arbitrary string into the renderer dispatch.","default":["text"]},"proposal_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Proposal Id","description":"ID of the RFP proposal this generation is for."},"created_mode":{"type":"string","enum":["full_pass","blank","from_version","projection"],"title":"Created Mode","description":"How this working copy is born. 'full_pass' runs the answering worker over every answerable requirement. 'blank' mints the version with its answer rows in place (born by route, exactly as a full pass would) but dispatches nothing and charges nothing — the bottom-up doorway. 'from_version' is blank plus a copy of another version's answers (bodies land as 'import' revisions; requires source_version_id). 'projection' is blank plus one document section per requirement — the questionnaire projection. 'blank', 'from_version' and 'projection' require a proposal_id with a completed requirement set.","default":"full_pass"},"source_version_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Version Id","description":"For created_mode='from_version': the sibling version whose answers are copied. Must belong to the same proposal."},"deliverable_shape":{"type":"string","enum":["document","questionnaire","combined"],"title":"Deliverable Shape","description":"What the buyer gets: a walk of the section tree, a walk of the requirement tree with its answers (DDQ / questionnaire), or both with the coverage matrix as an appendix.","default":"document"},"numbering_mode":{"type":"string","enum":["auto","rfp_native","none"],"title":"Numbering Mode","description":"A rendering choice: number sections from tree position, reuse the solicitation's own labels where a section addresses a requirement, or no numbers at all.","default":"auto"}},"additionalProperties":false,"type":"object","title":"VersionCreateRequest","description":"Public API contract for POST /api/rfp/generations.\n\nStrictly limited to fields the wizard is allowed to set. The model,\nretrieval method, executor parallelism, dependency-gate toggle, and\nother pipeline knobs are *server-resolved* via the entitlements\nfeature service against the tenant's organization — they are not\naccepted from any client. ``extra=\"forbid\"`` enforces this: any\nrequest that includes ``model`` / ``retrieval_method`` (or any other\nunknown field) is rejected with HTTP 422."},"WebhookDeletedResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"deleted":{"type":"boolean","title":"Deleted","default":true}},"type":"object","required":["id"],"title":"WebhookDeletedResponse"},"WebhookDeliveryListResponse":{"properties":{"deliveries":{"items":{"$ref":"#/components/schemas/WebhookDeliveryRow"},"type":"array","title":"Deliveries"},"count":{"type":"integer","title":"Count"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["deliveries","count","limit","offset"],"title":"WebhookDeliveryListResponse"},"WebhookDeliveryRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"webhook_id":{"type":"string","format":"uuid","title":"Webhook Id"},"event_id":{"type":"string","format":"uuid","title":"Event Id"},"event_type":{"type":"string","title":"Event Type"},"status":{"type":"string","title":"Status"},"attempt_count":{"type":"integer","title":"Attempt Count"},"last_response_status":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Response Status"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"next_retry_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Retry At"},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At"},"dead_lettered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dead Lettered At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","webhook_id","event_id","event_type","status","attempt_count","created_at"],"title":"WebhookDeliveryRow","description":"One row in the delivery audit response."},"WebhookDiagnosticDeviation":{"properties":{"kind":{"type":"string","enum":["endpoint_inactive","high_failure_rate","dead_deliveries_present","retry_queue_overdue","signing_secret_unencrypted","no_recent_deliveries"],"title":"Kind"},"severity":{"type":"string","enum":["error","warning","info"],"title":"Severity"},"details":{"type":"string","title":"Details"},"remediation_hint":{"anyOf":[{},{"type":"null"}],"title":"Remediation Hint"}},"type":"object","required":["kind","severity","details"],"title":"WebhookDiagnosticDeviation"},"WebhookDiagnosticsResponse":{"properties":{"endpoint_id":{"type":"string","format":"uuid","title":"Endpoint Id"},"is_canonical_success":{"type":"boolean","title":"Is Canonical Success"},"summary":{"$ref":"#/components/schemas/WebhookDiagnosticsSummary"},"deviations":{"items":{"$ref":"#/components/schemas/WebhookDiagnosticDeviation"},"type":"array","title":"Deviations"}},"type":"object","required":["endpoint_id","is_canonical_success","summary"],"title":"WebhookDiagnosticsResponse"},"WebhookDiagnosticsSummary":{"properties":{"is_active":{"type":"boolean","title":"Is Active"},"url":{"type":"string","title":"Url"},"events_subscribed_count":{"type":"integer","title":"Events Subscribed Count"},"deliveries_total":{"type":"integer","title":"Deliveries Total"},"deliveries_delivered":{"type":"integer","title":"Deliveries Delivered"},"deliveries_failed":{"type":"integer","title":"Deliveries Failed"},"deliveries_pending":{"type":"integer","title":"Deliveries Pending"},"deliveries_dead":{"type":"integer","title":"Deliveries Dead"},"last_delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Delivered At"},"last_attempt_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Attempt At"},"overdue_retry_count":{"type":"integer","title":"Overdue Retry Count","default":0},"signing_secret_age_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Signing Secret Age Seconds"},"signing_secret_encrypted_present":{"type":"boolean","title":"Signing Secret Encrypted Present"}},"type":"object","required":["is_active","url","events_subscribed_count","deliveries_total","deliveries_delivered","deliveries_failed","deliveries_pending","deliveries_dead","signing_secret_encrypted_present"],"title":"WebhookDiagnosticsSummary"},"WebhookEndpointSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"url":{"type":"string","title":"Url"},"events_subscribed":{"items":{"type":"string"},"type":"array","title":"Events Subscribed"},"is_active":{"type":"boolean","title":"Is Active"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","organization_id","url","events_subscribed","is_active","created_at","updated_at"],"title":"WebhookEndpointSummary","description":"Endpoint metadata visible to the customer on every read.\n\nThe signing secret is NOT in this shape — that field is only\nsurfaced on create + rotate via :class:`WebhookEndpointWithSecret`."},"WebhookEndpointWithSecret":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"organization_id":{"type":"string","format":"uuid","title":"Organization Id"},"url":{"type":"string","title":"Url"},"events_subscribed":{"items":{"type":"string"},"type":"array","title":"Events Subscribed"},"is_active":{"type":"boolean","title":"Is Active"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"signing_secret":{"type":"string","title":"Signing Secret"}},"type":"object","required":["id","organization_id","url","events_subscribed","is_active","created_at","updated_at","signing_secret"],"title":"WebhookEndpointWithSecret","description":"Endpoint summary + the raw signing secret. Returned ONCE on\ncreate or rotate; subsequent reads lose the secret field."},"WebhookListResponse":{"properties":{"endpoints":{"items":{"$ref":"#/components/schemas/WebhookEndpointSummary"},"type":"array","title":"Endpoints"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["endpoints","count"],"title":"WebhookListResponse"},"WebhookTestResponse":{"properties":{"delivery_id":{"type":"string","format":"uuid","title":"Delivery Id"},"event_type":{"type":"string","title":"Event Type"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["delivery_id","event_type","detail"],"title":"WebhookTestResponse","description":"Response to ``POST /v1/webhooks/{id}/test``.\n\nThe dispatcher fires the test event asynchronously (same pipeline\nas production events); the response surfaces the delivery_id so\nthe customer can poll ``GET /v1/webhooks/{id}/deliveries`` to\nsee the outcome, OR retrieve a single delivery row directly via\na future ``GET /v1/webhooks/{id}/deliveries/{delivery_id}`` route."},"WorkspaceCreate":{"properties":{"name":{"type":"string","maxLength":255,"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"}},"type":"object","required":["name"],"title":"WorkspaceCreate","description":"Request model for creating a workspace."},"WorkspaceListResponse":{"properties":{"workspaces":{"items":{"$ref":"#/components/schemas/WorkspaceResponse"},"type":"array","title":"Workspaces"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["workspaces","total"],"title":"WorkspaceListResponse","description":"Response model for listing workspaces."},"WorkspaceResponse":{"properties":{"id":{"type":"string","title":"Id"},"organization_id":{"type":"string","title":"Organization Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"is_default":{"type":"boolean","title":"Is Default"},"is_synthetic":{"type":"boolean","title":"Is Synthetic"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"},"synthetic_company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Synthetic Company Name"},"synthetic_industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Synthetic Industry"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"document_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Document Count"},"proposal_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Proposal Count"},"generation_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Generation Count"},"chat_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Chat Count"}},"type":"object","required":["id","organization_id","name","slug","description","is_default","is_synthetic","created_at","updated_at"],"title":"WorkspaceResponse","description":"Response model for a workspace."},"WorkspaceUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"}},"type":"object","title":"WorkspaceUpdate","description":"Request model for updating a workspace."},"_ApiKeyBlock":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"is_test_mode":{"type":"boolean","title":"Is Test Mode"}},"type":"object","required":["id","scopes","is_test_mode"],"title":"_ApiKeyBlock"},"_OrgBlock":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"}},"type":"object","required":["id","name","slug","subscription_tier"],"title":"_OrgBlock"},"_UserBlock":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","required":["id","email"],"title":"_UserBlock"}},"securitySchemes":{"BearerApiKey":{"type":"http","scheme":"bearer","bearerFormat":"API-Key","description":"Public API key. Mint at Settings → Developers in the bidauthor dashboard. Format: ``ba_live_…`` / ``ba_test_…``."}}},"security":[{"BearerApiKey":[]}]}