{"openapi":"3.1.0","info":{"title":"CrewTAC AI Agents","description":"\nIntegration-ready AI agents on one shared platform: multi-tenant, API-first,\nprovider-agnostic and auditable.\n\n**Authentication** — send your key in the `X-API-Key` header. Every record and\nevery endpoint is scoped to the tenant that key belongs to.\n\n**Idempotency** — send `Idempotency-Key` on any side-effecting write. A retry\nwith the same key returns the original response instead of repeating the action.\n\n**Correlation** — every response carries `X-Correlation-ID`. Send your own to\ntrace a request across your systems and ours.\n\n**Errors** — failures return `{\"error\": {\"code\", \"message\", \"retryable\",\n\"details\", \"correlation_id\"}}`. Branch on `code`, never on the message text.\n\n**Agent status** — Agents 01-05 are implemented. Agent 06\npublish their documented contract and answer `501` until they are built.\n\nAll demo data is synthetic. Connectors marked `mock` do not contact any real\nsystem.\n","version":"0.1.0"},"paths":{"/health":{"get":{"tags":["Platform"],"summary":"Liveness probe","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}}}},"/health/ready":{"get":{"tags":["Platform"],"summary":"Readiness probe","description":"Reports every dependency. Readiness is false if any hard one is down.","operationId":"readiness_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Readiness Health Ready Get"}}}}}}},"/v1/platform/connectors":{"get":{"tags":["Platform"],"summary":"Which systems this deployment can reach","description":"Backs the 'Connect your system' section of each agent's capability sheet.","operationId":"connectors_v1_platform_connectors_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Connectors V1 Platform Connectors Get"}}}}}}},"/v1/platform/prompts":{"get":{"tags":["Platform"],"summary":"Registered prompt versions","operationId":"prompts_v1_platform_prompts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Prompts V1 Platform Prompts Get"}}}}}}},"/v1/platform/metrics":{"get":{"tags":["Platform"],"summary":"Request, agent, connector and token telemetry","operationId":"platform_metrics_v1_platform_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Platform Metrics V1 Platform Metrics Get"}}}}}}},"/v1/platform/audit":{"get":{"tags":["Platform"],"summary":"Recent audit events for the tenant","operationId":"audit_v1_platform_audit_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Audit V1 Platform Audit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/crm":{"post":{"tags":["Platform"],"summary":"Receive a CRM change event","description":"Signature-verified. One event can concern more than one agent: a deleted contact closes the matching lead (Agent 01) and invalidates the cached account (Agent 05). Both are offered the event and the response reports what each did. An event no agent handles is acknowledged rather than rejected.","operationId":"crm_webhook_v1_webhooks_crm_post","parameters":[{"name":"X-CrewTAC-Signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Crewtac-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Crm Webhook V1 Webhooks Crm Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/leads":{"post":{"tags":["01 — Sales Qualification"],"summary":"Submit a lead for qualification","description":"Runs the full qualification workflow: deduplication, deterministic eligibility rules, model classification, scoring, CRM sync and the recommended next action. Send an `Idempotency-Key` header so a retried submission never creates a second CRM record.","operationId":"submit_lead_v1_leads_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadSubmissionResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["01 — Sales Qualification"],"summary":"List leads for the authenticated tenant","operationId":"list_leads_v1_leads_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"lead_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LeadOut"},"title":"Response List Leads V1 Leads Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/leads/{lead_id}":{"get":{"tags":["01 — Sales Qualification"],"summary":"Retrieve a lead with its qualification and actions","operationId":"get_lead_v1_leads__lead_id__get","parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/leads/{lead_id}/audit":{"get":{"tags":["01 — Sales Qualification"],"summary":"Audit trail for a single lead","description":"Every decision, tool call and approval recorded for this lead.","operationId":"get_lead_audit_v1_leads__lead_id__audit_get","parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AuditEventOut"},"title":"Response Get Lead Audit V1 Leads  Lead Id  Audit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/leads/{lead_id}/approve":{"post":{"tags":["01 — Sales Qualification"],"summary":"Approve, reject or override the recommended action","description":"The human-in-the-loop gate. Approving executes the action through its connector; `override_action_type` lets a human replace the agent's recommendation, which is recorded against the qualification.","operationId":"approve_action_v1_leads__lead_id__approve_post","parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/services__sales_qualification__schemas__ApprovalRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/dispatch":{"post":{"tags":["01 — Sales Qualification"],"summary":"Read and dispatch queued outbound events","description":"Dispatches pending outbound events to the tenant's configured endpoint. Every payload is signed and carries a `schema_version`, so consumers can upgrade independently. Events are recorded before delivery is attempted and retried up to five times.","operationId":"dispatch_events_v1_webhooks_dispatch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDispatchRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Dispatch Events V1 Webhooks Dispatch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/support/messages":{"post":{"tags":["02 — Customer Support & Knowledge"],"summary":"Submit a customer question","description":"Runs the full workflow: triage, retrieval over approved knowledge, grounded answering, confidence and policy checks, then either a cited answer or an escalation with a ticket. Send an `Idempotency-Key` so a retried submission never opens a second ticket.","operationId":"submit_message_v1_support_messages_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportMessageCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportAnswer"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/support/conversations":{"get":{"tags":["02 — Customer Support & Knowledge"],"summary":"List conversations for the authenticated tenant","operationId":"list_conversations_v1_support_conversations_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"conversation_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ConversationOut"},"title":"Response List Conversations V1 Support Conversations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/support/conversations/{conversation_id}":{"get":{"tags":["02 — Customer Support & Knowledge"],"summary":"Retrieve a conversation with its messages, citations and ticket","operationId":"get_conversation_v1_support_conversations__conversation_id__get","parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/knowledge/documents":{"post":{"tags":["02 — Customer Support & Knowledge"],"summary":"Ingest an approved knowledge document","description":"Admin only. Chunks the document, embeds it and makes it retrievable. Re-ingesting the same title creates a new version and supersedes the previous one; re-ingesting identical content is a no-op, so a scheduled sync does not churn version numbers.","operationId":"ingest_document_v1_knowledge_documents_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeDocumentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeIngestResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["02 — Customer Support & Knowledge"],"summary":"List approved knowledge documents","operationId":"list_documents_v1_knowledge_documents_get","parameters":[{"name":"include_superseded","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Superseded"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/KnowledgeDocumentOut"},"title":"Response List Documents V1 Knowledge Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tickets":{"post":{"tags":["02 — Customer Support & Knowledge"],"summary":"Escalate a conversation to a human","description":"Idempotent by conversation: a conversation that already has a ticket returns that ticket rather than opening a second one.","operationId":"create_ticket_v1_tickets_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/feedback":{"post":{"tags":["02 — Customer Support & Knowledge"],"summary":"Record answer-quality feedback","description":"Feeds the evaluation harness. Feedback is never used to change an answer in place, and never trains a model — it is evidence about the prompt and the knowledge base.","operationId":"record_feedback_v1_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/email":{"post":{"tags":["02 — Customer Support & Knowledge"],"summary":"Receive an inbound support email","description":"Signature-verified. Turns a forwarded email into a normal agent conversation — the identical workflow runs, so an answer arriving by email is grounded, cited and gated exactly as one arriving by chat. Send `in_reply_to` so a customer's reply continues its thread instead of opening a second conversation.","operationId":"email_webhook_v1_webhooks_email_post","parameters":[{"name":"X-CrewTAC-Signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Crewtac-Signature"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportAnswer"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/tickets":{"post":{"tags":["02 — Customer Support & Knowledge"],"summary":"Receive ticket updates from the client help desk","description":"Signature-verified. Send the raw body signature in the `X-CrewTAC-Signature` header as `t=<unix>,v1=<hmac-sha256>`.","operationId":"ticket_webhook_v1_webhooks_tickets_post","parameters":[{"name":"X-CrewTAC-Signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Crewtac-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Ticket Webhook V1 Webhooks Tickets Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/documents":{"post":{"tags":["03 — Document Processing & Data Extraction"],"summary":"Upload and process a document","description":"Runs the full workflow: safety checks, text extraction, classification, field extraction against the tenant's schema, deterministic validation and review routing. Identical bytes are recognised as the same document and are not processed twice.","operationId":"upload_document_v1_documents_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document_v1_documents_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSubmissionResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["03 — Document Processing & Data Extraction"],"summary":"List documents for the authenticated tenant","operationId":"list_documents_v1_documents_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"document_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentOut"},"title":"Response List Documents V1 Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/documents/review-queue":{"get":{"tags":["03 — Document Processing & Data Extraction"],"summary":"Documents waiting for a human","description":"Open review tasks, oldest first, with the fields to check.","operationId":"review_queue_v1_documents_review_queue_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ReviewTaskOut"},"title":"Response Review Queue V1 Documents Review Queue Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/documents/schemas":{"get":{"tags":["03 — Document Processing & Data Extraction"],"summary":"Registered document types","description":"What this deployment can extract, and which fields always require a human. Adding a type is a schema file, not a deployment.","operationId":"list_schemas_v1_documents_schemas_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/DocumentSchemaOut"},"type":"array","title":"Response List Schemas V1 Documents Schemas Get"}}}}}}},"/v1/documents/{document_id}":{"get":{"tags":["03 — Document Processing & Data Extraction"],"summary":"Processing status and result","operationId":"get_document_v1_documents__document_id__get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/documents/{document_id}/content":{"get":{"tags":["03 — Document Processing & Data Extraction"],"summary":"Download the original document","description":"For a reviewer checking an extracted field against the page.","operationId":"download_document_v1_documents__document_id__content_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/documents/{document_id}/review":{"post":{"tags":["03 — Document Processing & Data Extraction"],"summary":"Approve, correct or reject an extraction","description":"The human gate. Corrections are authoritative — the reviewer looked at the document — and the original extracted value is retained, so a correction never erases what the agent actually read.","operationId":"review_document_v1_documents__document_id__review_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/documents/{document_id}/export":{"post":{"tags":["03 — Document Processing & Data Extraction"],"summary":"Send the validated data downstream","description":"Only an approved document can be exported. Idempotent by document, so a retried export updates the same downstream record rather than creating a second one.","operationId":"export_document_v1_documents__document_id__export_post","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportRequest","default":{}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/document":{"post":{"tags":["03 — Document Processing & Data Extraction"],"summary":"Receive a document storage event","description":"Signature-verified. Processes a document that arrived in object storage rather than by upload.","operationId":"document_webhook_v1_webhooks_document_post","parameters":[{"name":"X-CrewTAC-Signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Crewtac-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Document Webhook V1 Webhooks Document Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks":{"post":{"tags":["04 — Operations Workflow"],"summary":"Start a workflow from an incoming request","description":"Classifies the request, selects a registered workflow and runs it until it completes, fails, or stops for a human. A request that matches no workflow, or that is missing data a workflow requires, comes back as `needs_triage` rather than being forced into the nearest process.","operationId":"create_task_v1_tasks_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["04 — Operations Workflow"],"summary":"List tasks for the authenticated tenant","operationId":"list_tasks_v1_tasks_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"task_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Task Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TaskOut"},"title":"Response List Tasks V1 Tasks Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/approvals":{"get":{"tags":["04 — Operations Workflow"],"summary":"Steps waiting for a human","description":"Open approval gates, oldest first, each with the exact change it gates.","operationId":"approval_queue_v1_tasks_approvals_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalOut"},"title":"Response Approval Queue V1 Tasks Approvals Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/{task_id}":{"get":{"tags":["04 — Operations Workflow"],"summary":"Workflow state and execution trace","description":"The state machine's position, the planned steps, every tool call with its external id, and any open approval.","operationId":"get_task_v1_tasks__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/{task_id}/approve":{"post":{"tags":["04 — Operations Workflow"],"summary":"Approve or reject a paused step","description":"Approving resumes the workflow at the same step. Rejecting cancels the task; the steps that already ran are not undone, and the trace says so.","operationId":"approve_task_v1_tasks__task_id__approve_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/services__operations_workflow__schemas__ApprovalRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tasks/{task_id}/resume":{"post":{"tags":["04 — Operations Workflow"],"summary":"Continue a task from where it stopped","description":"Safe to call repeatedly. A step that already reached an external system is not run again — its recorded result is reused.","operationId":"resume_task_v1_tasks__task_id__resume_post","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/workflows":{"get":{"tags":["04 — Operations Workflow"],"summary":"Registered workflows","description":"Versioned definitions. Each lists the tools its steps may use and which steps stop for a human. Adding a workflow is a file, not a deployment.","operationId":"list_workflows_v1_workflows_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WorkflowOut"},"type":"array","title":"Response List Workflows V1 Workflows Get"}}}}}}},"/v1/tools":{"get":{"tags":["04 — Operations Workflow"],"summary":"Registered tools","description":"Every action this deployment can take, with its input schema, its impact level and the scope it requires. There is nothing else — a tool not listed here cannot be invoked.","operationId":"list_tools_v1_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ToolOut"},"type":"array","title":"Response List Tools V1 Tools Get"}}}}}}},"/v1/tools/{tool}/execute":{"post":{"tags":["04 — Operations Workflow"],"summary":"Run a single registered tool","description":"Previews by default. The tool is named in the path and matched against the registry before the body is read, and the payload must match the tool's declared schema — there is no free-form execution.","operationId":"execute_tool_v1_tools__tool__execute_post","parameters":[{"name":"tool","in":"path","required":true,"schema":{"type":"string","title":"Tool"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolExecuteRequest","default":{"payload":{},"dry_run":true}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolExecuteResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/events":{"post":{"tags":["04 — Operations Workflow"],"summary":"Receive an external event that starts a workflow","description":"Signature-verified. Schema-validated before anything is routed.","operationId":"events_webhook_v1_webhooks_events_post","parameters":[{"name":"X-CrewTAC-Signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Crewtac-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Events Webhook V1 Webhooks Events Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/crm/ask":{"post":{"tags":["05 — CRM Intelligence & Action"],"summary":"Ask a question about CRM data","description":"Answers only from records the asking user may see, and cites the external id of every record behind the answer. An answer that cites nothing, or cites a record that was never retrieved, is refused rather than shown.","operationId":"ask_v1_crm_ask_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/crm/accounts":{"get":{"tags":["05 — CRM Intelligence & Action"],"summary":"List accounts visible to a user","description":"Narrowed by the role before the query runs, not after.","operationId":"list_accounts_v1_crm_accounts_get","parameters":[{"name":"user_identity","in":"query","required":true,"schema":{"type":"string","title":"User Identity"}},{"name":"role","in":"query","required":false,"schema":{"type":"string","default":"read_only","title":"Role"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RecordOut"},"title":"Response List Accounts V1 Crm Accounts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/crm/roles":{"get":{"tags":["05 — CRM Intelligence & Action"],"summary":"The field-access and action model","description":"What each role may read and do. Published so a client can map their own CRM permissions onto it rather than inferring it from refusals.","operationId":"list_roles_v1_crm_roles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RoleOut"},"type":"array","title":"Response List Roles V1 Crm Roles Get"}}}}}}},"/v1/crm/actions":{"get":{"tags":["05 — CRM Intelligence & Action"],"summary":"Proposed and executed CRM writes","operationId":"list_actions_v1_crm_actions_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"action_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ActionRequestOut"},"title":"Response List Actions V1 Crm Actions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/crm/accounts/{external_id}":{"get":{"tags":["05 — CRM Intelligence & Action"],"summary":"Account context","description":"The account, its contacts and its recent activity, each trimmed to the fields the role may read. Knowing an external id is not authorisation to read the record it names.","operationId":"account_detail_v1_crm_accounts__external_id__get","parameters":[{"name":"external_id","in":"path","required":true,"schema":{"type":"string","title":"External Id"}},{"name":"user_identity","in":"query","required":true,"schema":{"type":"string","title":"User Identity"}},{"name":"role","in":"query","required":false,"schema":{"type":"string","default":"read_only","title":"Role"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/crm/actions/preview":{"post":{"tags":["05 — CRM Intelligence & Action"],"summary":"Preview a write, with no side effect","description":"Shows exactly what the CRM would receive and returns the approval token that execute requires. Nothing is written. A role that may not perform the action is refused here, not at execution.","operationId":"preview_action_v1_crm_actions_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionPreviewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionPreviewOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/crm/actions/execute":{"post":{"tags":["05 — CRM Intelligence & Action"],"summary":"Execute an approved write","description":"Requires the approval token from a preview, so an action cannot be executed without first having been shown. The result is the CRM's own response, including the record id it assigned.","operationId":"execute_action_v1_crm_actions_execute_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionExecuteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActionExecuteResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/assessments":{"post":{"tags":["06 — Legacy Modernization"],"summary":"Create a modernization assessment.","description":"Planned — Agent 06. Returns 501 until this agent is built.","operationId":"post_assessments_v1_assessments_post","responses":{"501":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/assessments/{assessment_id}/artifacts":{"post":{"tags":["06 — Legacy Modernization"],"summary":"Upload sanitized code or inventory artifacts.","description":"Planned — Agent 06. Returns 501 until this agent is built.","operationId":"post_assessments_assessment_id_artifacts_v1_assessments__assessment_id__artifacts_post","parameters":[{"name":"assessment_id","in":"path","required":true,"schema":{"type":"string","title":"Assessment Id"}}],"responses":{"501":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/assessments/{assessment_id}/findings":{"get":{"tags":["06 — Legacy Modernization"],"summary":"Retrieve findings, risks and the dependency map.","description":"Planned — Agent 06. Returns 501 until this agent is built.","operationId":"get_assessments_assessment_id_findings_v1_assessments__assessment_id__findings_get","parameters":[{"name":"assessment_id","in":"path","required":true,"schema":{"type":"string","title":"Assessment Id"}}],"responses":{"501":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/assessments/{assessment_id}/roadmap":{"post":{"tags":["06 — Legacy Modernization"],"summary":"Generate the phased migration roadmap.","description":"Planned — Agent 06. Returns 501 until this agent is built.","operationId":"post_assessments_assessment_id_roadmap_v1_assessments__assessment_id__roadmap_post","parameters":[{"name":"assessment_id","in":"path","required":true,"schema":{"type":"string","title":"Assessment Id"}}],"responses":{"501":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/assessments/{assessment_id}/export":{"get":{"tags":["06 — Legacy Modernization"],"summary":"Export the roadmap, backlog and decision records.","description":"Planned — Agent 06. Returns 501 until this agent is built.","operationId":"get_assessments_assessment_id_export_v1_assessments__assessment_id__export_get","parameters":[{"name":"assessment_id","in":"path","required":true,"schema":{"type":"string","title":"Assessment Id"}}],"responses":{"501":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AccountDetail":{"properties":{"account":{"$ref":"#/components/schemas/RecordOut"},"contacts":{"items":{"$ref":"#/components/schemas/RecordOut"},"type":"array","title":"Contacts"},"activities":{"items":{"$ref":"#/components/schemas/RecordOut"},"type":"array","title":"Activities"},"follow_ups":{"items":{"type":"string"},"type":"array","title":"Follow Ups"},"role":{"type":"string","title":"Role"}},"type":"object","required":["account","role"],"title":"AccountDetail","description":"GET /v1/crm/accounts/{id} — FR-5-OUT-02."},"ActionExecuteRequest":{"properties":{"action_request_id":{"type":"string","title":"Action Request Id"},"approval_token":{"type":"string","title":"Approval Token"},"approved_by":{"type":"string","maxLength":255,"minLength":1,"title":"Approved By"}},"additionalProperties":false,"type":"object","required":["action_request_id","approval_token","approved_by"],"title":"ActionExecuteRequest","description":"POST /v1/crm/actions/execute — requires the token from a preview."},"ActionExecuteResult":{"properties":{"action_request_id":{"type":"string","title":"Action Request Id"},"action_type":{"type":"string","title":"Action Type"},"status":{"type":"string","title":"Status"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"external_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Url"},"response":{"additionalProperties":true,"type":"object","title":"Response"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"approved_by":{"type":"string","title":"Approved By"},"detail":{"type":"string","title":"Detail","default":""}},"type":"object","required":["action_request_id","action_type","status","approved_by"],"title":"ActionExecuteResult","description":"FR-5-OUT-05 — what the CRM actually did."},"ActionOut":{"properties":{"id":{"type":"string","title":"Id"},"action_type":{"type":"string","title":"Action Type"},"owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"},"owner_role":{"type":"string","title":"Owner Role"},"priority":{"type":"string","title":"Priority"},"status":{"type":"string","title":"Status"},"rationale":{"type":"string","title":"Rationale"},"due_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due At"},"requires_approval":{"type":"boolean","title":"Requires Approval"},"approval_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approval Reason"},"approved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"target_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target System"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"external_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Url"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"}},"type":"object","required":["id","action_type","owner","owner_role","priority","status","rationale","due_at","requires_approval","approval_reason","approved_by","approved_at","target_system","external_id","external_url","last_error"],"title":"ActionOut"},"ActionPreviewOut":{"properties":{"action_request_id":{"type":"string","title":"Action Request Id"},"action_type":{"type":"string","title":"Action Type"},"target_system":{"type":"string","title":"Target System"},"description":{"type":"string","title":"Description"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"will_create":{"type":"boolean","title":"Will Create"},"is_reversible":{"type":"boolean","title":"Is Reversible"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"approval_token":{"type":"string","title":"Approval Token"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"detail":{"type":"string","title":"Detail","default":""}},"type":"object","required":["action_request_id","action_type","target_system","description","payload","will_create","is_reversible","approval_token","expires_at"],"title":"ActionPreviewOut","description":"FR-5-OUT-04 — the exact intended change, plus the token to approve it."},"ActionPreviewRequest":{"properties":{"action_type":{"type":"string","enum":["create_contact","update_contact","create_task","create_opportunity"],"title":"Action Type"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"user_identity":{"type":"string","maxLength":255,"minLength":1,"title":"User Identity"},"role":{"type":"string","maxLength":64,"title":"Role","default":"read_only"}},"additionalProperties":false,"type":"object","required":["action_type","user_identity"],"title":"ActionPreviewRequest","description":"POST /v1/crm/actions/preview — no side effect, by contract."},"ActionRequestOut":{"properties":{"id":{"type":"string","title":"Id"},"action_type":{"type":"string","title":"Action Type"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"preview":{"additionalProperties":true,"type":"object","title":"Preview"},"status":{"type":"string","title":"Status"},"requested_by":{"type":"string","title":"Requested By"},"approved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"external_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Url"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"executed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Executed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","action_type","payload","preview","status","requested_by","approved_by","external_id","external_url","error","expires_at","executed_at","created_at"],"title":"ActionRequestOut"},"ApprovalOut":{"properties":{"id":{"type":"string","title":"Id"},"task_id":{"type":"string","title":"Task Id"},"step_id":{"type":"string","title":"Step Id"},"tool":{"type":"string","title":"Tool"},"preview":{"additionalProperties":true,"type":"object","title":"Preview"},"status":{"type":"string","title":"Status"},"approver":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approver"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"decided_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Decided At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","task_id","step_id","tool","preview","status","approver","note","decided_at","created_at"],"title":"ApprovalOut","description":"FR-4-OUT-05 — a gate, and exactly what it is gating."},"ApprovalResult":{"properties":{"action":{"$ref":"#/components/schemas/ActionOut"},"qualification":{"anyOf":[{"$ref":"#/components/schemas/QualificationOut"},{"type":"null"}]},"executed":{"type":"boolean","title":"Executed"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["action","executed","detail"],"title":"ApprovalResult"},"AskRequest":{"properties":{"question":{"type":"string","maxLength":2000,"minLength":1,"title":"Question"},"user_identity":{"type":"string","maxLength":255,"minLength":1,"title":"User Identity"},"role":{"type":"string","maxLength":64,"title":"Role","default":"read_only"}},"additionalProperties":false,"type":"object","required":["question","user_identity"],"title":"AskRequest","description":"POST /v1/crm/ask — a natural-language question."},"AskResult":{"properties":{"query_id":{"type":"string","title":"Query Id"},"question":{"type":"string","title":"Question"},"answered":{"type":"boolean","title":"Answered"},"answer":{"type":"string","title":"Answer","default":""},"record_refs":{"items":{"type":"string"},"type":"array","title":"Record Refs"},"records":{"items":{"$ref":"#/components/schemas/RecordOut"},"type":"array","title":"Records"},"intent":{"type":"string","title":"Intent"},"structured_query":{"additionalProperties":true,"type":"object","title":"Structured Query"},"confidence":{"type":"number","title":"Confidence","default":0.0},"refusal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refusal Code"},"refusal_detail":{"type":"string","title":"Refusal Detail","default":""},"follow_ups":{"items":{"type":"string"},"type":"array","title":"Follow Ups"},"role":{"type":"string","title":"Role"},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"}},"type":"object","required":["query_id","question","answered","intent","role"],"title":"AskResult","description":"FR-5-OUT-01 to 03 — the answer and everything behind it."},"AuditEventOut":{"properties":{"id":{"type":"string","title":"Id"},"event_type":{"type":"string","title":"Event Type"},"actor":{"type":"string","title":"Actor"},"subject_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Type"},"subject_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Id"},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"event_metadata":{"additionalProperties":true,"type":"object","title":"Event Metadata"}},"type":"object","required":["id","event_type","actor","subject_type","subject_id","correlation_id","timestamp","event_metadata"],"title":"AuditEventOut"},"Body_upload_document_v1_documents_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File","description":"PDF, image or text document."},"document_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Type","description":"Skip classification when you already know the type."}},"type":"object","required":["file"],"title":"Body_upload_document_v1_documents_post"},"ConversationDetail":{"properties":{"conversation":{"$ref":"#/components/schemas/ConversationOut"},"messages":{"items":{"$ref":"#/components/schemas/MessageOut"},"type":"array","title":"Messages"},"ticket":{"anyOf":[{"$ref":"#/components/schemas/TicketOut"},{"type":"null"}]}},"type":"object","required":["conversation"],"title":"ConversationDetail"},"ConversationOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"customer_ref":{"type":"string","title":"Customer Ref"},"channel":{"type":"string","title":"Channel"},"language":{"type":"string","title":"Language"},"subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id","customer_ref","channel","language","subject","status","created_at","updated_at"],"title":"ConversationOut"},"DocumentDetail":{"properties":{"document":{"$ref":"#/components/schemas/DocumentOut"},"extraction":{"anyOf":[{"$ref":"#/components/schemas/ExtractionOut"},{"type":"null"}]},"fields":{"items":{"$ref":"#/components/schemas/FieldResultOut"},"type":"array","title":"Fields"},"review_tasks":{"items":{"$ref":"#/components/schemas/ReviewTaskOut"},"type":"array","title":"Review Tasks"},"exports":{"items":{"$ref":"#/components/schemas/ExportEventOut"},"type":"array","title":"Exports"}},"type":"object","required":["document"],"title":"DocumentDetail","description":"Everything known about one document."},"DocumentOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"filename":{"type":"string","title":"Filename"},"content_type":{"type":"string","title":"Content Type"},"file_kind":{"type":"string","title":"File Kind"},"size_bytes":{"type":"integer","title":"Size Bytes"},"checksum":{"type":"string","title":"Checksum"},"status":{"type":"string","title":"Status"},"rejection_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rejection Reason"},"document_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Type"},"classification_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Classification Confidence"},"classification_signals":{"items":{"type":"string"},"type":"array","title":"Classification Signals"},"classified_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Classified By"},"text_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Method"},"page_count":{"type":"integer","title":"Page Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id","filename","content_type","file_kind","size_bytes","checksum","status","rejection_reason","document_type","classification_confidence","classification_signals","classified_by","text_method","page_count","created_at","updated_at"],"title":"DocumentOut","description":"FR-3-OUT-05 — normalised document metadata."},"DocumentSchemaOut":{"properties":{"id":{"type":"string","title":"Id"},"version":{"type":"string","title":"Version"},"description":{"type":"string","title":"Description"},"field_count":{"type":"integer","title":"Field Count"},"high_risk_fields":{"items":{"type":"string"},"type":"array","title":"High Risk Fields"},"is_latest":{"type":"boolean","title":"Is Latest"}},"type":"object","required":["id","version","description","field_count","high_risk_fields","is_latest"],"title":"DocumentSchemaOut","description":"A registered document type, so a client can see what will be extracted."},"DocumentSubmissionResult":{"properties":{"document":{"$ref":"#/components/schemas/DocumentOut"},"extraction":{"anyOf":[{"$ref":"#/components/schemas/ExtractionOut"},{"type":"null"}]},"fields":{"items":{"$ref":"#/components/schemas/FieldResultOut"},"type":"array","title":"Fields"},"review_task":{"anyOf":[{"$ref":"#/components/schemas/ReviewTaskOut"},{"type":"null"}]},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"}},"type":"object","required":["document"],"title":"DocumentSubmissionResult","description":"POST /v1/documents response."},"DuplicateOut":{"properties":{"found":{"type":"boolean","title":"Found"},"source":{"type":"string","title":"Source"},"confidence":{"type":"string","title":"Confidence"},"lead_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Id"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"detail":{"type":"string","title":"Detail","default":""}},"type":"object","required":["found","source","confidence"],"title":"DuplicateOut"},"ExportEventOut":{"properties":{"id":{"type":"string","title":"Id"},"destination":{"type":"string","title":"Destination"},"status":{"type":"string","title":"Status"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"external_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Url"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","destination","status","external_id","external_url","last_error","created_at"],"title":"ExportEventOut","description":"FR-3-OUT-06 — one attempt to send the result downstream."},"ExportRequest":{"properties":{"destination":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Destination"}},"additionalProperties":false,"type":"object","title":"ExportRequest","description":"POST /v1/documents/{id}/export."},"ExportResult":{"properties":{"export":{"$ref":"#/components/schemas/ExportEventOut"},"document":{"$ref":"#/components/schemas/DocumentOut"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["export","document","detail"],"title":"ExportResult"},"ExtractionOut":{"properties":{"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"overall_confidence":{"type":"number","title":"Overall Confidence"},"schema_id":{"type":"string","title":"Schema Id"},"schema_version":{"type":"string","title":"Schema Version"},"document_errors":{"items":{"type":"string"},"type":"array","title":"Document Errors"},"model_version":{"type":"string","title":"Model Version"},"provider":{"type":"string","title":"Provider"},"prompt_version":{"type":"string","title":"Prompt Version"},"rules_version":{"type":"string","title":"Rules Version"},"extracted_by":{"type":"string","title":"Extracted By"}},"type":"object","required":["payload","overall_confidence","schema_id","schema_version","document_errors","model_version","provider","prompt_version","rules_version","extracted_by"],"title":"ExtractionOut"},"FeedbackCreate":{"properties":{"message_id":{"type":"string","title":"Message Id"},"rating":{"type":"string","enum":["helpful","not_helpful"],"title":"Rating"},"reason":{"anyOf":[{"type":"string","enum":["incorrect","incomplete","irrelevant","unclear","wrong_language","other"]},{"type":"null"}],"title":"Reason"},"comment":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Comment"},"submitted_by":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Submitted By"}},"additionalProperties":false,"type":"object","required":["message_id","rating"],"title":"FeedbackCreate","description":"POST /v1/feedback — answer quality signal for the eval harness."},"FeedbackOut":{"properties":{"id":{"type":"string","title":"Id"},"message_id":{"type":"string","title":"Message Id"},"rating":{"type":"string","title":"Rating"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"},"submitted_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Submitted By"},"submitted_at":{"type":"string","format":"date-time","title":"Submitted At"}},"type":"object","required":["id","message_id","rating","reason","comment","submitted_by","submitted_at"],"title":"FeedbackOut"},"FieldResultOut":{"properties":{"field_name":{"type":"string","title":"Field Name"},"value":{"title":"Value"},"raw_value":{"title":"Raw Value"},"confidence":{"type":"number","title":"Confidence"},"validation_status":{"type":"string","title":"Validation Status"},"validation_errors":{"items":{"type":"string"},"type":"array","title":"Validation Errors"},"evidence":{"type":"string","title":"Evidence"},"high_risk":{"type":"boolean","title":"High Risk"},"corrected_value":{"title":"Corrected Value"},"corrected_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrected By"}},"type":"object","required":["field_name","confidence","validation_status","validation_errors","evidence","high_risk"],"title":"FieldResultOut","description":"FR-3-OUT-02 — one field, its confidence and its verdict."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"KnowledgeDocumentCreate":{"properties":{"title":{"type":"string","maxLength":512,"minLength":1,"title":"Title"},"content":{"type":"string","maxLength":1000000,"minLength":1,"title":"Content"},"source_uri":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Source Uri"},"language":{"type":"string","maxLength":16,"title":"Language","default":"en"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"additionalProperties":false,"type":"object","required":["title","content"],"title":"KnowledgeDocumentCreate","description":"POST /v1/knowledge/documents — admin only."},"KnowledgeDocumentOut":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"version":{"type":"integer","title":"Version"},"status":{"type":"string","title":"Status"},"language":{"type":"string","title":"Language"},"source_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Uri"},"checksum":{"type":"string","title":"Checksum"},"approved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Approved By"},"approved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Approved At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","title","version","status","language","source_uri","checksum","approved_by","approved_at","created_at"],"title":"KnowledgeDocumentOut"},"KnowledgeIngestResult":{"properties":{"document":{"$ref":"#/components/schemas/KnowledgeDocumentOut"},"chunk_count":{"type":"integer","title":"Chunk Count"},"superseded_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Superseded Version"},"was_unchanged":{"type":"boolean","title":"Was Unchanged","default":false}},"type":"object","required":["document","chunk_count"],"title":"KnowledgeIngestResult"},"LeadCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Phone"},"consent_status":{"type":"string","enum":["granted","denied","withdrawn","unknown"],"title":"Consent Status","default":"unknown"},"company":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Company"},"role":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Role"},"company_size":{"anyOf":[{"type":"string","enum":["1-10","11-50","51-200","201-1000","1000+"]},{"type":"null"}],"title":"Company Size"},"industry":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Industry"},"country":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Country"},"problem":{"type":"string","maxLength":8000,"minLength":1,"title":"Problem"},"source":{"type":"string","maxLength":64,"title":"Source","default":"api"},"campaign":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Campaign"},"crm_context":{"additionalProperties":true,"type":"object","title":"Crm Context"}},"additionalProperties":false,"type":"object","required":["name","email","problem"],"title":"LeadCreate","description":"POST /v1/leads — FR-1-IN-01 through FR-1-IN-05."},"LeadDetail":{"properties":{"lead":{"$ref":"#/components/schemas/LeadOut"},"qualification":{"anyOf":[{"$ref":"#/components/schemas/QualificationOut"},{"type":"null"}]},"actions":{"items":{"$ref":"#/components/schemas/ActionOut"},"type":"array","title":"Actions"}},"type":"object","required":["lead"],"title":"LeadDetail","description":"GET /v1/leads/{id} — the lead plus everything the agent decided."},"LeadOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","title":"Email"},"company":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company"},"role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Role"},"company_size":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Size"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"source":{"type":"string","title":"Source"},"campaign":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Campaign"},"consent_status":{"type":"string","title":"Consent Status"},"problem":{"type":"string","title":"Problem"},"status":{"type":"string","title":"Status"},"duplicate_of_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Duplicate Of Id"},"external_ids":{"additionalProperties":true,"type":"object","title":"External Ids"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id","name","email","company","role","company_size","industry","country","source","campaign","consent_status","problem","status","duplicate_of_id","external_ids","created_at","updated_at"],"title":"LeadOut"},"LeadSubmissionResult":{"properties":{"lead":{"$ref":"#/components/schemas/LeadOut"},"qualification":{"anyOf":[{"$ref":"#/components/schemas/QualificationOut"},{"type":"null"}]},"actions":{"items":{"$ref":"#/components/schemas/ActionOut"},"type":"array","title":"Actions"},"duplicate":{"$ref":"#/components/schemas/DuplicateOut"},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"}},"type":"object","required":["lead","duplicate"],"title":"LeadSubmissionResult","description":"POST /v1/leads response."},"MessageOut":{"properties":{"id":{"type":"string","title":"Id"},"role":{"type":"string","title":"Role"},"text":{"type":"string","title":"Text"},"status":{"type":"string","title":"Status"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"source_refs":{"items":{"$ref":"#/components/schemas/SourceRef"},"type":"array","title":"Source Refs"},"intent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intent"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"urgency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Urgency"},"escalated":{"type":"boolean","title":"Escalated"},"escalation_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Escalation Reason"},"escalation_codes":{"items":{"type":"string"},"type":"array","title":"Escalation Codes"},"suggested_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Action"},"suggested_action_owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Action Owner"},"suggested_action_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Suggested Action Reason"},"retrieval_count":{"type":"integer","title":"Retrieval Count"},"top_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top Score"},"model_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Version"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"prompt_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Version"},"rules_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rules Version"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","role","text","status","confidence","source_refs","intent","category","urgency","escalated","escalation_reason","escalation_codes","suggested_action","suggested_action_owner","suggested_action_reason","retrieval_count","top_score","model_version","provider","prompt_version","rules_version","created_at"],"title":"MessageOut"},"PlannedStepOut":{"properties":{"id":{"type":"string","title":"Id"},"tool":{"type":"string","title":"Tool"},"description":{"type":"string","title":"Description"},"requires_approval":{"type":"boolean","title":"Requires Approval"},"optional":{"type":"boolean","title":"Optional"}},"type":"object","required":["id","tool","description","requires_approval","optional"],"title":"PlannedStepOut","description":"FR-4-OUT-03 — the action plan, which comes from the catalog.\n\nPublished so a caller can see the whole sequence before it runs, including\nthe steps that will stop for a human."},"QualificationOut":{"properties":{"id":{"type":"string","title":"Id"},"score":{"type":"integer","title":"Score"},"fit":{"type":"string","title":"Fit"},"intent":{"type":"string","title":"Intent"},"urgency":{"type":"string","title":"Urgency"},"budget_signal":{"type":"string","title":"Budget Signal"},"confidence":{"type":"number","title":"Confidence"},"status":{"type":"string","title":"Status"},"summary":{"type":"string","title":"Summary"},"reason_codes":{"items":{"$ref":"#/components/schemas/ReasonCodeOut"},"type":"array","title":"Reason Codes"},"signals":{"items":{"type":"string"},"type":"array","title":"Signals"},"model_version":{"type":"string","title":"Model Version"},"provider":{"type":"string","title":"Provider"},"prompt_version":{"type":"string","title":"Prompt Version"},"rules_version":{"type":"string","title":"Rules Version"},"classified_by":{"type":"string","title":"Classified By"},"overridden_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Overridden By"},"override_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Override Reason"}},"type":"object","required":["id","score","fit","intent","urgency","budget_signal","confidence","status","summary","reason_codes","signals","model_version","provider","prompt_version","rules_version","classified_by"],"title":"QualificationOut"},"ReasonCodeOut":{"properties":{"code":{"type":"string","title":"Code"},"label":{"type":"string","title":"Label"},"points":{"type":"integer","title":"Points"}},"type":"object","required":["code","label","points"],"title":"ReasonCodeOut"},"RecordOut":{"properties":{"external_id":{"type":"string","title":"External Id"},"kind":{"type":"string","enum":["account","contact","activity"],"title":"Kind"},"fields":{"additionalProperties":true,"type":"object","title":"Fields"},"hidden_fields":{"items":{"type":"string"},"type":"array","title":"Hidden Fields"}},"type":"object","required":["external_id","kind"],"title":"RecordOut","description":"One CRM record, already narrowed to what this role may read."},"ReviewRequest":{"properties":{"decision":{"type":"string","enum":["approve","reject"],"title":"Decision"},"reviewer":{"type":"string","maxLength":128,"minLength":1,"title":"Reviewer"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"},"corrections":{"additionalProperties":true,"type":"object","title":"Corrections"}},"additionalProperties":false,"type":"object","required":["decision","reviewer"],"title":"ReviewRequest","description":"POST /v1/documents/{id}/review — the human gate."},"ReviewResult":{"properties":{"task":{"$ref":"#/components/schemas/ReviewTaskOut"},"document":{"$ref":"#/components/schemas/DocumentOut"},"fields":{"items":{"$ref":"#/components/schemas/FieldResultOut"},"type":"array","title":"Fields"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["task","document","detail"],"title":"ReviewResult"},"ReviewTaskOut":{"properties":{"id":{"type":"string","title":"Id"},"document_id":{"type":"string","title":"Document Id"},"reason":{"type":"string","title":"Reason"},"reason_codes":{"items":{"type":"string"},"type":"array","title":"Reason Codes"},"fields_to_check":{"items":{"type":"string"},"type":"array","title":"Fields To Check"},"status":{"type":"string","title":"Status"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"},"resolution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution"},"resolved_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved By"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","document_id","reason","reason_codes","fields_to_check","status","assigned_to","resolution","resolved_by","resolved_at","created_at"],"title":"ReviewTaskOut","description":"FR-3-OUT-04 — a human review queue item."},"RoleOut":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"account_fields":{"items":{"type":"string"},"type":"array","title":"Account Fields"},"allowed_actions":{"items":{"type":"string"},"type":"array","title":"Allowed Actions"},"own_records_only":{"type":"boolean","title":"Own Records Only"}},"type":"object","required":["name","description","account_fields","allowed_actions","own_records_only"],"title":"RoleOut","description":"GET /v1/crm/roles — what each role may see and do."},"SourceRef":{"properties":{"passage":{"type":"integer","title":"Passage"},"chunk_id":{"type":"string","title":"Chunk Id"},"document_id":{"type":"string","title":"Document Id"},"document_title":{"type":"string","title":"Document Title"},"document_version":{"type":"integer","title":"Document Version"},"heading_path":{"type":"string","title":"Heading Path"},"score":{"type":"number","title":"Score"},"citation":{"type":"string","title":"Citation"},"source_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Uri"}},"type":"object","required":["passage","chunk_id","document_id","document_title","document_version","heading_path","score","citation"],"title":"SourceRef"},"StepOutcomeOut":{"properties":{"step_id":{"type":"string","title":"Step Id"},"tool":{"type":"string","title":"Tool"},"status":{"type":"string","title":"Status"},"detail":{"type":"string","title":"Detail"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"}},"type":"object","required":["step_id","tool","status","detail"],"title":"StepOutcomeOut","description":"What one call to the engine did to one step."},"SupportAnswer":{"properties":{"conversation":{"$ref":"#/components/schemas/ConversationOut"},"reply":{"$ref":"#/components/schemas/MessageOut"},"ticket":{"anyOf":[{"$ref":"#/components/schemas/TicketOut"},{"type":"null"}]},"escalated":{"type":"boolean","title":"Escalated"},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"}},"type":"object","required":["conversation","reply","escalated"],"title":"SupportAnswer","description":"POST /v1/support/messages response."},"SupportMessageCreate":{"properties":{"message":{"type":"string","maxLength":8000,"minLength":1,"title":"Message"},"customer_ref":{"type":"string","maxLength":128,"minLength":1,"title":"Customer Ref"},"conversation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conversation Id"},"channel":{"type":"string","enum":["chat","email","api","ticket"],"title":"Channel","default":"api"},"subject":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Subject"},"product_context":{"additionalProperties":true,"type":"object","title":"Product Context"},"account_context":{"additionalProperties":true,"type":"object","title":"Account Context"}},"additionalProperties":false,"type":"object","required":["message","customer_ref"],"title":"SupportMessageCreate","description":"POST /v1/support/messages — FR-2-IN-01 through FR-2-IN-05."},"TaskCreate":{"properties":{"request_text":{"type":"string","maxLength":8000,"minLength":1,"title":"Request Text"},"requester":{"type":"string","maxLength":320,"minLength":1,"title":"Requester"},"channel":{"type":"string","enum":["api","email","form","webhook"],"title":"Channel","default":"api"},"context":{"additionalProperties":true,"type":"object","title":"Context"},"workflow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id"}},"additionalProperties":false,"type":"object","required":["request_text","requester"],"title":"TaskCreate","description":"POST /v1/tasks — start a workflow from a request."},"TaskDetail":{"properties":{"task":{"$ref":"#/components/schemas/TaskOut"},"plan":{"items":{"$ref":"#/components/schemas/PlannedStepOut"},"type":"array","title":"Plan"},"executions":{"items":{"$ref":"#/components/schemas/ToolExecutionOut"},"type":"array","title":"Executions"},"approvals":{"items":{"$ref":"#/components/schemas/ApprovalOut"},"type":"array","title":"Approvals"},"pending_approval":{"anyOf":[{"$ref":"#/components/schemas/ApprovalOut"},{"type":"null"}]}},"type":"object","required":["task"],"title":"TaskDetail","description":"GET /v1/tasks/{id} — the full trace."},"TaskOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"request_text":{"type":"string","title":"Request Text"},"requester":{"type":"string","title":"Requester"},"channel":{"type":"string","title":"Channel"},"context":{"additionalProperties":true,"type":"object","title":"Context"},"workflow_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Id"},"workflow_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Workflow Version"},"routing_confidence":{"type":"number","title":"Routing Confidence"},"routing_signals":{"items":{"type":"string"},"type":"array","title":"Routing Signals"},"routed_by":{"type":"string","title":"Routed By"},"summary":{"type":"string","title":"Summary"},"urgency":{"type":"string","title":"Urgency"},"status":{"type":"string","title":"Status"},"current_step":{"type":"integer","title":"Current Step"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"missing_fields":{"items":{"type":"string"},"type":"array","title":"Missing Fields"},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_id","request_text","requester","channel","context","workflow_id","workflow_version","routing_confidence","routing_signals","routed_by","summary","urgency","status","current_step","failure_reason","missing_fields","correlation_id","created_at","updated_at"],"title":"TaskOut","description":"FR-4-OUT-02 — the task and where it has got to."},"TaskResult":{"properties":{"task":{"$ref":"#/components/schemas/TaskOut"},"plan":{"items":{"$ref":"#/components/schemas/PlannedStepOut"},"type":"array","title":"Plan"},"outcomes":{"items":{"$ref":"#/components/schemas/StepOutcomeOut"},"type":"array","title":"Outcomes"},"executions":{"items":{"$ref":"#/components/schemas/ToolExecutionOut"},"type":"array","title":"Executions"},"pending_approval":{"anyOf":[{"$ref":"#/components/schemas/ApprovalOut"},{"type":"null"}]},"detail":{"type":"string","title":"Detail","default":""},"correlation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Correlation Id"}},"type":"object","required":["task"],"title":"TaskResult","description":"POST /v1/tasks — the finished response, or the point it stopped at."},"TicketCreate":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"subject":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Subject"},"priority":{"type":"string","enum":["low","normal","high","urgent"],"title":"Priority","default":"normal"},"reason":{"type":"string","maxLength":2000,"minLength":1,"title":"Reason"},"owner":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Owner"}},"additionalProperties":false,"type":"object","required":["conversation_id","reason"],"title":"TicketCreate","description":"POST /v1/tickets — escalate explicitly, outside the answer flow."},"TicketOut":{"properties":{"id":{"type":"string","title":"Id"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"external_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Url"},"target_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target System"},"subject":{"type":"string","title":"Subject"},"status":{"type":"string","title":"Status"},"priority":{"type":"string","title":"Priority"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"},"escalation_reason":{"type":"string","title":"Escalation Reason"},"escalation_codes":{"items":{"type":"string"},"type":"array","title":"Escalation Codes"},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","external_id","external_url","target_system","subject","status","priority","category","owner","escalation_reason","escalation_codes","last_error","created_at"],"title":"TicketOut"},"ToolExecuteRequest":{"properties":{"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"dry_run":{"type":"boolean","title":"Dry Run","default":true}},"additionalProperties":false,"type":"object","title":"ToolExecuteRequest","description":"POST /v1/tools/{tool}/execute — one controlled tool call.\n\nDeliberately narrow. There is no free-form command field, and the tool is\nnamed in the path so it is matched against the registry before the body is\neven read. Section 7: \"never expose arbitrary execution\"."},"ToolExecuteResult":{"properties":{"tool":{"type":"string","title":"Tool"},"dry_run":{"type":"boolean","title":"Dry Run"},"status":{"type":"string","title":"Status"},"preview":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Preview"},"output":{"additionalProperties":true,"type":"object","title":"Output"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"detail":{"type":"string","title":"Detail","default":""}},"type":"object","required":["tool","dry_run","status"],"title":"ToolExecuteResult"},"ToolExecutionOut":{"properties":{"id":{"type":"string","title":"Id"},"step_id":{"type":"string","title":"Step Id"},"tool":{"type":"string","title":"Tool"},"status":{"type":"string","title":"Status"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"external_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Url"},"input_payload":{"additionalProperties":true,"type":"object","title":"Input Payload"},"output":{"additionalProperties":true,"type":"object","title":"Output"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","step_id","tool","status","external_id","external_url","input_payload","output","error","created_at"],"title":"ToolExecutionOut","description":"FR-4-OUT-04 — one tool call and what it actually did."},"ToolOut":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"impact":{"type":"string","title":"Impact"},"required_scope":{"type":"string","title":"Required Scope"},"is_external":{"type":"boolean","title":"Is External"},"schema":{"additionalProperties":true,"type":"object","title":"Schema"}},"type":"object","required":["name","description","impact","required_scope","is_external","schema"],"title":"ToolOut","description":"GET /v1/tools — the catalog of what this deployment can do."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookDispatchRequest":{"properties":{"target_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target Url"},"limit":{"type":"integer","maximum":500.0,"minimum":1.0,"title":"Limit","default":50}},"additionalProperties":false,"type":"object","title":"WebhookDispatchRequest","description":"POST /v1/webhooks/events — publish queued agent events."},"WorkflowOut":{"properties":{"id":{"type":"string","title":"Id"},"version":{"type":"string","title":"Version"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"step_count":{"type":"integer","title":"Step Count"},"allowed_tools":{"items":{"type":"string"},"type":"array","title":"Allowed Tools"},"required_fields":{"items":{"type":"string"},"type":"array","title":"Required Fields"},"approval_steps":{"items":{"type":"string"},"type":"array","title":"Approval Steps"}},"type":"object","required":["id","version","name","description","step_count","allowed_tools","required_fields","approval_steps"],"title":"WorkflowOut","description":"GET /v1/workflows — versioned definitions, per section 9."},"services__operations_workflow__schemas__ApprovalRequest":{"properties":{"decision":{"type":"string","enum":["approve","reject"],"title":"Decision"},"approver":{"type":"string","maxLength":128,"minLength":1,"title":"Approver"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"}},"additionalProperties":false,"type":"object","required":["decision","approver"],"title":"ApprovalRequest","description":"POST /v1/tasks/{id}/approve — the human gate."},"services__sales_qualification__schemas__ApprovalRequest":{"properties":{"action_id":{"type":"string","title":"Action Id"},"decision":{"type":"string","enum":["approve","reject"],"title":"Decision"},"approver":{"type":"string","maxLength":128,"minLength":1,"title":"Approver"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"},"override_action_type":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Override Action Type"},"override_reason":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Override Reason"}},"additionalProperties":false,"type":"object","required":["action_id","decision","approver"],"title":"ApprovalRequest","description":"POST /v1/leads/{id}/approve — the human-in-the-loop gate."}}},"tags":[{"name":"Platform","description":"Health, connectors, prompts and telemetry."},{"name":"01 — Sales Qualification","description":"Implemented."},{"name":"02 — Customer Support & Knowledge","description":"Implemented."},{"name":"03 — Document Processing & Data Extraction","description":"Implemented."},{"name":"04 — Operations Workflow","description":"Implemented."},{"name":"05 — CRM Intelligence & Action","description":"Implemented."},{"name":"06 — Legacy Modernization","description":"Planned."}]}