{"openapi": "3.1.0", "info": {"title": "Sempera API", "version": "1.0.0", "description": "The Sempera API: agents, versions, sessions, calls, phone numbers, tools, integrations, knowledge, tests, evals, workspaces, API keys and webhooks, under one hostname. Read /llms.txt for the guide map.", "contact": {"name": "Sempera", "url": "https://sempera.org", "email": "hello@sempera.org"}}, "servers": [{"url": "https://api.sempera.org"}], "tags": [{"name": "OAuth", "description": "OAuth discovery, client registration and authorization with PKCE. Revoke grants through Connected clients."}, {"name": "Operations", "description": "Platform-operator attestations in the designated internal operations workspace only."}, {"name": "Webhook ingress", "description": "Server-to-server provider callbacks with provider-specific proof, not workspace API keys."}, {"name": "Dialing pools", "description": "Owned caller ID pools and side-effect-free selection previews."}, {"name": "Messaging", "description": "Channel setup and stored conversations; transport activation remains gated."}, {"name": "Memory", "description": "Workspace-scoped agent memory configuration and records."}, {"name": "Phone", "description": "The personal phone plan: previewed, approved calls and texts on one number."}, {"name": "Batches", "description": "Consent-bound outbound call batches and their recorded attempts."}, {"name": "SMS", "description": "Workspace text conversations, guarded sends and human handoff."}, {"name": "Assistant", "description": "Owner-session text Assistant settings, mobile linking and the owner's own thread."}, {"name": "Experiments", "description": "Observed comparisons between published versions of an agent."}, {"name": "Meta", "description": "The API's own front door."}, {"name": "Authentication", "description": "Credential classes and scopes."}, {"name": "Agents", "description": "The core product object: draft, preview, publish, versions."}, {"name": "Sessions", "description": "Channel-neutral conversations, and minting Web voice sessions."}, {"name": "Calls", "description": "Phone calls (telephony lifecycle)."}, {"name": "Phone numbers", "description": "Number-to-agent binding."}, {"name": "Tools", "description": "Workspace-level capabilities an agent attaches."}, {"name": "Integrations", "description": "Provider connections."}, {"name": "Compatibility", "description": "Observed read-only compatibility facades over Sempera canonical stores."}, {"name": "Snippets", "description": "Versioned workspace code a code tool pins; published versions never change."}, {"name": "Knowledge", "description": "Documents an agent answers from."}, {"name": "Personas", "description": "Compiled agent identity, one persona per agent."}, {"name": "Tests", "description": "Scripted scenarios before deployment."}, {"name": "Evals", "description": "Judging completed conversations."}, {"name": "Alerts", "description": "An organization's metric alert rules and each rule's trigger log."}, {"name": "Workspaces", "description": "The tenant boundary."}, {"name": "Credits", "description": "A workspace's credit balance and history, read only. Credits pay for building, never for live calls."}, {"name": "Automations", "description": "Triggers: an event Sempera emits, conditions on it, and one action (a signed webhook or an owner email)."}, {"name": "Platform", "description": "Deployment identity and capacity, for CI and certification."}, {"name": "Organizations", "description": "The membership and billing umbrella."}, {"name": "API keys", "description": "Minting and revoking credentials."}, {"name": "Webhooks", "description": "Sempera-signed outbound events."}, {"name": "Connected clients", "description": "Every outside client connected to a workspace, whichever way it signed in, with scopes, last use and revocation."}, {"name": "MCP", "description": "The MCP endpoint, per-client setup answers, and the revocable connections an owner gives outside AI clients."}, {"name": "Models", "description": "Sempera's customer-eligible model catalog."}, {"name": "Prompts", "description": "Stored prompts a workspace saves and reuses."}, {"name": "Scenarios", "description": "An agent's scenarios (situations): create, archive, restore, copy and history."}, {"name": "Widgets", "description": "Website widgets, web chat threads and custom components."}, {"name": "Citation schemas", "description": "The outcome fields frozen with each published version, and how well they are captured."}, {"name": "Developer settings", "description": "Developer-facing workspace settings."}, {"name": "Contacts", "description": "Workspace contact grouping, resolution and the shared contact schema."}, {"name": "Voices", "description": "The workspace voice collection: saved cleared voices, desk ratings, team sharing and professional clone preparation."}], "paths": {"/.well-known/oauth-authorization-server": {"get": {"operationId": "getOauthAuthorizationServer", "summary": "Authorization server metadata", "tags": ["OAuth"], "parameters": [], "security": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthAuthorizationServer"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/.well-known/oauth-protected-resource": {"get": {"operationId": "getOauthProtectedResource", "summary": "Protected resource metadata", "tags": ["OAuth"], "parameters": [], "security": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthProtectedResource"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/.well-known/oauth-protected-resource/v1/mcp": {"get": {"operationId": "getOauthProtectedResourceMcp", "summary": "Protected resource metadata for the MCP endpoint", "tags": ["OAuth"], "parameters": [], "security": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthProtectedResource"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/docs/{page}": {"get": {"operationId": "getDocPage", "summary": "A developer guide page (Markdown)", "tags": ["Meta"], "parameters": [{"name": "page", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [], "responses": {"200": {"description": "OK", "content": {"text/markdown": {"schema": {"type": "string"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/llms.txt": {"get": {"operationId": "getLlmsTxt", "summary": "Retrieval map for coding agents", "tags": ["Meta"], "parameters": [], "security": [], "responses": {"200": {"description": "OK", "content": {"text/plain": {"schema": {"type": "string"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/openapi.json": {"get": {"operationId": "getOpenApi", "summary": "OpenAPI 3.1 document", "tags": ["Meta"], "parameters": [], "security": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "additionalProperties": true, "description": "The generated OpenAPI 3.1 document."}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/robots.txt": {"get": {"operationId": "getRobotsTxt", "summary": "Robots policy for the API host", "tags": ["Meta"], "parameters": [], "security": [], "responses": {"200": {"description": "OK", "content": {"text/plain": {"schema": {"type": "string"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1": {"get": {"operationId": "getRoot", "summary": "API front door", "tags": ["Meta"], "parameters": [], "security": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiRoot"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agent-testing/scenarios": {"get": {"operationId": "compatListAgentTestingScenarios", "summary": "Compatibility scenario list", "tags": ["Compatibility"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agent-testing/scenarios/{uuid}/eval-agents": {"get": {"operationId": "compatListScenarioEvalAgents", "summary": "The judges that score a test scenario's calls", "tags": ["Scenarios"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agent-testing/tornado": {"post": {"operationId": "startTornadoRun", "summary": "Run bounded concurrent synthetic graph scenarios", "tags": ["Tests"], "parameters": [], "security": [{"apiKey": ["tests:write"]}], "x-sempera-scope": "tests:write", "responses": {"201": {"description": "Completed synthetic run", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "workspace_id", "agent_id", "status", "mode", "provider_calls", "service_version", "agent_sha256", "total", "passed", "failed", "concurrency", "results"], "properties": {"id": {"type": "string"}, "workspace_id": {"type": "string"}, "agent_id": {"type": "string"}, "status": {"type": "string", "enum": ["completed"]}, "mode": {"type": "string", "enum": ["synthetic_graph"]}, "provider_calls": {"type": "integer"}, "service_version": {"type": "string"}, "agent_sha256": {"type": "string"}, "total": {"type": "integer"}, "passed": {"type": "integer"}, "failed": {"type": "integer"}, "credited_sessions": {"type": "integer", "description": "Sessions that completed and were charged as simulation attempts"}, "concurrency": {"type": "integer"}, "results": {"type": "array", "items": {"type": "object", "required": ["scenario", "repeat", "passed", "trace"], "properties": {"scenario": {"type": "string"}, "repeat": {"type": "integer"}, "passed": {"type": "boolean"}, "error": {"type": "string"}, "trace": {"type": "array", "items": {"type": "object", "required": ["node", "expected", "passed"], "properties": {"node": {"type": "string"}, "expected": {"type": "string"}, "passed": {"type": "boolean"}}}}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agent-testing/tornado/{run_id}": {"get": {"operationId": "getTornadoRun", "summary": "Read a synthetic graph run receipt", "tags": ["Tests"], "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tests:read"]}], "x-sempera-scope": "tests:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "workspace_id", "agent_id", "status", "mode", "provider_calls", "service_version", "agent_sha256", "total", "passed", "failed", "concurrency", "results"], "properties": {"id": {"type": "string"}, "workspace_id": {"type": "string"}, "agent_id": {"type": "string"}, "status": {"type": "string", "enum": ["completed"]}, "mode": {"type": "string", "enum": ["synthetic_graph"]}, "provider_calls": {"type": "integer"}, "service_version": {"type": "string"}, "agent_sha256": {"type": "string"}, "total": {"type": "integer"}, "passed": {"type": "integer"}, "failed": {"type": "integer"}, "credited_sessions": {"type": "integer", "description": "Sessions that completed and were charged as simulation attempts"}, "concurrency": {"type": "integer"}, "results": {"type": "array", "items": {"type": "object", "required": ["scenario", "repeat", "passed", "trace"], "properties": {"scenario": {"type": "string"}, "repeat": {"type": "integer"}, "passed": {"type": "boolean"}, "error": {"type": "string"}, "trace": {"type": "array", "items": {"type": "object", "required": ["node", "expected", "passed"], "properties": {"node": {"type": "string"}, "expected": {"type": "string"}, "passed": {"type": "boolean"}}}}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents": {"get": {"operationId": "listAgents", "summary": "List agents", "tags": ["Agents"], "parameters": [{"name": "status", "in": "query", "schema": {"type": "string", "enum": ["active", "archived", "all"]}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createAgent", "summary": "Create an agent", "tags": ["Agents"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentCreate"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Agent"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}": {"get": {"operationId": "getAgent", "summary": "Get an agent", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Agent"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "deleteAgent", "summary": "Delete an agent (irreversible)", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentDelete"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentDeleted"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/archive": {"post": {"operationId": "archiveAgent", "summary": "Archive (reversible)", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentArchived"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/channels/api-chat": {"get": {"operationId": "getApiChatChannel", "summary": "Read API chat channel", "tags": ["Sessions"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["agent_id", "enabled", "tool_policy"], "properties": {"agent_id": {"type": "string"}, "enabled": {"type": "boolean"}, "tool_policy": {"type": "string", "enum": ["preview"]}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "updateApiChatChannel", "summary": "Enable or disable API chat", "tags": ["Sessions"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["enabled"], "properties": {"enabled": {"type": "boolean"}}, "additionalProperties": false}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["agent_id", "enabled", "tool_policy"], "properties": {"agent_id": {"type": "string"}, "enabled": {"type": "boolean"}, "tool_policy": {"type": "string", "enum": ["preview"]}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/chat": {"post": {"operationId": "sendApiChatMessage", "summary": "Send a message to the published agent", "tags": ["Sessions"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["sessions:write"]}], "x-sempera-scope": "sessions:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["message"], "properties": {"message": {"type": "string", "minLength": 1, "maxLength": 4000}, "session_id": {"type": "string"}}, "additionalProperties": false}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "object", "agent_id", "channel"], "properties": {"id": {"type": "string"}, "object": {"type": "string", "enum": ["chat"]}, "agent_id": {"type": "string"}, "channel": {"type": "string", "enum": ["api_chat"]}, "reply": {"type": "string"}, "ended": {"type": "boolean"}, "tool_policy": {"type": "string", "enum": ["preview"]}, "expires_in_seconds": {"type": "integer"}, "note": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/deployments": {"get": {"operationId": "listAgentDeployments", "summary": "Deployment ledger", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentDeploymentLedger"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/dialing-pools": {"get": {"operationId": "listDialingPools", "summary": "List dialing pools and owned number readiness", "tags": ["Dialing pools"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["pools", "numbers"], "properties": {"pools": {"type": "array", "items": {"type": "object", "required": ["id", "name", "phone_numbers", "daily_cap", "local_only", "updated_at"], "properties": {"name": {"type": "string", "maxLength": 80}, "phone_numbers": {"type": "array", "minItems": 1, "maxItems": 100, "uniqueItems": true, "items": {"type": "string", "pattern": "^\\+1[2-9]\\d{2}[2-9]\\d{6}$"}}, "daily_cap": {"type": "integer", "minimum": 1, "maximum": 100}, "local_only": {"type": "boolean"}, "id": {"type": "string"}, "updated_at": {"type": "string"}}}}, "numbers": {"type": "array", "items": {"type": "object", "properties": {"e164": {"type": "string"}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createDialingPool", "summary": "Create an owned number pool", "tags": ["Dialing pools"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "required": ["name", "phone_numbers", "daily_cap", "local_only"], "properties": {"name": {"type": "string", "maxLength": 80}, "phone_numbers": {"type": "array", "minItems": 1, "maxItems": 100, "uniqueItems": true, "items": {"type": "string", "pattern": "^\\+1[2-9]\\d{2}[2-9]\\d{6}$"}}, "daily_cap": {"type": "integer", "minimum": 1, "maximum": 100}, "local_only": {"type": "boolean"}}}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "name", "phone_numbers", "daily_cap", "local_only", "updated_at"], "properties": {"name": {"type": "string", "maxLength": 80}, "phone_numbers": {"type": "array", "minItems": 1, "maxItems": 100, "uniqueItems": true, "items": {"type": "string", "pattern": "^\\+1[2-9]\\d{2}[2-9]\\d{6}$"}}, "daily_cap": {"type": "integer", "minimum": 1, "maximum": 100}, "local_only": {"type": "boolean"}, "id": {"type": "string"}, "updated_at": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/dialing-pools/{pool_id}": {"get": {"operationId": "getDialingPool", "summary": "Read a dialing pool", "tags": ["Dialing pools"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "pool_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "name", "phone_numbers", "daily_cap", "local_only", "updated_at"], "properties": {"name": {"type": "string", "maxLength": 80}, "phone_numbers": {"type": "array", "minItems": 1, "maxItems": 100, "uniqueItems": true, "items": {"type": "string", "pattern": "^\\+1[2-9]\\d{2}[2-9]\\d{6}$"}}, "daily_cap": {"type": "integer", "minimum": 1, "maximum": 100}, "local_only": {"type": "boolean"}, "id": {"type": "string"}, "updated_at": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/dialing-pools/{pool_id}/preview": {"post": {"operationId": "previewDialingPool", "summary": "Preview caller ID without dialing or reserving", "tags": ["Dialing pools"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "pool_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["to"], "additionalProperties": false, "properties": {"to": {"type": "string"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["caller_id", "local_match", "attestation", "attestation_basis", "reserved"], "properties": {"caller_id": {"type": "string"}, "local_match": {"type": "boolean"}, "attestation": {"const": "A"}, "attestation_basis": {"type": "string"}, "reserved": {"const": false}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/dialing-pools/{pool_id}/update": {"post": {"operationId": "updateDialingPool", "summary": "Replace dialing pool settings", "tags": ["Dialing pools"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "pool_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "required": ["name", "phone_numbers", "daily_cap", "local_only"], "properties": {"name": {"type": "string", "maxLength": 80}, "phone_numbers": {"type": "array", "minItems": 1, "maxItems": 100, "uniqueItems": true, "items": {"type": "string", "pattern": "^\\+1[2-9]\\d{2}[2-9]\\d{6}$"}}, "daily_cap": {"type": "integer", "minimum": 1, "maximum": 100}, "local_only": {"type": "boolean"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "name", "phone_numbers", "daily_cap", "local_only", "updated_at"], "properties": {"name": {"type": "string", "maxLength": 80}, "phone_numbers": {"type": "array", "minItems": 1, "maxItems": 100, "uniqueItems": true, "items": {"type": "string", "pattern": "^\\+1[2-9]\\d{2}[2-9]\\d{6}$"}}, "daily_cap": {"type": "integer", "minimum": 1, "maximum": 100}, "local_only": {"type": "boolean"}, "id": {"type": "string"}, "updated_at": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/draft": {"get": {"operationId": "getAgentDraft", "summary": "Read the draft", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentDraft"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "patchAgentDraft", "summary": "Edit the draft", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentDraftPatch"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentDraft"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "discardAgentDraft", "summary": "Discard the draft", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentDraftDiscarded"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/identity": {"get": {"operationId": "getAgentIdentity", "summary": "Read agent business identity", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["profile", "verification", "revision"], "properties": {"profile": {"type": "object", "required": ["display_name", "legal_name", "phone", "email", "website", "address", "country", "registration_number"], "properties": {"display_name": {"type": "string"}, "legal_name": {"type": "string"}, "phone": {"type": "string"}, "email": {"type": "string"}, "website": {"type": "string"}, "address": {"type": "string"}, "country": {"type": "string"}, "registration_number": {"type": "string"}}}, "verification": {"type": "object", "required": ["status", "requested_at", "verified_at", "note"], "properties": {"status": {"type": "string", "enum": ["unverified", "pending_review"]}, "requested_at": {"type": ["string", "null"]}, "verified_at": {"type": "null"}, "note": {"type": "string"}}}, "revision": {"type": "integer", "minimum": 0}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "put": {"operationId": "saveAgentIdentity", "summary": "Save agent contact card and business details", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["profile", "revision"], "additionalProperties": false, "properties": {"profile": {"type": "object", "required": ["display_name", "legal_name", "phone", "email", "website", "address", "country", "registration_number"], "additionalProperties": false, "properties": {"display_name": {"type": "string", "maxLength": 160}, "legal_name": {"type": "string", "maxLength": 160}, "phone": {"type": "string", "maxLength": 160}, "email": {"type": "string", "maxLength": 160}, "website": {"type": "string", "maxLength": 500}, "address": {"type": "string", "maxLength": 500}, "country": {"type": "string", "maxLength": 160}, "registration_number": {"type": "string", "maxLength": 160}}}, "revision": {"type": "integer", "minimum": 0, "maximum": 2147483647}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["profile", "verification", "revision"], "properties": {"profile": {"type": "object", "required": ["display_name", "legal_name", "phone", "email", "website", "address", "country", "registration_number"], "properties": {"display_name": {"type": "string"}, "legal_name": {"type": "string"}, "phone": {"type": "string"}, "email": {"type": "string"}, "website": {"type": "string"}, "address": {"type": "string"}, "country": {"type": "string"}, "registration_number": {"type": "string"}}}, "verification": {"type": "object", "required": ["status", "requested_at", "verified_at", "note"], "properties": {"status": {"type": "string", "enum": ["unverified", "pending_review"]}, "requested_at": {"type": ["string", "null"]}, "verified_at": {"type": "null"}, "note": {"type": "string"}}}, "revision": {"type": "integer", "minimum": 0}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/identity/send-test": {"post": {"operationId": "testAgentContactCard", "summary": "Check the contact card delivery boundary", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["to"], "additionalProperties": false, "properties": {"to": {"type": "string", "pattern": "^\\+[1-9][0-9]{7,14}$"}}}}}}, "responses": {"400": {"description": "Invalid card or recipient", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Delivery not enabled; nothing sent", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/identity/vcard": {"get": {"operationId": "downloadAgentContactCard", "summary": "Download agent contact card", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"text/vcard": {"schema": {"type": "string"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/identity/verification": {"post": {"operationId": "requestAgentIdentityReview", "summary": "Record a business identity review request", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["revision"], "additionalProperties": false, "properties": {"revision": {"type": "integer", "minimum": 0, "maximum": 2147483647}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["profile", "verification", "revision"], "properties": {"profile": {"type": "object", "required": ["display_name", "legal_name", "phone", "email", "website", "address", "country", "registration_number"], "properties": {"display_name": {"type": "string"}, "legal_name": {"type": "string"}, "phone": {"type": "string"}, "email": {"type": "string"}, "website": {"type": "string"}, "address": {"type": "string"}, "country": {"type": "string"}, "registration_number": {"type": "string"}}}, "verification": {"type": "object", "required": ["status", "requested_at", "verified_at", "note"], "properties": {"status": {"type": "string", "enum": ["unverified", "pending_review"]}, "requested_at": {"type": ["string", "null"]}, "verified_at": {"type": "null"}, "note": {"type": "string"}}}, "revision": {"type": "integer", "minimum": 0}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/knowledge/retrieval-settings": {"get": {"operationId": "getKnowledgeRetrievalSettings", "summary": "Read version-bound knowledge retrieval settings", "tags": ["Knowledge"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:read"]}], "x-sempera-scope": "knowledge:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["settings", "revision", "applies_to", "note"], "properties": {"settings": {"type": "object", "required": ["boost_columns", "exclude_fields"], "properties": {"boost_columns": {"type": "object", "additionalProperties": {"type": "number", "minimum": 1, "maximum": 20}}, "exclude_fields": {"type": "array", "items": {"type": "string"}}}}, "revision": {"type": "string"}, "applies_to": {"type": "string", "enum": ["next_published_version"]}, "note": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "put": {"operationId": "saveKnowledgeRetrievalSettings", "summary": "Stage knowledge retrieval settings in the agent draft", "tags": ["Knowledge"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:write"]}], "x-sempera-scope": "knowledge:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["settings", "expect_revision"], "additionalProperties": false, "properties": {"expect_revision": {"type": "string"}, "settings": {"type": "object", "required": ["boost_columns", "exclude_fields"], "additionalProperties": false, "properties": {"boost_columns": {"type": "object", "maxProperties": 50, "additionalProperties": {"type": "number", "minimum": 1, "maximum": 20}}, "exclude_fields": {"type": "array", "maxItems": 50, "items": {"type": "string"}}}}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["settings", "revision", "applies_to", "note"], "properties": {"settings": {"type": "object", "required": ["boost_columns", "exclude_fields"], "properties": {"boost_columns": {"type": "object", "additionalProperties": {"type": "number", "minimum": 1, "maximum": 20}}, "exclude_fields": {"type": "array", "items": {"type": "string"}}}}, "revision": {"type": "string"}, "applies_to": {"type": "string", "enum": ["next_published_version"]}, "note": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/memory": {"patch": {"operationId": "enableMemory", "summary": "Enable or disable memory in the agent draft", "tags": ["Memory"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["enabled", "expect_revision"], "properties": {"enabled": {"type": "boolean"}, "expect_revision": {"type": "string"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["agent_id", "enabled", "revision", "published"], "properties": {"agent_id": {"type": "string"}, "enabled": {"type": "boolean"}, "revision": {"type": "string"}, "published": {"const": false}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/memory/schema": {"get": {"operationId": "getAgentMemorySchema", "summary": "Inferred caller-memory schema", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/MemorySchema"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/messaging": {"get": {"operationId": "messagingSetup", "summary": "Messaging channel setup", "tags": ["Messaging"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["data", "errors"], "properties": {"errors": {"type": "null"}, "data": {"type": "array", "items": {"type": "object", "required": ["channel", "name", "requirements", "policy", "state", "can_send", "reason"], "properties": {"channel": {"enum": ["rcs", "whatsapp", "imessage"]}, "name": {"type": "string"}, "requirements": {"type": "array", "items": {"type": "string"}}, "policy": {"type": "string"}, "state": {"const": "owner_setup_required"}, "can_send": {"const": false}, "reason": {"type": "string"}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/messaging/{channel}/conversations": {"get": {"operationId": "messagingConversations", "summary": "List channel conversations", "tags": ["Messaging"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "channel", "in": "path", "required": true, "schema": {"enum": ["rcs", "whatsapp", "imessage"]}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["data", "total", "page", "page_size", "errors"], "properties": {"data": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}}}}, "total": {"type": "integer"}, "page": {"type": "integer"}, "page_size": {"type": "integer"}, "errors": {"type": "null"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/messaging/{channel}/conversations/{conversation_id}": {"get": {"operationId": "messagingConversation", "summary": "Read channel conversation", "tags": ["Messaging"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "channel", "in": "path", "required": true, "schema": {"enum": ["rcs", "whatsapp", "imessage"]}}, {"name": "conversation_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"$ref": "#/components/schemas/SmsConversation"}, "errors": {"type": "null"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/messaging/{channel}/messages": {"post": {"operationId": "messagingSendAdmission", "summary": "Check channel send admission", "tags": ["Messaging"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "channel", "in": "path", "required": true, "schema": {"enum": ["rcs", "whatsapp", "imessage"]}}], "description": "Currently refuses every send. No message is queued or delivered.", "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "responses": {"409": {"description": "Business registration and verified connection required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/preview": {"post": {"operationId": "previewAgent", "summary": "Typed preview turn", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentPreview"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentPreviewTurn"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/publish": {"post": {"operationId": "publishAgent", "summary": "Publish a new immutable version", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["agents:publish"]}], "x-sempera-scope": "agents:publish", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentPublish"}}}}, "responses": {"201": {"description": "Published", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentPublished"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/rollback": {"post": {"operationId": "rollbackAgent", "summary": "Roll back to a previous deployment", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["agents:publish"]}], "x-sempera-scope": "agents:publish", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentRollback"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentRolledBack"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/simulations": {"post": {"operationId": "runAgentSimulations", "summary": "Run an offline simulation set", "tags": ["Tests"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["tests:write"]}], "x-sempera-scope": "tests:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["scenario_keys"], "properties": {"scenario_keys": {"type": "array", "items": {"type": "string"}, "minItems": 1, "maxItems": 20}, "repeats": {"type": "integer", "minimum": 1, "maximum": 10}}}}}}, "responses": {"202": {"description": "Simulation queued", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "client", "state", "keys", "repeats", "progress"], "properties": {"id": {"type": "string"}, "client": {"type": "string"}, "state": {"type": "string"}, "keys": {"type": "array", "items": {"type": "string"}}, "repeats": {"type": "integer"}, "progress": {"type": "object", "properties": {"done": {"type": "integer"}, "total": {"type": "integer"}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/simulations/{simulation_id}": {"get": {"operationId": "getAgentSimulation", "summary": "Read an offline simulation set", "tags": ["Tests"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "simulation_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tests:read"]}], "x-sempera-scope": "tests:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["object", "agent_id", "id", "state", "summary"], "properties": {"object": {"const": "simulation_set"}, "agent_id": {"type": "string"}, "id": {"type": "string"}, "state": {"type": "string"}, "version_number": {"type": ["integer", "null"]}, "started_at": {"type": ["string", "null"]}, "finished_at": {"type": ["string", "null"]}, "progress": {"type": ["object", "null"]}, "summary": {"type": "object", "properties": {"passed": {"type": ["integer", "null"]}, "failed": {"type": ["integer", "null"]}, "unknown": {"type": ["integer", "null"]}, "errored": {"type": ["integer", "null"]}, "pass_rate": {"type": ["number", "null"]}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/unarchive": {"post": {"operationId": "unarchiveAgent", "summary": "Restore an archived agent", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentUnarchived"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/versions": {"get": {"operationId": "listAgentVersions", "summary": "List published versions", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentVersionList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "saveAgentVersion", "summary": "Save a version of the approved agent specification", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "description": "Run the same local compiler as the App. Does not apply draft edits or promote a live environment.", "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"201": {"description": "Version saved", "content": {"application/json": {"schema": {"type": "object", "required": ["client", "ok", "version_number", "agent_version_id", "spec_hash", "compiler_version"], "properties": {"client": {"type": "string"}, "ok": {"const": true}, "version_number": {"type": ["integer", "null"]}, "agent_version_id": {"type": ["string", "null"]}, "spec_hash": {"type": ["string", "null"]}, "compiler_version": {"type": ["string", "null"]}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/agents/{agent_id}/versions/{version_id}": {"get": {"operationId": "getAgentVersion", "summary": "Get a version", "tags": ["Agents"], "parameters": [{"name": "agent_id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "The agent's stable id."}, {"name": "version_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AgentVersion"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/alerts": {"get": {"operationId": "compatListAlerts", "summary": "List this organization's metric alert rules", "tags": ["Alerts"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "page", "in": "query", "schema": {"type": "integer", "minimum": 1}}, {"name": "sort", "in": "query", "schema": {"type": "string", "enum": ["name", "status", "last_saved", "last_triggered"]}}, {"name": "direction", "in": "query", "schema": {"type": "string", "enum": ["asc", "desc"]}}, {"name": "agent_id", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createAlert", "summary": "Create a metric alert rule", "tags": ["Alerts"], "parameters": [], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/alerts/metrics": {"get": {"operationId": "listAlertMetrics", "summary": "Metrics and channels an alert rule may use", "tags": ["Alerts"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/alerts/preview": {"post": {"operationId": "previewAlert", "summary": "Preview an alert without saving or notifying", "tags": ["Alerts"], "parameters": [{"name": "hours", "in": "query", "schema": {"type": "integer", "enum": [24, 168]}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/alerts/{id}": {"get": {"operationId": "getAlert", "summary": "Get a metric alert rule and its trigger log", "tags": ["Alerts"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "updateAlert", "summary": "Update a metric alert rule", "tags": ["Alerts"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"expected_updated_at": {"type": "string", "format": "date-time", "description": "The updated_at read by the editor."}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "409": {"description": "stale_alert: nothing saved; reload or explicitly retry with the current updated_at", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "deleteAlert", "summary": "Delete a metric alert rule", "tags": ["Alerts"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/alerts/{id}/evaluate": {"post": {"operationId": "evaluateAlert", "summary": "Evaluate a metric alert rule now", "tags": ["Alerts"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/api-keys": {"get": {"operationId": "listApiKeys", "summary": "List API keys", "tags": ["API keys"], "parameters": [{"name": "status", "in": "query", "schema": {"type": "string", "enum": ["active", "all"]}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["api_keys:read"]}], "x-sempera-scope": "api_keys:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiKeyList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createApiKey", "summary": "Create an API key (secret shown once)", "tags": ["API keys"], "parameters": [], "security": [{"apiKey": ["api_keys:write"]}], "x-sempera-scope": "api_keys:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiKeyCreate"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiKeyCreated"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/api-keys/{key_id}": {"get": {"operationId": "getApiKey", "summary": "Get an API key", "tags": ["API keys"], "parameters": [{"name": "key_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["api_keys:read"]}], "x-sempera-scope": "api_keys:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiKey"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "renameApiKey", "summary": "Rename an API key", "tags": ["API keys"], "parameters": [{"name": "key_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["api_keys:write"]}], "x-sempera-scope": "api_keys:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiKeyPatch"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiKey"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "revokeApiKey", "summary": "Revoke an API key", "tags": ["API keys"], "parameters": [{"name": "key_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["api_keys:write"]}], "x-sempera-scope": "api_keys:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ApiKey"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/automation/events": {"get": {"operationId": "compatListAutomationEvents", "summary": "Events a trigger can listen for", "tags": ["Automations"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/automation/executions": {"get": {"operationId": "listAutomationExecutions", "summary": "List trigger executions", "tags": ["Automations"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0}}, {"name": "status", "in": "query", "schema": {"type": "string", "enum": ["skipped", "running", "succeeded", "failed", "unknown", "unavailable", "reviewed"]}}, {"name": "trigger_id", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/automation/executions/{id}": {"get": {"operationId": "getAutomationExecution", "summary": "Get a trigger execution", "tags": ["Automations"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/automation/executions/{id}/retry": {"post": {"operationId": "retryAutomationExecution", "summary": "Send a failed or stalled webhook or tool run again, once", "tags": ["Automations"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/automation/pipelines": {"post": {"operationId": "createAutomationPipeline", "summary": "Create a trigger (one record)", "tags": ["Automations"], "parameters": [], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/automation/triggers": {"get": {"operationId": "compatListAutomationTriggers", "summary": "List this organization's triggers", "tags": ["Automations"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0}}, {"name": "sort", "in": "query", "schema": {"type": "string", "enum": ["recent", "runs", "active", "name"]}}, {"name": "agent_id", "in": "query", "schema": {"type": "string"}}, {"name": "event", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createAutomationTrigger", "summary": "Create a trigger", "tags": ["Automations"], "parameters": [], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/automation/triggers/{id}": {"get": {"operationId": "getAutomationTrigger", "summary": "Get a trigger", "tags": ["Automations"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "updateAutomationTrigger", "summary": "Update, pause or resume a trigger", "tags": ["Automations"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "409": {"description": "conflict with reason stale_trigger: the optional expected_updated_at sent is not the trigger's updated_at any more; nothing is written, and the error names the updated_at on file", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "deleteAutomationTrigger", "summary": "Delete a trigger", "tags": ["Automations"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/automation/triggers/{id}/executions": {"get": {"operationId": "listAutomationTriggerExecutions", "summary": "A trigger's executions", "tags": ["Automations"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0}}, {"name": "status", "in": "query", "schema": {"type": "string", "enum": ["skipped", "running", "succeeded", "failed", "unknown", "unavailable", "reviewed"]}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/automation/triggers/{id}/test": {"post": {"operationId": "testAutomationTrigger", "summary": "Dry-run a trigger against a sample event (nothing is delivered)", "tags": ["Automations"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/byot/manage/check": {"post": {"operationId": "compatCheckByot", "summary": "Compatibility BYOT check", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/calls": {"get": {"operationId": "listCalls", "summary": "List phone calls for an agent", "tags": ["Calls"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CallList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createCall", "summary": "Create an outbound call", "tags": ["Calls"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "description": "Places one outbound call on a named line. mode prompt runs only the prompt; the line still supplies the number, consent, do-not-contact, calling hours, caps and billing. The prompt-only mark is not a caller field and skips no check.", "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CallCreate"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Call"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/calls/active": {"get": {"operationId": "compatListActiveCalls", "summary": "Compatibility active calls", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/calls/active/stop": {"post": {"operationId": "stopActiveCalls", "summary": "Stop all active phone calls in this credential's scope", "tags": ["Calls"], "parameters": [], "description": "Stops a snapshot, not future calls. Each result reports its own outcome. Owner role required.", "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["reason"], "additionalProperties": false, "properties": {"agent_id": {"type": "string"}, "reason": {"type": "string", "minLength": 1, "maxLength": 200}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["data", "total", "stopped"], "properties": {"data": {"type": "array", "items": {"type": "object", "required": ["id", "agent_id", "stopped"], "properties": {"id": {"type": ["string", "null"]}, "agent_id": {"type": "string"}, "stopped": {"type": "boolean"}, "error": {"type": "object", "required": ["code", "message"], "properties": {"code": {"type": "string"}, "message": {"type": "string"}}}}}}, "total": {"type": "integer"}, "stopped": {"type": "integer"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/calls/active/stream": {"get": {"operationId": "compatStreamActiveCalls", "summary": "Compatibility active calls stream", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"text/event-stream": {"schema": {"type": "string", "description": "One SSE snapshot event containing the active-calls compatibility envelope."}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/calls/active/transfer": {"post": {"operationId": "transferActiveCall", "summary": "Transfer an active phone call", "tags": ["Calls"], "parameters": [], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["reason", "call_id", "to"], "additionalProperties": false, "properties": {"agent_id": {"type": "string"}, "reason": {"type": "string", "minLength": 1, "maxLength": 200}, "call_id": {"type": "string"}, "to": {"type": "string", "pattern": "^\\+[1-9][0-9]{6,14}$"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "agent_id", "transferred"], "properties": {"id": {"type": ["string", "null"]}, "agent_id": {"type": "string"}, "transferred": {"type": "boolean"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/calls/{call_id}": {"get": {"operationId": "getCall", "summary": "Get a phone call", "tags": ["Calls"], "parameters": [{"name": "call_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Call"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/calls/{call_id}/analyze": {"post": {"operationId": "analyzeCall", "summary": "Ask questions about a finished phone call", "tags": ["Calls"], "parameters": [{"name": "call_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "schema": {"type": "string"}}], "description": "Uses evaluation credits. Answers require transcript evidence; missing information is unknown. Results are returned, not stored.", "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["questions"], "additionalProperties": false, "properties": {"questions": {"type": "array", "minItems": 1, "maxItems": 10, "items": {"type": "string", "minLength": 1, "maxLength": 500}}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "agent_id", "object", "answers"], "properties": {"id": {"type": "string"}, "agent_id": {"type": "string"}, "object": {"const": "call_analysis"}, "answers": {"type": "array", "items": {"type": "object", "required": ["question", "answer", "evidence", "status"], "properties": {"question": {"type": "string"}, "answer": {"type": ["string", "null"]}, "evidence": {"type": "string"}, "status": {"enum": ["answered", "unknown"]}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/calls/{call_id}/corrected-transcript": {"get": {"operationId": "getCorrectedTranscript", "summary": "Read a corrected transcript with speaker labels and turn confidence", "tags": ["Calls"], "parameters": [{"name": "call_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["object", "call_id", "source", "provenance", "verified", "confidence_kind", "segments"], "properties": {"object": {"type": "string", "enum": ["corrected_transcript"]}, "call_id": {"type": "string"}, "source": {"type": "string", "enum": ["human_review", "recording_analysis"], "description": "How the importer says it was made. Not verified by Sempera."}, "provenance": {"type": "string", "enum": ["owner_import"]}, "verified": {"type": "boolean", "description": "Always false: Sempera does not verify imported corrections."}, "confidence_kind": {"type": "string", "enum": ["importer_reported"]}, "corrected_at": {"type": "string", "format": "date-time"}, "corrected_by": {"type": "string"}, "segments": {"type": "array", "items": {"type": "object", "required": ["start", "end", "speaker", "speaker_label", "text", "confidence"], "properties": {"start": {"type": "number", "minimum": 0}, "end": {"type": "number", "minimum": 0}, "speaker": {"type": "integer", "minimum": 0, "maximum": 99}, "speaker_label": {"type": "string", "enum": ["caller", "assistant", "unknown"]}, "text": {"type": "string", "minLength": 1, "maxLength": 10000}, "confidence": {"type": "number", "minimum": 0, "maximum": 1}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "importCorrectedTranscript", "summary": "Import a corrected transcript; it reads as an unverified owner import", "tags": ["Calls"], "parameters": [{"name": "call_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["source", "segments"], "properties": {"source": {"type": "string", "enum": ["human_review", "recording_analysis"], "description": "How the importer says it was made. Not verified by Sempera."}, "segments": {"type": "array", "minItems": 1, "maxItems": 5000, "items": {"type": "object", "required": ["start", "end", "speaker", "speaker_label", "text", "confidence"], "properties": {"start": {"type": "number", "minimum": 0}, "end": {"type": "number", "minimum": 0}, "speaker": {"type": "integer", "minimum": 0, "maximum": 99}, "speaker_label": {"type": "string", "enum": ["caller", "assistant", "unknown"]}, "text": {"type": "string", "minLength": 1, "maxLength": 10000}, "confidence": {"type": "number", "minimum": 0, "maximum": 1}}}}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["object", "call_id", "source", "provenance", "verified", "confidence_kind", "segments"], "properties": {"object": {"type": "string", "enum": ["corrected_transcript"]}, "call_id": {"type": "string"}, "source": {"type": "string", "enum": ["human_review", "recording_analysis"], "description": "How the importer says it was made. Not verified by Sempera."}, "provenance": {"type": "string", "enum": ["owner_import"]}, "verified": {"type": "boolean", "description": "Always false: Sempera does not verify imported corrections."}, "confidence_kind": {"type": "string", "enum": ["importer_reported"]}, "corrected_at": {"type": "string", "format": "date-time"}, "corrected_by": {"type": "string"}, "segments": {"type": "array", "items": {"type": "object", "required": ["start", "end", "speaker", "speaker_label", "text", "confidence"], "properties": {"start": {"type": "number", "minimum": 0}, "end": {"type": "number", "minimum": 0}, "speaker": {"type": "integer", "minimum": 0, "maximum": 99}, "speaker_label": {"type": "string", "enum": ["caller", "assistant", "unknown"]}, "text": {"type": "string", "minLength": 1, "maxLength": 10000}, "confidence": {"type": "number", "minimum": 0, "maximum": 1}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/calls/{call_id}/stop": {"post": {"operationId": "stopCall", "summary": "Stop one active phone call", "tags": ["Calls"], "parameters": [{"name": "call_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["reason"], "additionalProperties": false, "properties": {"agent_id": {"type": "string"}, "reason": {"type": "string", "minLength": 1, "maxLength": 200}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "agent_id", "stopped"], "properties": {"id": {"type": ["string", "null"]}, "agent_id": {"type": "string"}, "stopped": {"type": "boolean"}, "error": {"type": "object", "required": ["code", "message"], "properties": {"code": {"type": "string"}, "message": {"type": "string"}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/calls/{call_id}/translate": {"post": {"operationId": "translateCall", "summary": "Translate a finished phone call's transcript", "tags": ["Calls"], "parameters": [{"name": "call_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "schema": {"type": "string"}}], "description": "Uses evaluation credits. Every line of the finished call in the target language, or nothing. Results are returned, not stored.", "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["target"], "additionalProperties": false, "properties": {"target": {"type": "string"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "agent_id", "object", "target", "lines"], "properties": {"id": {"type": "string"}, "agent_id": {"type": "string"}, "object": {"const": "call_translation"}, "target": {"type": "string"}, "lines": {"type": "array", "items": {"type": "object", "required": ["turn", "side", "text", "translation"], "properties": {"turn": {"type": "integer"}, "side": {"enum": ["caller", "say"]}, "text": {"type": "string"}, "translation": {"type": "string"}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/citation_schemas": {"get": {"operationId": "listCitationSchemas", "summary": "List citation schemas", "tags": ["Citation schemas"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CitationSchemaList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/citation_schemas/backfill": {"post": {"operationId": "backfillCitationSchemas", "summary": "Score extraction quality over call history", "tags": ["Citation schemas"], "parameters": [], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CitationSchemaBackfill"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CitationSchemaBackfillResult"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/citation_schemas/list": {"get": {"operationId": "listCitationSchemasListPath", "summary": "List citation schemas (the /list path)", "tags": ["Citation schemas"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CitationSchemaList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/client-grants": {"get": {"operationId": "listClientGrants", "summary": "List connected clients", "tags": ["Connected clients"], "parameters": [{"name": "status", "in": "query", "schema": {"type": "string", "enum": ["active", "all"]}}], "description": "Every outside client connected to this workspace: OAuth grants, MCP keys and REST credentials, with scopes and last use.", "security": [{"apiKey": ["api_keys:read"]}], "x-sempera-scope": "api_keys:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientGrantList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/client-grants/rest": {"post": {"operationId": "createClientRestCredential", "summary": "Create a scoped REST credential (secret shown once)", "tags": ["Connected clients"], "parameters": [], "description": "One credential for one client that cannot use OAuth, usable on the phone routes only.", "security": [{"apiKey": ["api_keys:write"]}], "x-sempera-scope": "api_keys:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["client", "scopes"], "properties": {"client": {"type": "string", "enum": ["muse"]}, "scopes": {"type": "array", "items": {"type": "string", "enum": ["phone:read", "phone:call", "phone:text"]}}, "expires_in_days": {"type": "integer", "minimum": 1, "maximum": 365}}}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientGrantCreated"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/client-grants/{grant_id}": {"delete": {"operationId": "revokeClientGrant", "summary": "Disconnect one client", "tags": ["Connected clients"], "parameters": [{"name": "grant_id", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "End one client's access. Every other client keeps working.", "security": [{"apiKey": ["api_keys:write"]}], "x-sempera-scope": "api_keys:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ClientGrant"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/analysis_presets": {"get": {"operationId": "compatAppListAnalysisPresets", "summary": "Console compatibility analysis presets", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/authorization/get-session": {"get": {"operationId": "compatAppGetSession", "summary": "Console compatibility session", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatSession"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/billing/agent_phone": {"get": {"operationId": "compatAppGetAgentPhoneBilling", "summary": "Console compatibility phone billing", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["organizations:read"]}], "x-sempera-scope": "organizations:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/billing/customer": {"get": {"operationId": "compatAppGetCustomerBilling", "summary": "Console compatibility customer billing", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["organizations:read"]}], "x-sempera-scope": "organizations:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/byot/get": {"get": {"operationId": "compatAppListByot", "summary": "Console compatibility BYOT list", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["phone_numbers:read"]}], "x-sempera-scope": "phone_numbers:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/call_config/read": {"get": {"operationId": "compatAppReadCallConfig", "summary": "Console compatibility call configs", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/dashboards/list": {"get": {"operationId": "compatAppListDashboards", "summary": "Console compatibility dashboards", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/inbound/get_inbound": {"get": {"operationId": "compatAppListInbound", "summary": "Console compatibility inbound numbers", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["phone_numbers:read"]}], "x-sempera-scope": "phone_numbers:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatInboundNumbers"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/keys/list": {"post": {"operationId": "compatAppListKeys", "summary": "Console compatibility key list", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["api_keys:write"]}], "x-sempera-scope": "api_keys:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/orgs/{uuid}/billing": {"get": {"operationId": "compatAppGetOrgBilling", "summary": "Console compatibility org billing", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["organizations:read"]}], "x-sempera-scope": "organizations:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/orgs/{uuid}/invites": {"get": {"operationId": "compatAppListOrgInvites", "summary": "Console compatibility org invites", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["organizations:read"]}], "x-sempera-scope": "organizations:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/orgs/{uuid}/members": {"get": {"operationId": "compatAppListOrgMembers", "summary": "Console compatibility org members", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["organizations:read"]}], "x-sempera-scope": "organizations:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/pay/purchases": {"post": {"operationId": "compatAppCreatePurchase", "summary": "Console compatibility purchases", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["workspaces:write"]}], "x-sempera-scope": "workspaces:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/user/getCurrentWebhook": {"get": {"operationId": "compatAppGetCurrentWebhook", "summary": "Console compatibility webhook", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["webhooks:read"]}], "x-sempera-scope": "webhooks:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatCurrentWebhook"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/user/logs": {"get": {"operationId": "compatAppListUserLogs", "summary": "Console compatibility call logs", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/user/logs/{uuid}": {"get": {"operationId": "compatAppGetUserLog", "summary": "Console compatibility call log", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/user/logs/{uuid}/enrich": {"get": {"operationId": "compatAppGetUserLogEnrich", "summary": "Console compatibility enriched call log", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/user/rateLimits": {"get": {"operationId": "compatAppGetRateLimits", "summary": "Console compatibility rate limits", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["organizations:read"]}], "x-sempera-scope": "organizations:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/user/{id}": {"get": {"operationId": "compatAppGetUser", "summary": "Console compatibility missing user", "tags": ["Compatibility"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"404": {"description": "User not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatMissingUser"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/compat/app/{org_uuid}/kb/{kb_uuid}/{asset_uuid}": {"get": {"operationId": "compatAppGetKnowledgeAsset", "summary": "Console compatibility knowledge asset", "tags": ["Compatibility"], "parameters": [{"name": "org_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "kb_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "asset_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:read"]}], "x-sempera-scope": "knowledge:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "string"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/contacts": {"get": {"operationId": "compatListContacts", "summary": "Compatibility contacts", "tags": ["Compatibility"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/contacts/merge": {"post": {"operationId": "mergeContacts", "summary": "Merge console contact profiles", "tags": ["Contacts"], "parameters": [], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["source_id", "target_id"], "additionalProperties": false, "properties": {"source_id": {"type": "string", "format": "uuid"}, "target_id": {"type": "string", "format": "uuid"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "merged", "note"], "properties": {"id": {"type": "string", "format": "uuid"}, "merged": {"type": "boolean"}, "note": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/contacts/resolve": {"post": {"operationId": "resolveContact", "summary": "Resolve a workspace contact without guessing", "tags": ["Contacts"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "requestBody": {"required": true, "content": {"application/json": {"schema": {"oneOf": [{"type": "object", "required": ["contact_id"], "additionalProperties": false, "properties": {"contact_id": {"type": "string", "format": "uuid"}}}, {"type": "object", "required": ["phone"], "additionalProperties": false, "properties": {"phone": {"type": "string", "pattern": "^\\+[1-9][0-9]{7,14}$"}, "name": {"type": "string", "maxLength": 120}}}]}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["status", "contact", "candidates"], "properties": {"status": {"type": "string", "enum": ["resolved", "ambiguous", "not_found"]}, "contact": {"oneOf": [{"type": "object", "required": ["id", "name", "identifiers"], "properties": {"id": {"type": "string", "format": "uuid"}, "org_id": {"type": "string"}, "name": {"type": ["string", "null"]}, "names": {"type": "array", "items": {"type": "string"}}, "metadata": {"type": "object", "maxProperties": 0}, "created_at": {"type": "string"}, "updated_at": {"type": "string"}, "messages": {"type": "integer"}, "identifiers": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "contact_id": {"type": "string"}, "identifier_type": {"type": "string"}, "identifier_value": {"type": "string"}, "is_primary": {"type": "boolean"}}}}, "memories": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "agent_id": {"type": "string"}, "summary": {"type": "string"}}}}}}, {"type": "null"}]}, "candidates": {"type": "array", "items": {"type": "object", "required": ["id", "name"], "properties": {"id": {"type": "string", "format": "uuid"}, "name": {"type": ["string", "null"]}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/contacts/schema": {"get": {"operationId": "getContactSchema", "summary": "Read organisation contact schema", "tags": ["Contacts"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["fields", "revision"], "properties": {"revision": {"type": "integer", "minimum": 0}, "fields": {"type": "array", "items": {"type": "object", "required": ["name", "type", "description", "required"], "properties": {"name": {"type": "string"}, "type": {"type": "string", "enum": ["string", "number", "boolean", "date"]}, "description": {"type": "string"}, "required": {"type": "boolean"}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "put": {"operationId": "saveContactSchema", "summary": "Save organisation contact schema", "tags": ["Contacts"], "parameters": [], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["fields", "revision"], "additionalProperties": false, "properties": {"revision": {"type": "integer", "minimum": 0, "maximum": 2147483647}, "fields": {"type": "array", "maxItems": 50, "items": {"type": "object", "required": ["name", "type", "description", "required"], "additionalProperties": false, "properties": {"name": {"type": "string", "pattern": "^[a-z][a-z0-9_]{0,63}$"}, "type": {"type": "string", "enum": ["string", "number", "boolean", "date"]}, "description": {"type": "string", "maxLength": 500}, "required": {"type": "boolean"}}}}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["fields", "revision"], "properties": {"revision": {"type": "integer", "minimum": 0}, "fields": {"type": "array", "items": {"type": "object", "required": ["name", "type", "description", "required"], "properties": {"name": {"type": "string"}, "type": {"type": "string", "enum": ["string", "number", "boolean", "date"]}, "description": {"type": "string"}, "required": {"type": "boolean"}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/contacts/{contact_id}": {"get": {"operationId": "compatGetContact", "summary": "Compatibility contact detail", "tags": ["Compatibility"], "parameters": [{"name": "contact_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Invalid contact ID", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Contact not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/convo_pathway/migration_split/enabled": {"get": {"operationId": "compatGetMigrationSplit", "summary": "Compatibility migration flag", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/credits": {"get": {"operationId": "getCreditBalance", "summary": "Read the workspace's credit balance", "tags": ["Credits"], "parameters": [], "description": "Credits pay for building: Assistant turns, simulations and evals, test voice calls and knowledge processing. Live agents and phone calls never spend them.", "security": [{"apiKey": ["organizations:read"]}], "x-sempera-scope": "organizations:read", "responses": {"200": {"description": "The balance, what is on hold, and what each action costs.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditBalance"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/credits/history": {"get": {"operationId": "listCreditHistory", "summary": "List the workspace's credit history", "tags": ["Credits"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "before", "in": "query", "schema": {"type": "integer", "minimum": 1}, "description": "The `next_before` of the previous page."}], "security": [{"apiKey": ["organizations:read"]}], "x-sempera-scope": "organizations:read", "responses": {"200": {"description": "Every grant, purchase, spend and refund, newest first.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreditHistory"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/dispositions/": {"get": {"operationId": "compatListDispositions", "summary": "List this workspace's dispositions", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals": {"get": {"operationId": "listEvals", "summary": "List eval criteria", "tags": ["Evals"], "parameters": [{"name": "status", "in": "query", "schema": {"type": "string", "enum": ["active", "all"]}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EvalList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createEval", "summary": "Create an eval criterion", "tags": ["Evals"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EvalCreate"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Eval"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals/agent-templates": {"get": {"operationId": "compatListEvalAgentTemplates", "summary": "Judge templates Sempera ships", "tags": ["Evals"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals/agents": {"get": {"operationId": "compatListEvalAgents", "summary": "This workspace's judges with their latest run", "tags": ["Evals"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals/quick-run": {"post": {"operationId": "quickRunEvalTemplate", "summary": "Score one judge template against an agent's recent calls (not saved)", "tags": ["Evals"], "parameters": [], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EvalQuickRun"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals/results": {"get": {"operationId": "getEvalResults", "summary": "Eval results for an agent", "tags": ["Evals"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EvalResults"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals/run": {"post": {"operationId": "runEvals", "summary": "Judge an agent's completed conversations", "tags": ["Evals"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "description": "Scores the agent's completed conversations that are not yet scored. The answer carries run_id, which GET /v1/evals/runs/{run_id} reads back.", "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EvalRunCreate"}}}}, "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EvalRunAccepted"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals/runs": {"get": {"operationId": "listEvalRuns", "summary": "Evaluation runs of this workspace's agents", "tags": ["Evals"], "parameters": [{"name": "agent_id", "in": "query", "schema": {"type": "string"}}, {"name": "status", "in": "query", "schema": {"type": "string", "enum": ["completed", "partial"]}}, {"name": "since", "in": "query", "schema": {"type": "string", "format": "date"}}, {"name": "until", "in": "query", "schema": {"type": "string", "format": "date"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "description": "Runs recorded by POST /v1/evals/run, newest first. A run from before runs were recorded is not listed.", "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EvalRunList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals/runs/{run_id}": {"get": {"operationId": "getEvalRun", "summary": "One evaluation run with its results", "tags": ["Evals"], "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "One run with a result per call and judge, how each differs from the previous run of the same suite, and the body to start it again. A run of another workspace is not_found.", "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EvalRun"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals/test-cases": {"get": {"operationId": "listEvalTestCases", "summary": "Calls a judge can score, with their verdicts", "tags": ["Evals"], "parameters": [{"name": "agent_id", "in": "query", "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EvalTestCaseList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals/user-templates": {"get": {"operationId": "compatListEvalUserTemplates", "summary": "Saved judge suites for this workspace", "tags": ["Evals"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createEvalUserTemplate", "summary": "Save a judge suite (a named bundle of templates for one agent)", "tags": ["Evals"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/JudgeSuite"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals/{eval_id}": {"get": {"operationId": "getEval", "summary": "Get an eval criterion", "tags": ["Evals"], "parameters": [{"name": "eval_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Eval"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "updateEval", "summary": "Update an eval criterion", "tags": ["Evals"], "parameters": [{"name": "eval_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/EvalUpdate"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Eval"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "deleteEval", "summary": "Archive an eval criterion", "tags": ["Evals"], "parameters": [{"name": "eval_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Eval"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals/{eval_id}/align": {"post": {"operationId": "alignJudge", "summary": "Propose judge tuning from corrected production-call verdicts; save nothing", "tags": ["Evals"], "parameters": [{"name": "eval_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["revision", "corrections"], "properties": {"revision": {"type": "integer"}, "corrections": {"type": "array", "minItems": 1, "maxItems": 10, "items": {"type": "object", "required": ["call_id", "verdict", "explanation"], "properties": {"call_id": {"type": "string"}, "verdict": {"type": "string", "enum": ["pass", "fail"]}, "explanation": {"type": "string", "minLength": 1, "maxLength": 1000}}}}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["object", "eval_id", "revision", "saved", "definition", "rationale", "evidence", "satisfies_release_gates"], "properties": {"object": {"type": "string", "enum": ["judge_alignment"]}, "eval_id": {"type": "string"}, "revision": {"type": "integer"}, "saved": {"type": "boolean"}, "definition": {"type": "object", "description": "The proposed judge definition. Apply it with the revision-checked eval update."}, "rationale": {"type": "string"}, "evidence": {"type": "object", "properties": {"example_count": {"type": "integer"}, "basis": {"type": "string"}, "agreement_before": {"type": "integer"}, "agreement_after": {"type": "integer"}}}, "satisfies_release_gates": {"type": "boolean"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals/{eval_id}/production-calls": {"get": {"operationId": "listJudgeProductionCalls", "summary": "Recent completed production calls available to this judge", "tags": ["Evals"], "parameters": [{"name": "eval_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["data", "truncated", "window_limit"], "properties": {"data": {"type": "array", "items": {"type": "object", "required": ["call_id", "agent_id", "started_at"], "properties": {"call_id": {"type": "string"}, "agent_id": {"type": "string"}, "started_at": {"type": ["string", "null"], "format": "date-time"}}}}, "truncated": {"type": "boolean"}, "window_limit": {"type": "integer"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/evals/{eval_id}/production-run": {"post": {"operationId": "runProductionJudge", "summary": "Evaluate selected stored production calls without saving a second copy", "tags": ["Evals"], "parameters": [{"name": "eval_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["call_ids"], "properties": {"call_ids": {"type": "array", "minItems": 1, "maxItems": 10, "items": {"type": "string"}}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["object", "eval_id", "revision", "mode", "saved", "satisfies_release_gates", "results"], "properties": {"object": {"type": "string", "enum": ["production_judge_run"]}, "eval_id": {"type": "string"}, "revision": {"type": "integer"}, "mode": {"type": "string", "enum": ["transcript", "audio"]}, "saved": {"type": "boolean"}, "satisfies_release_gates": {"type": "boolean"}, "results": {"type": "array", "items": {"type": "object", "required": ["call_id", "agent_id", "verdict", "score", "rationale", "signals", "reason"], "properties": {"call_id": {"type": "string"}, "agent_id": {"type": "string"}, "verdict": {"type": ["string", "null"], "description": "pass, fail or unknown. Unknown is never charged."}, "score": {"type": ["number", "null"]}, "rationale": {"type": ["string", "null"]}, "signals": {"type": ["object", "null"], "description": "Recording signal measurements for audio judges."}, "reason": {"type": ["string", "null"]}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/files/list": {"get": {"operationId": "compatListFiles", "summary": "Compatibility files list", "tags": ["Compatibility"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:read"]}], "x-sempera-scope": "knowledge:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/health": {"get": {"operationId": "getHealth", "summary": "Liveness", "tags": ["Meta"], "parameters": [], "security": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Health"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/integrations": {"get": {"operationId": "listIntegrations", "summary": "List integrations", "tags": ["Integrations"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["integrations:read"]}], "x-sempera-scope": "integrations:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createIntegration", "summary": "Create an integration", "tags": ["Integrations"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["integrations:write"]}], "x-sempera-scope": "integrations:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationCreate"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Integration"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/integrations/{integration_id}": {"get": {"operationId": "getIntegration", "summary": "Compatibility integration detail", "tags": ["Integrations"], "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["integrations:read"]}], "x-sempera-scope": "integrations:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "updateIntegration", "summary": "Update an integration", "tags": ["Integrations"], "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["integrations:write"]}], "x-sempera-scope": "integrations:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationUpdate"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Integration"}}}}, "409": {"description": "conflict with reason stale_connection: the integration has a newer revision than the one sent; nothing is written, and the error names the revision on file", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "deleteIntegration", "summary": "Disable an integration", "tags": ["Integrations"], "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "restore", "in": "query", "schema": {"type": "string", "enum": ["1"]}}, {"name": "revision", "in": "query", "schema": {"type": "integer"}}], "security": [{"apiKey": ["integrations:write"]}], "x-sempera-scope": "integrations:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Integration"}}}}, "409": {"description": "conflict with reason stale_connection: the optional revision sent is older than the integration's; nothing is archived or restored, and the error names the revision on file", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/integrations/{integration_id}/actions": {"get": {"operationId": "listIntegrationActions", "summary": "Compatibility integration actions", "tags": ["Integrations"], "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["integrations:read"]}], "x-sempera-scope": "integrations:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/integrations/{integration_id}/verify": {"post": {"operationId": "verifyIntegration", "summary": "Verify an integration's connection", "tags": ["Integrations"], "parameters": [{"name": "integration_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["integrations:write"]}], "x-sempera-scope": "integrations:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/IntegrationVerification"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge-sources": {"get": {"operationId": "listKnowledgeSources", "summary": "List an agent's knowledge sources", "tags": ["Knowledge"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:read"]}], "x-sempera-scope": "knowledge:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/KnowledgeSourceList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createKnowledgeSource", "summary": "Upload a document (multipart)", "tags": ["Knowledge"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:write"]}], "x-sempera-scope": "knowledge:write", "requestBody": {"required": true, "content": {"multipart/form-data": {"schema": {"$ref": "#/components/schemas/KnowledgeSourceUpload"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/KnowledgeSource"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge-sources/text": {"post": {"operationId": "createTextKnowledgeSource", "summary": "Create a plain-text knowledge source", "tags": ["Knowledge"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["knowledge:write"]}], "x-sempera-scope": "knowledge:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["agent_id", "name", "content"], "properties": {"agent_id": {"type": "string"}, "name": {"type": "string"}, "content": {"type": "string"}}}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/KnowledgeSource"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge-sources/{source_id}": {"patch": {"operationId": "updateKnowledgeSource", "summary": "Update a text source without publishing the agent", "tags": ["Knowledge"], "parameters": [{"name": "source_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:write"]}], "x-sempera-scope": "knowledge:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["content"], "properties": {"content": {"type": "string"}, "expect_revision": {"type": "string"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/KnowledgeSource"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "get": {"operationId": "getKnowledgeSource", "summary": "Get a knowledge source", "tags": ["Knowledge"], "parameters": [{"name": "source_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:read"]}], "x-sempera-scope": "knowledge:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/KnowledgeSource"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "deleteKnowledgeSource", "summary": "Remove a knowledge source", "tags": ["Knowledge"], "parameters": [{"name": "source_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:write"]}], "x-sempera-scope": "knowledge:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/KnowledgeSourceDeleted"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge-sources/{source_id}/reparse": {"post": {"operationId": "reparseKnowledgeSource", "summary": "Re-process a source", "tags": ["Knowledge"], "parameters": [{"name": "source_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:write"]}], "x-sempera-scope": "knowledge:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/KnowledgeSourceReparsed"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge/chat": {"post": {"operationId": "chatKnowledge", "summary": "Ask knowledge using local retrieval, with cited passages", "tags": ["Knowledge"], "parameters": [], "security": [{"apiKey": ["knowledge:write"]}], "x-sempera-scope": "knowledge:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["agent_id", "question"], "properties": {"agent_id": {"type": "string"}, "question": {"type": "string"}, "source_ids": {"type": "array", "items": {"type": "string"}, "maxItems": 50}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["question", "mode", "verdict", "results"], "properties": {"question": {"type": "string"}, "mode": {"enum": ["published", "selected_sources"]}, "verdict": {"type": "string"}, "reason": {"type": "string"}, "coverage": {"type": "number"}, "results": {"type": "array", "items": {"type": "object"}}, "built": {"type": "boolean"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge/crawl": {"post": {"operationId": "crawlKnowledge", "summary": "Read one public page or refresh a previously read page", "tags": ["Knowledge"], "parameters": [], "security": [{"apiKey": ["knowledge:write"]}], "x-sempera-scope": "knowledge:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["agent_id"], "properties": {"agent_id": {"type": "string"}, "url": {"type": "string"}, "source_id": {"type": "string"}, "collection": {"type": "string"}}}}}}, "responses": {"200": {"description": "Existing page refreshed", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "client", "document"], "properties": {"ok": {"const": true}, "client": {"type": "string"}, "document": {"type": "object"}, "changed": {"type": "boolean"}, "will_happen": {"type": "string"}, "will_not_happen": {"type": "string"}}}}}}, "201": {"description": "Page added", "content": {"application/json": {"schema": {"type": "object", "required": ["ok", "client", "document"], "properties": {"ok": {"const": true}, "client": {"type": "string"}, "document": {"type": "object"}, "changed": {"type": "boolean"}, "will_happen": {"type": "string"}, "will_not_happen": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge/map": {"get": {"operationId": "compatGetKnowledgeMap", "summary": "Compatibility knowledge map", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["knowledge:read"]}], "x-sempera-scope": "knowledge:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge/queries": {"get": {"operationId": "compatListKnowledgeQueries", "summary": "Compatibility knowledge queries", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["knowledge:read"]}], "x-sempera-scope": "knowledge:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge/questions/{question_id}": {"patch": {"operationId": "changeKnowledgeQuestion", "summary": "Link, delete or dismiss a recorded knowledge question", "tags": ["Knowledge"], "parameters": [{"name": "question_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:write"]}], "x-sempera-scope": "knowledge:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["agent_id", "question", "revision", "action"], "additionalProperties": false, "properties": {"agent_id": {"type": "string"}, "question": {"type": "string", "maxLength": 2000}, "revision": {"type": "integer", "minimum": 0}, "action": {"enum": ["link", "delete", "dismiss"]}, "source_id": {"type": "string"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "state", "revision", "note"], "properties": {"id": {"type": "string"}, "state": {"enum": ["resolved", "deleted", "dismissed"]}, "revision": {"type": "integer"}, "note": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge/questions/{question_id}/answer": {"put": {"operationId": "answerKnowledgeQuestion", "summary": "Ingest an answer and resolve a recorded question", "tags": ["Knowledge"], "parameters": [{"name": "question_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:write"]}], "x-sempera-scope": "knowledge:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["agent_id", "question", "revision", "answer"], "additionalProperties": false, "properties": {"agent_id": {"type": "string"}, "question": {"type": "string", "maxLength": 2000}, "revision": {"type": "integer", "minimum": 0}, "answer": {"type": "string", "minLength": 1, "maxLength": 20000}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "state", "revision", "source_id", "note"], "properties": {"id": {"type": "string"}, "state": {"const": "resolved"}, "revision": {"type": "integer"}, "source_id": {"type": "string"}, "note": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge/sources": {"get": {"operationId": "compatListKnowledgeSources", "summary": "Compatibility knowledge sources", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["knowledge:read"]}], "x-sempera-scope": "knowledge:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge/sources/picker": {"get": {"operationId": "compatListKnowledgeSourcesPicker", "summary": "Compatibility knowledge picker", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["knowledge:read"]}], "x-sempera-scope": "knowledge:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge/test": {"post": {"operationId": "testKnowledgeSources", "summary": "Test local retrieval against selected or published knowledge", "tags": ["Knowledge"], "parameters": [], "security": [{"apiKey": ["knowledge:write"]}], "x-sempera-scope": "knowledge:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["agent_id", "question"], "properties": {"agent_id": {"type": "string"}, "question": {"type": "string"}, "source_ids": {"type": "array", "items": {"type": "string"}, "maxItems": 50}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["question", "mode", "verdict", "results"], "properties": {"question": {"type": "string"}, "mode": {"type": "string", "enum": ["published", "selected_sources"]}, "verdict": {"type": "string"}, "reason": {"type": "string"}, "coverage": {"type": "number"}, "results": {"type": "array", "items": {"type": "object"}}, "built": {"type": "boolean"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge/testing-context": {"get": {"operationId": "getKnowledgeTestingContext", "summary": "List source testing choices and pathway nodes", "tags": ["Knowledge"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:read"]}], "x-sempera-scope": "knowledge:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["sources", "nodes"], "properties": {"sources": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "name": {"type": "string"}, "status": {"type": "string"}, "agent_id": {"type": "string"}}}}, "nodes": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "label": {"type": "string"}, "prompt": {"type": "string"}}}}, "node_note": {"type": ["string", "null"]}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge/{uuid}": {"get": {"operationId": "compatGetKnowledge", "summary": "Compatibility knowledge item", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:read"]}], "x-sempera-scope": "knowledge:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge/{uuid}/content": {"get": {"operationId": "compatGetKnowledgeContent", "summary": "Compatibility knowledge content", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:read"]}], "x-sempera-scope": "knowledge:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "compatUpdateKnowledgeContent", "summary": "Rewrite a plain-text knowledge source in place (keeps the prior version)", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:write"]}], "x-sempera-scope": "knowledge:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["content"], "properties": {"content": {"type": "string", "description": "The new plain-text reading."}, "expect_version_id": {"type": ["string", "null"], "description": "The `version_id` your text was typed over (from the content read). If another save has made a newer version current, this save is refused with 409 `stale_content` naming `current_version_id`, and nothing is written. Omit it (or send null) for last-write-wins."}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "409": {"description": "stale_content: the source has a newer version than expect_version_id (errors[0].current_version_id names it); nothing was written", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/knowledge/{uuid}/versions": {"get": {"operationId": "compatListKnowledgeVersions", "summary": "Compatibility knowledge versions", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["knowledge:read"]}], "x-sempera-scope": "knowledge:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/live-calls/stream": {"get": {"operationId": "streamLiveCalls", "summary": "SSE snapshot of live calls", "tags": ["Calls"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LiveCallStream"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/live-calls/transcript/stream": {"get": {"operationId": "streamLiveTranscript", "summary": "SSE snapshot of a live transcript", "tags": ["Calls"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}, {"name": "room", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LiveTranscriptStream"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/mcp": {"post": {"operationId": "mcpJsonRpc", "summary": "MCP JSON-RPC over HTTP", "tags": ["MCP"], "parameters": [], "description": "JSON-RPC 2.0 MCP. initialize returns protocol and capability metadata. tools/list returns the tools available to the credential and tools/call runs them with that credential's permissions. Connecting requires agents:read or a phone scope. Publishing requires agents:publish and a confirm argument. Phone call and text dispatch require a matching preview and valid owner or standing approval.", "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/McpRpc"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/McpRpc"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/mcp/clients/{client}": {"get": {"operationId": "getMcpClientSetup", "summary": "Setup guidance for connecting one coding-agent client", "tags": ["MCP"], "parameters": [{"name": "client", "in": "path", "required": true, "schema": {"type": "string", "enum": ["claude-code", "claude-desktop", "cursor", "vs-code", "windsurf", "gemini-cli", "codex", "other"]}}], "description": "The same answer as the mcp_client_setup tool, as a read.", "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/McpClientSetup"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/mcp/connections": {"get": {"operationId": "listMcpConnections", "summary": "List connected AI clients", "tags": ["MCP"], "parameters": [{"name": "status", "in": "query", "schema": {"type": "string", "enum": ["active", "all"]}}], "description": "The workspace's connected AI clients: one revocable, expiring credential each, usable only on POST /v1/mcp.", "security": [{"apiKey": ["api_keys:read"]}], "x-sempera-scope": "api_keys:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/McpConnectionList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createMcpConnection", "summary": "Connect an AI client (secret shown once)", "tags": ["MCP"], "parameters": [], "description": "Mint one credential for one outside AI client. read: inspect. draft: also create and edit drafts. test: also run the offline test battery. build: both draft and test. write: also publish, manage knowledge and bind owned numbers. phone: also the phone plan's tools, which call and text only within its budgets and an owner's approval.", "security": [{"apiKey": ["api_keys:write"]}], "x-sempera-scope": "api_keys:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["client"], "properties": {"client": {"type": "string", "description": "A client id GET /v1/mcp/clients/{client} accepts."}, "access": {"type": "string", "enum": ["read", "draft", "test", "build", "write"]}, "call_records": {"type": "boolean"}, "phone": {"type": "boolean", "description": "Also the phone plan's tools, at the owner's role."}, "expires_in_days": {"type": "integer", "minimum": 1, "maximum": 365}}}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/McpConnectionCreated"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/mcp/connections/{connection_id}": {"delete": {"operationId": "revokeMcpConnection", "summary": "Disconnect an AI client", "tags": ["MCP"], "parameters": [{"name": "connection_id", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "Revoke one connection. The deployed agents are not touched.", "security": [{"apiKey": ["api_keys:write"]}], "x-sempera-scope": "api_keys:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/McpConnection"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/me": {"get": {"operationId": "getMe", "summary": "Describe the calling credential", "tags": ["Authentication"], "parameters": [], "description": "Public in the sense that every credential class may call it; anonymous callers get 401.", "security": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Credential"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/memory": {"post": {"operationId": "createMemory", "summary": "Create a caller fact or summary", "tags": ["Memory"], "parameters": [], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["agent_id", "number", "contact", "key", "value"], "properties": {"agent_id": {"type": "string"}, "number": {"type": "string"}, "contact": {"type": "string"}, "key": {"type": "string"}, "value": {"type": "string"}, "kind": {"type": "string", "enum": ["fact", "summary"]}}}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "object", "agent_id"], "properties": {"id": {"type": "string"}, "object": {"const": "memory"}, "agent_id": {"type": "string"}, "contact": {"type": "string"}, "key": {"type": "string"}, "kind": {"enum": ["fact", "summary"]}, "corrected_from": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/memory/changes": {"get": {"operationId": "compatListMemoryChanges", "summary": "Compatibility memory changes", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/memory/reset": {"post": {"operationId": "resetMemory", "summary": "Forget one caller line for one agent", "tags": ["Memory"], "parameters": [], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["agent_id", "number", "reason", "confirm"], "properties": {"agent_id": {"type": "string"}, "number": {"type": "string"}, "reason": {"type": "string"}, "confirm": {"const": true}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["database", "rows", "receipt"], "properties": {"database": {"const": true}, "rows": {"type": "integer"}, "receipt": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/memory/{memory_id}": {"patch": {"operationId": "updateMemory", "summary": "Correct a caller fact or summary", "tags": ["Memory"], "parameters": [{"name": "memory_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["agent_id", "value"], "properties": {"agent_id": {"type": "string"}, "value": {"type": "string", "maxLength": 300}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "object", "agent_id"], "properties": {"id": {"type": "string"}, "object": {"const": "memory"}, "agent_id": {"type": "string"}, "contact": {"type": "string"}, "key": {"type": "string"}, "kind": {"enum": ["fact", "summary"]}, "corrected_from": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/models": {"get": {"operationId": "listModelsV1", "summary": "List Sempera's published TTS models and their capabilities", "tags": ["Models"], "parameters": [], "security": [{"apiKey": ["models:read"]}], "x-sempera-scope": "models:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ModelListV1"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/oauth/authorize": {"get": {"operationId": "authorizeOauthClient", "summary": "Start an authorization", "tags": ["OAuth"], "parameters": [{"name": "client_id", "in": "query", "required": true, "schema": {"type": "string"}}, {"name": "redirect_uri", "in": "query", "required": false, "schema": {"type": "string", "format": "uri"}}, {"name": "response_type", "in": "query", "required": true, "schema": {"const": "code"}}, {"name": "code_challenge", "in": "query", "required": true, "schema": {"type": "string", "pattern": "^[A-Za-z0-9_-]{43}$"}}, {"name": "code_challenge_method", "in": "query", "required": true, "schema": {"const": "S256"}}, {"name": "state", "in": "query", "required": false, "schema": {"type": "string", "maxLength": 2000}}, {"name": "scope", "in": "query", "required": false, "schema": {"type": "string"}}, {"name": "resource", "in": "query", "required": false, "schema": {"type": "string", "format": "uri"}}], "description": "Authorization code flow with S256 PKCE. Redirects rather than returning JSON on success. Revoke approved grants with DELETE /v1/client-grants/{grant_id}.", "security": [], "responses": {"302": {"description": "Consent page, or a registered redirect with an OAuth error", "headers": {"Location": {"required": true, "schema": {"type": "string", "format": "uri"}}}}, "400": {"description": "OAuth request refused", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthError"}}}}, "401": {"description": "Client authentication failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthError"}}}}, "503": {"description": "Authorization service unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthError"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/oauth/register": {"post": {"operationId": "registerOauthClient", "summary": "Register an OAuth client", "tags": ["OAuth"], "parameters": [], "security": [], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthClientRegistration"}}}}, "responses": {"201": {"description": "Registered", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthClient"}}}}, "400": {"description": "OAuth request refused", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthError"}}}}, "401": {"description": "Client authentication failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthError"}}}}, "503": {"description": "Authorization service unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthError"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/oauth/token": {"post": {"operationId": "exchangeOauthToken", "summary": "Swap a code or refresh token", "tags": ["OAuth"], "parameters": [], "security": [{}, {"oauthClientBasic": []}], "requestBody": {"required": true, "content": {"application/x-www-form-urlencoded": {"schema": {"$ref": "#/components/schemas/OAuthTokenRequest"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthToken"}}}}, "400": {"description": "OAuth request refused", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthError"}}}}, "401": {"description": "Client authentication failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthError"}}}}, "503": {"description": "Authorization service unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OAuthError"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/operational-reviews": {"get": {"operationId": "listOperationalReviews", "summary": "Read operational evidence reviews", "tags": ["Operations"], "parameters": [], "description": "Restricted to Sempera platform operators in the explicitly designated internal operations workspace. A customer owner role is not sufficient.", "security": [{"apiKey": ["workspaces:read"]}], "x-sempera-scope": "workspaces:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OperationalReviewList"}}}}, "503": {"description": "Internal operations workspace or database unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createOperationalReview", "summary": "Record an operational evidence review", "tags": ["Operations"], "parameters": [], "description": "Platform operators in the designated internal operations workspace only. Records an attestation, never a live action or production verification.", "security": [{"apiKey": ["workspaces:write"]}], "x-sempera-scope": "workspaces:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OperationalReviewCreate"}}}}, "responses": {"201": {"description": "Recorded and read back", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OperationalReview"}}}}, "503": {"description": "Internal operations workspace or database unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/org/service-version": {"get": {"operationId": "getServiceVersion", "summary": "Read the organization's Sempera service pin", "tags": ["Workspaces"], "parameters": [], "security": [{"apiKey": ["workspaces:read"]}], "x-sempera-scope": "workspaces:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["version", "applies_to"], "properties": {"version": {"type": "string"}, "applies_to": {"type": "string", "enum": ["new_sessions"]}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "put": {"operationId": "updateServiceVersion", "summary": "Pin new sessions to an installed Sempera release", "tags": ["Workspaces"], "parameters": [], "security": [{"apiKey": ["workspaces:write"]}], "x-sempera-scope": "workspaces:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["version", "expected_version"], "properties": {"version": {"type": "string"}, "expected_version": {"type": "string"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["version", "applies_to"], "properties": {"version": {"type": "string"}, "applies_to": {"type": "string", "enum": ["new_sessions"]}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/org/service-versions": {"get": {"operationId": "listServiceVersions", "summary": "List installed Sempera service versions", "tags": ["Workspaces"], "parameters": [], "security": [{"apiKey": ["workspaces:read"]}], "x-sempera-scope": "workspaces:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["versions"], "properties": {"versions": {"type": "array", "items": {"type": "object", "required": ["id", "name", "available"], "properties": {"id": {"type": "string"}, "name": {"type": "string"}, "available": {"type": "boolean"}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/organizations": {"get": {"operationId": "listOrganizations", "summary": "List organizations", "tags": ["Organizations"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["organizations:read"]}], "x-sempera-scope": "organizations:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OrganizationList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "organizations_create", "summary": "Create a reseller-funded child organisation", "tags": ["Organizations"], "parameters": [], "description": "Requires a reseller owner or admin session and CSRF proof. The parent_organization_id is the reseller partner id. An approved entitlement and an existing verified customer owner are required. external_ref is required for retry-safe provisioning. The reseller funds the child through wholesale billing. This does not buy or transfer credits. Manage the returned customer through /v1/partners/{id}/customers; usage is at /v1/partners/{id}/report. Workspace API keys cannot administer a reseller.", "security": [{"apiKey": ["organizations:write"]}], "x-sempera-scope": "organizations:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "required": ["parent_organization_id", "name", "owner_email", "external_ref"], "properties": {"parent_organization_id": {"type": "string", "format": "uuid"}, "name": {"type": "string", "maxLength": 120}, "owner_email": {"type": "string", "format": "email"}, "external_ref": {"type": "string", "maxLength": 120}, "support_responsibility": {"type": "string", "enum": ["partner", "sempera"]}}}}}}, "responses": {"201": {"description": "Child organisation created", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "partner_id", "status", "created"], "properties": {"id": {"type": "string"}, "partner_id": {"type": "string"}, "status": {"type": "string"}, "created": {"type": "boolean"}, "external_ref": {"type": ["string", "null"]}, "workspace_id": {"type": ["string", "null"]}, "billing_responsibility": {"type": "string"}, "support_responsibility": {"type": "string"}}}}}}, "200": {"description": "Existing external reference returned", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "partner_id", "status", "created"], "properties": {"id": {"type": "string"}, "partner_id": {"type": "string"}, "status": {"type": "string"}, "created": {"type": "boolean"}, "external_ref": {"type": ["string", "null"]}, "workspace_id": {"type": ["string", "null"]}, "billing_responsibility": {"type": "string"}, "support_responsibility": {"type": "string"}}}}}}, "403": {"description": "Reseller role, CSRF or entitlement refused", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Parent or owner not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/organizations/{organization_id}": {"get": {"operationId": "getOrganization", "summary": "Get an organization", "tags": ["Organizations"], "parameters": [{"name": "organization_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["organizations:read"]}], "x-sempera-scope": "organizations:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Organization"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/pathway": {"get": {"operationId": "compatListPathways", "summary": "Compatibility pathways", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatPathways"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/personas": {"get": {"operationId": "listPersonas", "summary": "List compiled personas", "tags": ["Personas"], "parameters": [{"name": "page", "in": "query", "schema": {"type": "integer", "minimum": 1}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PersonaList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/personas/{persona_id}": {"get": {"operationId": "getPersona", "summary": "Get a compiled persona", "tags": ["Personas"], "parameters": [{"name": "persona_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Persona"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-messages": {"post": {"operationId": "createPhoneMessage", "summary": "Send an approved text", "tags": ["Phone"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["phone:text"]}], "x-sempera-scope": "phone:text", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneMessageSend"}}}}, "responses": {"201": {"description": "Recorded send outcome", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneMessage"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-messages/preview": {"post": {"operationId": "previewPhoneMessage", "summary": "Preview a text and get its owner approval link", "tags": ["Phone"], "parameters": [], "security": [{"apiKey": ["phone:text"]}], "x-sempera-scope": "phone:text", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneMessagePreview"}}}}, "responses": {"201": {"description": "Preview stored; nothing sent", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneMessage"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-numbers": {"get": {"operationId": "listPhoneNumbers", "summary": "List phone numbers bound to an agent", "tags": ["Phone numbers"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["phone_numbers:read"]}], "x-sempera-scope": "phone_numbers:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneNumberList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "bindPhoneNumber", "summary": "Bind a phone number to an agent", "tags": ["Phone numbers"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["phone_numbers:write"]}], "x-sempera-scope": "phone_numbers:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneNumberBind"}}}}, "responses": {"201": {"description": "Bound", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneNumber"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-onboarding/headless/complete": {"post": {"operationId": "completeHeadlessPhoneOnboarding", "summary": "Send back the owner's code and receive a phone credential", "tags": ["Phone"], "parameters": [], "security": [], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "required": ["headless_session", "owner_phone", "otp_code"], "properties": {"headless_session": {"type": "string"}, "owner_phone": {"type": "string"}, "otp_code": {"type": "string", "pattern": "^[0-9]{6}$"}, "scopes": {"type": "array", "items": {"type": "string", "enum": ["phone:read", "phone:call", "phone:text"]}}, "workspace_id": {"type": "string", "format": "uuid"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneOnboardingApproved"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-onboarding/headless/start": {"post": {"operationId": "startHeadlessPhoneOnboarding", "summary": "Text the owner a sign-in code to connect an assistant without a browser", "tags": ["Phone"], "parameters": [], "security": [], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "required": ["owner_phone"], "properties": {"owner_phone": {"type": "string"}, "client_name": {"type": "string", "maxLength": 64}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["headless_session", "expires_in"], "properties": {"headless_session": {"type": "string"}, "expires_in": {"type": "integer"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-onboarding/poll": {"post": {"operationId": "pollPhoneOnboarding", "summary": "Poll a phone signup", "tags": ["Phone"], "parameters": [], "security": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneOnboardingPoll"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-onboarding/start": {"post": {"operationId": "startPhoneOnboarding", "summary": "Start an owner-approved phone signup", "tags": ["Phone"], "parameters": [], "security": [], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"client_name": {"type": "string", "maxLength": 64}, "prefill": {"type": "object", "additionalProperties": false, "properties": {"name": {"type": "string", "maxLength": 128}, "first_name": {"type": "string", "maxLength": 128}, "last_name": {"type": "string", "maxLength": 128}, "email": {"type": "string", "maxLength": 128}, "phone": {"type": "string", "maxLength": 128}}}}}}}}, "responses": {"201": {"description": "A link and code for the owner. Nothing is charged", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneOnboarding"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-plan/cancel": {"post": {"operationId": "cancelPhonePlan", "summary": "Cancel the phone plan at the end of its paid period", "tags": ["Phone"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["workspaces:write"]}], "x-sempera-scope": "workspaces:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"feedback": {"type": "object"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["name", "status", "cancel_at_period_end", "phone_number", "current_period_end"], "properties": {"name": {"type": "string"}, "display_name": {"type": "string"}, "status": {"type": "string", "enum": ["active", "past_due", "canceled"]}, "cancel_at_period_end": {"type": "boolean"}, "phone_number": {"type": ["string", "null"]}, "current_period_end": {"type": ["string", "null"], "format": "date-time"}, "cancellation_survey": {"type": "object"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-plan/cancel/feedback": {"post": {"operationId": "submitPhonePlanCancelFeedback", "summary": "Answer the optional cancellation survey", "tags": ["Phone"], "parameters": [], "security": [{"apiKey": ["workspaces:write"]}], "x-sempera-scope": "workspaces:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "required": ["feedback"], "properties": {"feedback": {"type": "object"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["submitted"], "properties": {"submitted": {"type": "boolean"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-profile": {"get": {"operationId": "getPhoneProfile", "summary": "Read the phone line, plan and allowance", "tags": ["Phone"], "parameters": [], "security": [{"apiKey": ["phone:read"]}], "x-sempera-scope": "phone:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneProfile"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-tasks": {"post": {"operationId": "createPhoneTask", "summary": "Start an approved call", "tags": ["Phone"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["phone:call"]}], "x-sempera-scope": "phone:call", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneTaskStart"}}}}, "responses": {"202": {"description": "Allowance reserved and call queued for dialing", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneTask"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-tasks/preview": {"post": {"operationId": "previewPhoneTask", "summary": "Preview a call and get its owner approval link", "tags": ["Phone"], "parameters": [], "security": [{"apiKey": ["phone:call"]}], "x-sempera-scope": "phone:call", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneTaskPreview"}}}}, "responses": {"201": {"description": "Preview stored; nothing dialed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneTask"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-tasks/{task_id}": {"get": {"operationId": "getPhoneTask", "summary": "Read a phone task and its result", "tags": ["Phone"], "parameters": [{"name": "task_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"apiKey": ["phone:read"]}], "x-sempera-scope": "phone:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneTask"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-tasks/{task_id}/cancel": {"post": {"operationId": "cancelPhoneTask", "summary": "Cancel a phone task", "tags": ["Phone"], "parameters": [{"name": "task_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"apiKey": ["phone:call"]}], "x-sempera-scope": "phone:call", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneTask"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/phone-threads/{thread_id}": {"get": {"operationId": "getPhoneThread", "summary": "Read a text thread on the plan's number", "tags": ["Phone"], "parameters": [{"name": "thread_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["phone:text"]}], "x-sempera-scope": "phone:text", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PhoneThread"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/platform": {"get": {"operationId": "getPlatform", "summary": "Deployment identity and capacity (CI/certification)", "tags": ["Platform"], "parameters": [], "security": [{"apiKey": ["deploy:read"]}], "x-sempera-scope": "deploy:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Platform"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/prompts": {"get": {"operationId": "listPrompts", "summary": "List this workspace's saved prompts", "tags": ["Prompts"], "parameters": [], "security": [{"apiKey": ["prompts:read"]}], "x-sempera-scope": "prompts:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"status": {"type": "string"}, "prompts": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "prompt": {"type": "string"}, "name": {"type": "string"}, "last_updated": {"type": "string"}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createPrompt", "summary": "Save a prompt for future use", "tags": ["Prompts"], "parameters": [], "security": [{"apiKey": ["prompts:write"]}], "x-sempera-scope": "prompts:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["prompt"], "properties": {"prompt": {"type": "string"}, "name": {"type": "string"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"status": {"type": "string"}, "prompt": {"type": "object", "properties": {"id": {"type": "string"}, "prompt": {"type": "string"}, "name": {"type": "string"}, "last_updated": {"type": "string"}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/prompts/{prompt_id}": {"get": {"operationId": "getPrompt", "summary": "Get a saved prompt", "tags": ["Prompts"], "parameters": [{"name": "prompt_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["prompts:read"]}], "x-sempera-scope": "prompts:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"status": {"type": "string"}, "prompt": {"type": "object", "properties": {"id": {"type": "string"}, "prompt": {"type": "string"}, "name": {"type": "string"}, "last_updated": {"type": "string"}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/recordings/{recording_id}": {"get": {"operationId": "getRecording", "summary": "Signed download URL for a call recording", "tags": ["Calls"], "parameters": [{"name": "recording_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RecordingDownload"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/release-deployments": {"get": {"operationId": "listReleaseDeployments", "summary": "Every agent version put on an environment in this workspace", "tags": ["Developer settings"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["deploy:read"]}], "x-sempera-scope": "deploy:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ReleaseDeploymentList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/releases": {"get": {"operationId": "compatListReleases", "summary": "Compatibility releases placeholder", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["deploy:read"]}], "x-sempera-scope": "deploy:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/releases/deployments/current": {"get": {"operationId": "compatGetCurrentDeployment", "summary": "Compatibility current deployment placeholder", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["deploy:read"]}], "x-sempera-scope": "deploy:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/releases/deployments/history": {"get": {"operationId": "compatListDeploymentHistory", "summary": "Compatibility deployment history placeholder", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["deploy:read"]}], "x-sempera-scope": "deploy:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/resources": {"get": {"operationId": "compatListResources", "summary": "Compatibility resources", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["tools:read"]}], "x-sempera-scope": "tools:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/secrets": {"get": {"operationId": "compatListSecrets", "summary": "Compatibility secret references", "tags": ["Compatibility"], "parameters": [{"name": "q", "in": "query", "schema": {"type": "string"}}, {"name": "type", "in": "query", "schema": {"type": "string", "enum": ["all", "static", "refresh"]}}, {"name": "status", "in": "query", "schema": {"type": "string", "enum": ["all", "active", "paused"]}}, {"name": "sort", "in": "query", "schema": {"type": "string", "enum": ["created_desc", "created_asc", "updated_desc", "updated_asc"]}}], "security": [{"apiKey": ["tools:read"]}], "x-sempera-scope": "tools:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createSecret", "summary": "Add a workspace secret (the value is never returned)", "tags": ["Developer settings"], "parameters": [], "security": [{"apiKey": ["tools:write"]}], "x-sempera-scope": "tools:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["name"], "properties": {"name": {"type": "string"}, "value": {"type": "string"}, "type": {"type": "string", "enum": ["static", "refresh"]}, "refresh": {"type": "object", "properties": {"url": {"type": "string"}, "method": {"type": "string", "enum": ["GET", "POST"]}, "headers": {"type": "object"}, "body": {"type": "string"}, "interval_minutes": {"type": "integer", "minimum": 1, "maximum": 1440}, "json_path": {"type": "string"}}}}}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WorkspaceSecret"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/secrets/{id}": {"patch": {"operationId": "updateSecret", "summary": "Rename a workspace secret, replace a Static value, or pause and resume it", "tags": ["Developer settings"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tools:write"]}], "x-sempera-scope": "tools:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"name": {"type": "string"}, "value": {"type": "string"}, "status": {"type": "string", "enum": ["active", "paused"]}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WorkspaceSecret"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "deleteSecret", "summary": "Delete a workspace secret", "tags": ["Developer settings"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tools:write"]}], "x-sempera-scope": "tools:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WorkspaceSecretDeleted"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/secrets/{id}/refresh": {"post": {"operationId": "refreshSecret", "summary": "Fetch a Refresh secret's value now (the value is never returned)", "tags": ["Developer settings"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tools:write"]}], "x-sempera-scope": "tools:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WorkspaceSecret"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/sessions": {"get": {"operationId": "listSessions", "summary": "List sessions for an agent", "tags": ["Sessions"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}, {"name": "channel", "in": "query", "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["sessions:read"]}], "x-sempera-scope": "sessions:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SessionList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createSession", "summary": "Create a Web voice or simulator session", "tags": ["Sessions"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["sessions:write"]}], "x-sempera-scope": "sessions:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SessionCreate"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SessionToken"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/sessions/{session_id}": {"get": {"operationId": "getSession", "summary": "Get a session", "tags": ["Sessions"], "parameters": [{"name": "session_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["sessions:read"]}], "x-sempera-scope": "sessions:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Session"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/signing": {"get": {"operationId": "getRequestSigning", "summary": "JWT request signing settings and keys", "tags": ["Developer settings"], "parameters": [], "security": [{"apiKey": ["webhooks:read"]}], "x-sempera-scope": "webhooks:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RequestSigning"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "patchRequestSigning", "summary": "Update JWT request signing", "tags": ["Developer settings"], "parameters": [], "security": [{"apiKey": ["webhooks:write"]}], "x-sempera-scope": "webhooks:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RequestSigning"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/signing/keys": {"post": {"operationId": "generateSigningKey", "summary": "Generate or rotate the signing key", "tags": ["Developer settings"], "parameters": [], "security": [{"apiKey": ["webhooks:write"]}], "x-sempera-scope": "webhooks:write", "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SigningKeyGenerated"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/signing/keys/revoke-previous": {"post": {"operationId": "revokePreviousSigningKeys", "summary": "Withdraw every signing key but the active one", "tags": ["Developer settings"], "parameters": [], "security": [{"apiKey": ["webhooks:write"]}], "x-sempera-scope": "webhooks:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SigningKeysRevoked"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/sms/batch": {"post": {"operationId": "batchSms", "summary": "Send a bounded SMS batch", "tags": ["SMS"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "required": ["messages"], "properties": {"global": {"type": "object", "properties": {"agent_id": {"type": "string"}, "agent_number": {"type": "string"}, "user_number": {"type": "string"}, "agent_message": {"type": "string"}, "consent_basis": {"type": "string"}, "timezone": {"type": "string"}, "window": {"type": "string", "description": "Recipient sending hours, HH:MM-HH:MM"}}}, "messages": {"type": "array", "minItems": 1, "maxItems": 100, "items": {"type": "object", "properties": {"agent_id": {"type": "string"}, "agent_number": {"type": "string"}, "user_number": {"type": "string"}, "agent_message": {"type": "string"}, "consent_basis": {"type": "string"}, "timezone": {"type": "string"}, "window": {"type": "string", "description": "Recipient sending hours, HH:MM-HH:MM"}}}}}}}}}, "responses": {"201": {"description": "Recorded batch outcomes", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SmsBatchResult"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/sms/conversations": {"get": {"operationId": "compatListSmsConversations", "summary": "Compatibility SMS conversations", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/sms/conversations/{conversation_id}": {"get": {"operationId": "getSmsConversation", "summary": "Get SMS conversation", "tags": ["SMS"], "parameters": [{"name": "conversation_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SmsConversation"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/sms/conversations/{conversation_id}/end": {"post": {"operationId": "endSmsConversation", "summary": "end SMS conversation", "tags": ["SMS"], "parameters": [{"name": "conversation_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SmsHandoff"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/sms/conversations/{conversation_id}/handoff": {"post": {"operationId": "handoffSmsConversation", "summary": "handoff SMS conversation", "tags": ["SMS"], "parameters": [{"name": "conversation_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SmsHandoff"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/sms/conversations/{conversation_id}/messages": {"get": {"operationId": "listSmsMessages", "summary": "List SMS messages", "tags": ["SMS"], "parameters": [{"name": "conversation_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SmsMessages"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "replySms", "summary": "Send conversation message", "tags": ["SMS"], "parameters": [{"name": "conversation_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "required": ["message", "consent_basis"], "properties": {"message": {"type": "string"}, "sender": {"enum": ["human", "agent"]}, "consent_basis": {"type": "string"}, "timezone": {"type": "string"}, "window": {"type": "string"}}}}}}, "responses": {"201": {"description": "Recorded reply outcome", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SmsSendResult"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/sms/conversations/{conversation_id}/opt-out": {"post": {"operationId": "optOutSmsConversation", "summary": "Record an SMS opt-out without sending", "tags": ["SMS"], "parameters": [{"name": "conversation_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SmsPolicy"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/sms/conversations/{conversation_id}/policy": {"get": {"operationId": "getSmsPolicy", "summary": "Read SMS consent and sending policy", "tags": ["SMS"], "parameters": [{"name": "conversation_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SmsPolicy"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/sms/conversations/{conversation_id}/resume": {"post": {"operationId": "resumeSmsConversation", "summary": "resume SMS conversation", "tags": ["SMS"], "parameters": [{"name": "conversation_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SmsHandoff"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/sms/numbers": {"get": {"operationId": "compatListSmsNumbers", "summary": "Compatibility SMS numbers", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["phone_numbers:read"]}], "x-sempera-scope": "phone_numbers:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/sms/send": {"post": {"operationId": "sendSms", "summary": "Send SMS", "tags": ["SMS"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "properties": {"agent_id": {"type": "string"}, "agent_number": {"type": "string"}, "user_number": {"type": "string"}, "agent_message": {"type": "string"}, "consent_basis": {"type": "string"}, "timezone": {"type": "string"}, "window": {"type": "string", "description": "Recipient sending hours, HH:MM-HH:MM"}}, "required": ["agent_id", "agent_number", "user_number", "agent_message", "consent_basis"]}}}}, "responses": {"201": {"description": "Recorded send outcome", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SmsSendResult"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/snippets": {"get": {"operationId": "listSnippets", "summary": "List code snippets", "tags": ["Snippets"], "parameters": [{"name": "status", "in": "query", "schema": {"type": "string", "enum": ["active", "all"]}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["tools:read"]}], "x-sempera-scope": "tools:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SnippetList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createSnippet", "summary": "Create a code snippet (its first draft)", "tags": ["Snippets"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["tools:write"]}], "x-sempera-scope": "tools:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SnippetCreate"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Snippet"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/snippets/{snippet_id}": {"get": {"operationId": "getSnippet", "summary": "Get a code snippet and its versions", "tags": ["Snippets"], "parameters": [{"name": "snippet_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tools:read"]}], "x-sempera-scope": "tools:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Snippet"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "updateSnippet", "summary": "Edit the draft (opens a new draft after the highest version when none is open)", "tags": ["Snippets"], "parameters": [{"name": "snippet_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tools:write"]}], "x-sempera-scope": "tools:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SnippetDraft"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Snippet"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "deleteSnippet", "summary": "Archive (or restore) a code snippet", "tags": ["Snippets"], "parameters": [{"name": "snippet_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "restore", "in": "query", "schema": {"type": "string", "enum": ["1"]}}], "security": [{"apiKey": ["tools:write"]}], "x-sempera-scope": "tools:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Snippet"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/snippets/{snippet_id}/publish": {"post": {"operationId": "publishSnippet", "summary": "Publish the draft as an immutable version", "tags": ["Snippets"], "parameters": [{"name": "snippet_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["tools:write"]}], "x-sempera-scope": "tools:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Snippet"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/snippets/{snippet_id}/test": {"post": {"operationId": "testSnippet", "summary": "Run a version (or the draft) on sample input in the sandbox", "tags": ["Snippets"], "parameters": [{"name": "snippet_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tools:write"]}], "x-sempera-scope": "tools:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SnippetTest"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SnippetTestResult"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/snippets/{snippet_id}/versions/{version}": {"get": {"operationId": "getSnippetVersion", "summary": "Get one version of a code snippet", "tags": ["Snippets"], "parameters": [{"name": "snippet_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "version", "in": "path", "required": true, "schema": {"type": "integer", "minimum": 1}}], "security": [{"apiKey": ["tools:read"]}], "x-sempera-scope": "tools:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SnippetVersion"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/standards": {"get": {"operationId": "listStandards", "summary": "List an agent's standards with their latest result", "tags": ["Tests"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tests:read"]}], "x-sempera-scope": "tests:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StandardList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createStandard", "summary": "Save a node-level standard (a step, a fixed situation, what the step must do)", "tags": ["Tests"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["tests:write"]}], "x-sempera-scope": "tests:write", "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Standard"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/standards/run": {"post": {"operationId": "runStandards", "summary": "Run standards against the agent's current version (background job)", "tags": ["Tests"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["tests:write"]}], "x-sempera-scope": "tests:write", "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StandardsRunAccepted"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/standards/runs": {"get": {"operationId": "listStandardsRuns", "summary": "Standards runs, newest first", "tags": ["Tests"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tests:read"]}], "x-sempera-scope": "tests:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StandardsRunList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/standards/{standard_id}": {"patch": {"operationId": "updateStandard", "summary": "Change a standard", "tags": ["Tests"], "parameters": [{"name": "standard_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tests:write"]}], "x-sempera-scope": "tests:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Standard"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "deleteStandard", "summary": "Delete a standard", "tags": ["Tests"], "parameters": [{"name": "standard_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tests:write"]}], "x-sempera-scope": "tests:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/StandardDeleted"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/subaccounts": {"get": {"operationId": "compatSubaccountsRetired", "summary": "Subaccounts (retired, answers as the reference does)", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["organizations:read"]}], "x-sempera-scope": "organizations:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "403": {"description": "Retired: DEPRECATED_FINAL", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/test-analytics": {"get": {"operationId": "getTestAnalytics", "summary": "Failures per graph node over a window, and the weakest link", "tags": ["Tests"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}, {"name": "days", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 365}}, {"name": "min_samples", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 1000}}], "security": [{"apiKey": ["tests:read"]}], "x-sempera-scope": "tests:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TestAnalytics"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/testbed/runs": {"post": {"operationId": "runTestbed", "summary": "Run a turn's situation against the step's current and a candidate instruction (nothing is saved)", "tags": ["Tests"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["tests:write"]}], "x-sempera-scope": "tests:write", "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TestbedRun"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/testbed/runs/{run_id}": {"get": {"operationId": "getTestbedRun", "summary": "A Testbed run and its per-situation comparison", "tags": ["Tests"], "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tests:read"]}], "x-sempera-scope": "tests:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TestbedRun"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/testbed/situation": {"get": {"operationId": "getTestbedSituation", "summary": "The situation at one turn of a stored conversation: the step, its instruction, the original reply", "tags": ["Tests"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}, {"name": "conversation_id", "in": "query", "required": true, "schema": {"type": "string"}}, {"name": "turn", "in": "query", "required": true, "schema": {"type": "integer", "minimum": 0}}, {"name": "step", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["tests:read"]}], "x-sempera-scope": "tests:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TestbedSituation"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/testbed/standards": {"post": {"operationId": "saveTestbedStandard", "summary": "Save a Testbed situation and expectations as a standard", "tags": ["Tests"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["tests:write"]}], "x-sempera-scope": "tests:write", "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Standard"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/tests": {"get": {"operationId": "listTests", "summary": "List test runs for an agent", "tags": ["Tests"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["tests:read"]}], "x-sempera-scope": "tests:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TestRunList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "runTests", "summary": "Run the test battery (background job)", "tags": ["Tests"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["tests:write"]}], "x-sempera-scope": "tests:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TestRunCreate"}}}}, "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TestRun"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/tests/{test_id}": {"get": {"operationId": "getTest", "summary": "Get a test run", "tags": ["Tests"], "parameters": [{"name": "test_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "agent_id", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["tests:read"]}], "x-sempera-scope": "tests:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TestRun"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/text-assistant/link": {"post": {"operationId": "startTextAssistantLink", "summary": "Send a mobile linking code", "tags": ["Assistant"], "parameters": [], "description": "Requires the current workspace owner browser session, not an API key, and an entitled workspace. Writes require CSRF proof.", "security": [{"apiKey": ["workspaces:write"]}], "x-sempera-scope": "workspaces:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["mobile"], "properties": {"mobile": {"type": "string", "pattern": "^\\+[1-9][0-9]{7,14}$"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["sent"], "properties": {"sent": {"const": true}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "unlinkTextAssistant", "summary": "Unlink your mobile number", "tags": ["Assistant"], "parameters": [], "description": "Requires the current workspace owner browser session, not an API key, and an entitled workspace. Writes require CSRF proof. Unlinking remains available without entitlement.", "security": [{"apiKey": ["workspaces:write"]}], "x-sempera-scope": "workspaces:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["name", "available", "enabled", "linked", "mobile", "pending"], "properties": {"name": {"type": "string"}, "available": {"type": "boolean"}, "enabled": {"type": "boolean"}, "linked": {"type": "boolean"}, "mobile": {"type": ["string", "null"], "description": "Masked mobile number, never the full number."}, "pending": {"type": "boolean"}, "assistant_number": {"type": ["string", "null"], "readOnly": true, "description": "E.164 number owners text to reach the Assistant; null unless line_state is ok. Read only; returned by GET."}, "line_state": {"enum": ["ok", "missing", "unknown", "off"], "readOnly": true, "description": "ok: the provider confirms the line is ours. missing: it no longer lists it. unknown: the check failed. off: texting is not configured. Read only; returned by GET."}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/text-assistant/link/confirm": {"post": {"operationId": "confirmTextAssistantLink", "summary": "Confirm your mobile linking code", "tags": ["Assistant"], "parameters": [], "description": "Requires the current workspace owner browser session, not an API key, and an entitled workspace. Writes require CSRF proof.", "security": [{"apiKey": ["workspaces:write"]}], "x-sempera-scope": "workspaces:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["code"], "properties": {"code": {"type": "string"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["name", "available", "enabled", "linked", "mobile", "pending"], "properties": {"name": {"type": "string"}, "available": {"type": "boolean"}, "enabled": {"type": "boolean"}, "linked": {"type": "boolean"}, "mobile": {"type": ["string", "null"], "description": "Masked mobile number, never the full number."}, "pending": {"type": "boolean"}, "assistant_number": {"type": ["string", "null"], "readOnly": true, "description": "E.164 number owners text to reach the Assistant; null unless line_state is ok. Read only; returned by GET."}, "line_state": {"enum": ["ok", "missing", "unknown", "off"], "readOnly": true, "description": "ok: the provider confirms the line is ours. missing: it no longer lists it. unknown: the check failed. off: texting is not configured. Read only; returned by GET."}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/text-assistant/settings": {"get": {"operationId": "getTextAssistantSettings", "summary": "Read text Assistant settings", "tags": ["Assistant"], "parameters": [], "description": "Requires the current workspace owner browser session, not an API key, and an entitled workspace. Writes require CSRF proof.", "security": [{"apiKey": ["workspaces:read"]}], "x-sempera-scope": "workspaces:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["name", "available", "enabled", "linked", "mobile", "pending"], "properties": {"name": {"type": "string"}, "available": {"type": "boolean"}, "enabled": {"type": "boolean"}, "linked": {"type": "boolean"}, "mobile": {"type": ["string", "null"], "description": "Masked mobile number, never the full number."}, "pending": {"type": "boolean"}, "assistant_number": {"type": ["string", "null"], "readOnly": true, "description": "E.164 number owners text to reach the Assistant; null unless line_state is ok. Read only; returned by GET."}, "line_state": {"enum": ["ok", "missing", "unknown", "off"], "readOnly": true, "description": "ok: the provider confirms the line is ours. missing: it no longer lists it. unknown: the check failed. off: texting is not configured. Read only; returned by GET."}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "updateTextAssistantSettings", "summary": "Enable or disable the text Assistant", "tags": ["Assistant"], "parameters": [], "description": "Requires the current workspace owner browser session, not an API key, and an entitled workspace. Writes require CSRF proof. Disabling remains available without entitlement.", "security": [{"apiKey": ["workspaces:write"]}], "x-sempera-scope": "workspaces:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["enabled"], "properties": {"enabled": {"type": "boolean"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["name", "available", "enabled", "linked", "mobile", "pending"], "properties": {"name": {"type": "string"}, "available": {"type": "boolean"}, "enabled": {"type": "boolean"}, "linked": {"type": "boolean"}, "mobile": {"type": ["string", "null"], "description": "Masked mobile number, never the full number."}, "pending": {"type": "boolean"}, "assistant_number": {"type": ["string", "null"], "readOnly": true, "description": "E.164 number owners text to reach the Assistant; null unless line_state is ok. Read only; returned by GET."}, "line_state": {"enum": ["ok", "missing", "unknown", "off"], "readOnly": true, "description": "ok: the provider confirms the line is ours. missing: it no longer lists it. unknown: the check failed. off: texting is not configured. Read only; returned by GET."}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/text-assistant/thread": {"get": {"operationId": "getTextAssistantThread", "summary": "Read your text Assistant thread", "tags": ["Assistant"], "parameters": [{"name": "before", "in": "query", "required": false, "schema": {"type": "string", "format": "uuid"}, "description": "Return older messages before this thread message id."}], "description": "Requires the current workspace owner browser session, not an API key, and an entitled workspace. Writes require CSRF proof.", "security": [{"apiKey": ["workspaces:read"]}], "x-sempera-scope": "workspaces:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["name", "messages", "has_more", "next_before"], "properties": {"name": {"type": "string"}, "has_more": {"type": "boolean"}, "next_before": {"type": ["string", "null"], "format": "uuid"}, "messages": {"type": "array", "items": {"type": "object", "required": ["id", "body", "answer", "state", "at"], "properties": {"id": {"type": "string", "format": "uuid"}, "body": {"type": "string"}, "answer": {"type": ["string", "null"]}, "state": {"enum": ["queued", "working", "ready", "sent", "refused", "uncertain"]}, "at": {"type": "string", "format": "date-time"}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/tools": {"get": {"operationId": "listTools", "summary": "List tools", "tags": ["Tools"], "parameters": [{"name": "status", "in": "query", "schema": {"type": "string", "enum": ["enabled", "all"]}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["tools:read"]}], "x-sempera-scope": "tools:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ToolList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createTool", "summary": "Create a tool", "tags": ["Tools"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["tools:write"]}], "x-sempera-scope": "tools:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ToolCreate"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Tool"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/tools/{tool_id}": {"get": {"operationId": "getTool", "summary": "Get a tool", "tags": ["Tools"], "parameters": [{"name": "tool_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tools:read"]}], "x-sempera-scope": "tools:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Tool"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "updateTool", "summary": "Update a tool", "tags": ["Tools"], "parameters": [{"name": "tool_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["tools:write"]}], "x-sempera-scope": "tools:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ToolUpdate"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Tool"}}}}, "409": {"description": "conflict with reason stale_tool: the tool has a newer revision than the one sent; nothing is written, and the error names the revision on file", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "deleteTool", "summary": "Disable (archive) a tool", "tags": ["Tools"], "parameters": [{"name": "tool_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "restore", "in": "query", "schema": {"type": "string", "enum": ["1"]}}, {"name": "revision", "in": "query", "schema": {"type": "integer"}}], "security": [{"apiKey": ["tools:write"]}], "x-sempera-scope": "tools:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Tool"}}}}, "409": {"description": "conflict with reason stale_tool: the optional revision sent is older than the tool's; nothing is archived or restored, and the error names the revision on file", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/tools/{tool_id}/execute": {"post": {"operationId": "executeTool", "summary": "Execute a tool in test mode", "tags": ["Tools"], "parameters": [{"name": "tool_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["tools:execute"]}], "x-sempera-scope": "tools:execute", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ToolExecute"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ToolExecution"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/tools/{tool_id}/executions": {"get": {"operationId": "listToolExecutions", "summary": "Recent executions of a tool", "tags": ["Tools"], "parameters": [{"name": "tool_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["tools:read"]}], "x-sempera-scope": "tools:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ToolExecutionList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/transcript-reports/call/{uuid}": {"get": {"operationId": "compatListTranscriptReports", "summary": "Compatibility transcript reports", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/translation-sessions": {"get": {"operationId": "getTranslationSessions", "summary": "Read live translation availability and recent sessions", "tags": ["Sessions"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["sessions:read"]}], "x-sempera-scope": "sessions:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["client", "enabled"], "properties": {"client": {"type": "string"}, "enabled": {"type": "boolean"}, "languages": {"type": "array"}, "how_it_works": {"type": "object"}, "recent_calls": {"type": "array"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createTranslationSession", "summary": "Start a Sempera live translation session", "tags": ["Sessions"], "parameters": [], "description": "Requires workspace activation. Two room-scoped join tokens are returned, one per person. Audio is recognized, translated and spoken. No phone call is placed.", "security": [{"apiKey": ["sessions:write"]}], "x-sempera-scope": "sessions:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["agent_id", "caller_language", "staff_language"], "properties": {"agent_id": {"type": "string"}, "caller_language": {"type": "string"}, "staff_language": {"type": "string"}}}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"type": "object", "required": ["object", "id", "agent_id", "url", "room", "languages", "runtime", "tokens", "note"], "properties": {"object": {"const": "translation_session"}, "id": {"type": "string"}, "agent_id": {"type": "string"}, "url": {"type": "string"}, "room": {"type": "string"}, "note": {"type": "string"}, "languages": {"type": "object"}, "runtime": {"type": "object"}, "tokens": {"type": "object", "additionalProperties": {"type": "object", "required": ["identity", "token"], "properties": {"identity": {"type": "string"}, "token": {"type": "string"}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/triage/categories": {"get": {"operationId": "compatListTriageCategories", "summary": "Compatibility triage categories", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/triage/flag-types": {"get": {"operationId": "compatListTriageFlagTypes", "summary": "Compatibility triage flag types", "tags": ["Compatibility"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "description": "This workspace's own flag types with usage counts and the latest non-empty note, aggregated from its stored call flags.", "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/triage/issues": {"get": {"operationId": "compatListTriageIssues", "summary": "Compatibility triage issues", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "compatCreateTriageIssue", "summary": "Create triage issue", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/triage/issues/{uuid}": {"get": {"operationId": "compatGetTriageIssue", "summary": "Compatibility triage issue", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "compatUpdateTriageIssue", "summary": "Update triage issue", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/triage/issues/{uuid}/activity": {"get": {"operationId": "compatListTriageIssueActivity", "summary": "Compatibility triage activity", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/triage/issues/{uuid}/affected": {"get": {"operationId": "compatListTriageIssueAffected", "summary": "Compatibility triage affected surfaces", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/triage/issues/{uuid}/calls/{call_id}": {"put": {"operationId": "compatLinkTriageIssueCall", "summary": "Link a call to a triage issue", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "call_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/triage/issues/{uuid}/comments": {"post": {"operationId": "compatCreateTriageIssueComment", "summary": "Create triage comment", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/triage/issues/{uuid}/flags": {"get": {"operationId": "compatListTriageIssueFlags", "summary": "Calls flagged onto a triage issue", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "compatCreateTriageIssueFlag", "summary": "Flag a call onto a triage issue", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/triage/issues/{uuid}/relations": {"get": {"operationId": "compatListTriageIssueRelations", "summary": "List the links to and from a triage issue", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "Each item names the other issue; direction says which side stored the link.", "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "compatCreateTriageIssueRelation", "summary": "Link a triage issue to another one", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["related_issue_id", "relation_type"], "properties": {"related_issue_id": {"type": "string"}, "relation_type": {"type": "string", "enum": ["related_to", "blocks", "duplicate_of"]}}}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "409": {"description": "Already linked", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/triage/issues/{uuid}/relations/{relation_id}": {"delete": {"operationId": "compatDeleteTriageIssueRelation", "summary": "Remove a link between two triage issues", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "relation_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "responses": {"204": {"description": "Removed"}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/triage/issues/{uuid}/resources": {"get": {"operationId": "compatListTriageIssueResources", "summary": "Compatibility triage resources", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "compatAttachTriageFileResource", "summary": "Attach triage file resource", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/triage/issues/{uuid}/view": {"put": {"operationId": "compatMarkTriageIssueViewed", "summary": "Compatibility triage viewed marker", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:write"]}], "x-sempera-scope": "evals:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/voices": {"get": {"operationId": "listVoices", "summary": "List the voices a session or draft may name", "tags": ["Sessions"], "parameters": [{"name": "engine", "in": "query", "schema": {"type": "string"}, "description": "alias: provider"}, {"name": "language", "in": "query", "schema": {"type": "string"}}, {"name": "search", "in": "query", "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/VoiceList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/voices/library": {"get": {"operationId": "listVoiceLibrary", "summary": "List workspace voice collection", "tags": ["Voices"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["voices"], "properties": {"voices": {"type": "array", "items": {"type": "object", "required": ["id", "voice_id", "display_name", "rating", "shared", "share_scope", "share_path"], "properties": {"id": {"type": "string", "format": "uuid"}, "voice_id": {"type": "string"}, "display_name": {"type": "string"}, "rating": {"type": ["integer", "null"], "minimum": 1, "maximum": 5}, "shared": {"type": "boolean"}, "share_scope": {"type": "string", "enum": ["workspace"]}, "share_path": {"type": ["string", "null"]}}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/voices/library/add": {"post": {"operationId": "addVoiceLibrary", "summary": "Add a cleared voice to the workspace library", "tags": ["Voices"], "parameters": [], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["voice_id"], "properties": {"voice_id": {"type": "string"}}}}}}, "responses": {"201": {"description": "Voice saved", "content": {"application/json": {"schema": {"type": "object", "required": ["voice"], "properties": {"voice": {"type": "object", "required": ["id", "voice_id", "display_name", "rating", "shared", "share_scope", "share_path"], "properties": {"id": {"type": "string", "format": "uuid"}, "voice_id": {"type": "string"}, "display_name": {"type": "string"}, "rating": {"type": ["integer", "null"], "minimum": 1, "maximum": 5}, "shared": {"type": "boolean"}, "share_scope": {"type": "string", "enum": ["workspace"]}, "share_path": {"type": ["string", "null"]}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/voices/library/{entry_id}": {"get": {"operationId": "getSharedVoice", "summary": "Read a voice shared with this workspace", "tags": ["Voices"], "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["voice"], "properties": {"voice": {"type": "object", "required": ["id", "voice_id", "display_name", "rating", "shared", "share_scope", "share_path"], "properties": {"id": {"type": "string", "format": "uuid"}, "voice_id": {"type": "string"}, "display_name": {"type": "string"}, "rating": {"type": ["integer", "null"], "minimum": 1, "maximum": 5}, "shared": {"type": "boolean"}, "share_scope": {"type": "string", "enum": ["workspace"]}, "share_path": {"type": ["string", "null"]}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/voices/library/{entry_id}/rate": {"post": {"operationId": "rateVoice", "summary": "Set the workspace rating for a saved voice", "tags": ["Voices"], "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["rating"], "properties": {"rating": {"type": "integer", "minimum": 1, "maximum": 5}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["voice"], "properties": {"voice": {"type": "object", "required": ["id", "voice_id", "display_name", "rating", "shared", "share_scope", "share_path"], "properties": {"id": {"type": "string", "format": "uuid"}, "voice_id": {"type": "string"}, "display_name": {"type": "string"}, "rating": {"type": ["integer", "null"], "minimum": 1, "maximum": 5}, "shared": {"type": "boolean"}, "share_scope": {"type": "string", "enum": ["workspace"]}, "share_path": {"type": ["string", "null"]}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/voices/library/{entry_id}/sample": {"get": {"operationId": "sampleVoice", "summary": "Play a saved voice with the workspace sample text", "tags": ["Voices"], "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "description": "Returns audio/wav. Needs the voice shortlist write capability because synthesis spends capacity. Rechecks voice clearance and workspace admission before synthesis.", "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"audio/wav": {"schema": {"type": "string", "format": "binary"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/voices/library/{entry_id}/share": {"post": {"operationId": "shareVoice", "summary": "Enable or revoke authenticated team sharing", "tags": ["Voices"], "parameters": [{"name": "entry_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["enabled"], "properties": {"enabled": {"type": "boolean"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["voice"], "properties": {"voice": {"type": "object", "required": ["id", "voice_id", "display_name", "rating", "shared", "share_scope", "share_path"], "properties": {"id": {"type": "string", "format": "uuid"}, "voice_id": {"type": "string"}, "display_name": {"type": "string"}, "rating": {"type": ["integer", "null"], "minimum": 1, "maximum": 5}, "shared": {"type": "boolean"}, "share_scope": {"type": "string", "enum": ["workspace"]}, "share_path": {"type": ["string", "null"]}}}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/voices/studio": {"get": {"operationId": "listStudioClones", "summary": "List professional clone preparations", "tags": ["Voices"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["requests", "notice"], "properties": {"requests": {"type": "array", "items": {"type": "object", "required": ["id", "display_name", "consent_id", "declared_audio_seconds", "status", "usable", "audio_uploaded"], "properties": {"id": {"type": "string", "format": "uuid"}, "display_name": {"type": "string"}, "consent_id": {"type": ["string", "null"], "format": "uuid"}, "declared_audio_seconds": {"type": "integer"}, "status": {"type": "string", "enum": ["awaiting_enablement"]}, "usable": {"type": "boolean"}, "audio_uploaded": {"type": "boolean"}}}}, "notice": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "prepareStudioClone", "summary": "Prepare a professional clone without uploading or training", "tags": ["Voices"], "parameters": [], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["display_name", "consent_id", "declared_audio_seconds"], "additionalProperties": false, "properties": {"display_name": {"type": "string", "maxLength": 80}, "consent_id": {"type": "string", "format": "uuid"}, "declared_audio_seconds": {"type": "integer", "minimum": 600, "maximum": 7200}}}}}}, "responses": {"201": {"description": "Preparation saved, training not queued", "content": {"application/json": {"schema": {"type": "object", "required": ["request", "notice"], "properties": {"request": {"type": "object", "required": ["id", "display_name", "consent_id", "declared_audio_seconds", "status", "usable", "audio_uploaded"], "properties": {"id": {"type": "string", "format": "uuid"}, "display_name": {"type": "string"}, "consent_id": {"type": ["string", "null"], "format": "uuid"}, "declared_audio_seconds": {"type": "integer"}, "status": {"type": "string", "enum": ["awaiting_enablement"]}, "usable": {"type": "boolean"}, "audio_uploaded": {"type": "boolean"}}}, "notice": {"type": "string"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks": {"get": {"operationId": "listWebhooks", "summary": "List webhook endpoints", "tags": ["Webhooks"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}, {"name": "agent", "in": "query", "schema": {"type": "string"}, "description": "Only endpoints owned by this agent slug; excludes workspace endpoints."}], "security": [{"apiKey": ["webhooks:read"]}], "x-sempera-scope": "webhooks:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/WebhookEndpointList"}, {"type": "object", "properties": {"data": {"type": "array", "items": {"allOf": [{"$ref": "#/components/schemas/WebhookEndpoint"}, {"type": "object", "required": ["agent"], "properties": {"agent": {"type": ["string", "null"], "description": "Immutable agent slug, or null for a workspace webhook."}}}]}}}}]}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createWebhook", "summary": "Create a webhook endpoint", "tags": ["Webhooks"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["webhooks:write"]}], "x-sempera-scope": "webhooks:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/WebhookEndpointCreate"}, {"type": "object", "properties": {"agent": {"type": ["string", "null"], "description": "Optional immutable agent slug. An agent can have up to 5 webhooks; exceeding this returns validation_failed."}}}]}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/WebhookEndpoint"}, {"type": "object", "required": ["agent"], "properties": {"agent": {"type": ["string", "null"], "description": "Immutable agent slug, or null for a workspace webhook."}}}]}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks/github": {"post": {"operationId": "repositoryProviderWebhook", "summary": "Repository provider webhook", "tags": ["Webhook ingress"], "parameters": [], "description": "Server-to-server only. Verifies the raw body before parsing; requires delivery id and event headers.", "security": [{"repositorySignature": []}], "x-sempera-server-to-server": true, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RepositoryProviderEvent"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RepositoryProviderReceipt"}}}}, "400": {"description": "Invalid payload", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServiceIngressError"}}}}, "403": {"description": "Invalid service proof", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServiceIngressError"}}}}, "409": {"description": "Payload changed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServiceIngressError"}}}}, "413": {"description": "Payload too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServiceIngressError"}}}}, "503": {"description": "Service unavailable; retry where instructed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServiceIngressError"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks/legacy-layla": {"post": {"operationId": "legacyServiceHandoff", "summary": "Legacy service handoff", "tags": ["Webhook ingress"], "parameters": [], "description": "Fixed service-to-service ingress, not a customer destination. Never retries an uncertain send.", "security": [{"handoffToken": []}], "x-sempera-server-to-server": true, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LegacyHandoffEvent"}}}}, "responses": {"200": {"description": "Sent", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LegacyHandoffReceipt"}}}}, "202": {"description": "Recorded; may be uncertain or failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/LegacyHandoffReceipt"}}}}, "400": {"description": "Invalid payload", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServiceIngressError"}}}}, "403": {"description": "Invalid service proof", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServiceIngressError"}}}}, "409": {"description": "Payload changed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServiceIngressError"}}}}, "413": {"description": "Payload too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServiceIngressError"}}}}, "503": {"description": "Service unavailable; retry where instructed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ServiceIngressError"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks/stripe": {"post": {"operationId": "paymentProviderWebhook", "summary": "Payment provider webhook ingress", "tags": ["Webhook ingress"], "parameters": [], "description": "Verified over the raw body, 300 s tolerance, replay-guarded by event id. Server-to-server only.", "security": [{"paymentProviderSignature": []}], "x-sempera-server-to-server": true, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentProviderEvent"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaymentProviderReceipt"}}}}, "400": {"description": "Invalid payload", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Invalid provider proof", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Ingress disabled or not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Payload too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Ingress unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks/telephony": {"post": {"operationId": "telephonyWebhook", "summary": "Telephony carrier post-call ingress", "tags": ["Webhook ingress"], "parameters": [], "description": "Verified with the shared carrier token (constant-time compare); idempotent on the provider call id.", "security": [{"carrierToken": []}, {"carrierTokenHeader": []}], "x-sempera-server-to-server": true, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TelephonyProviderEvent"}}}}, "responses": {"202": {"description": "Accepted, including ignored and replayed calls", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TelephonyProviderReceipt"}}}}, "400": {"description": "Invalid payload", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Invalid provider proof", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Ingress disabled or not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Payload too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Ingress unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks/telephony/media-stream": {"get": {"operationId": "telephonyMediaStream", "summary": "Carrier media stream (websocket)", "tags": ["Webhook ingress"], "parameters": [], "description": "A websocket carrying one call's audio. Locked by a single-use token, bound to the call and valid for seconds, minted by the inbound-call webhook; any stream without one is closed. Off unless the deployment enables it.", "security": [], "x-sempera-server-to-server": true, "responses": {"101": {"description": "WebSocket upgrade; single-use token required in the start frame's customParameters.token, not in the URL"}, "400": {"description": "Invalid payload", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Invalid provider proof", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Ingress disabled or not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Payload too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Ingress unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks/telephony/message": {"post": {"operationId": "telephonyMessageWebhook", "summary": "Carrier recorded-message webhook (media stream)", "tags": ["Webhook ingress"], "parameters": [{"name": "reason", "in": "query", "required": true, "schema": {"enum": ["at_capacity", "workspace_limit", "unavailable", "already_admitted", "testing"]}}], "description": "Verified with the carrier's request signature, keyed by the account that holds the dialled number. Records the message a caller left on the message path, one per call, for an employee that takes messages. Off unless the deployment enables it.", "security": [{"carrierSignature": []}], "x-sempera-server-to-server": true, "requestBody": {"required": true, "content": {"application/x-www-form-urlencoded": {"schema": {"$ref": "#/components/schemas/CarrierMessageEvent"}}}}, "responses": {"200": {"description": "Call-control markup", "content": {"text/xml": {"schema": {"type": "string"}}}}, "400": {"description": "Invalid payload", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Invalid provider proof", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Ingress disabled or not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Payload too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Ingress unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks/telephony/sip-front-door": {"post": {"operationId": "telephonySipFrontDoorWebhook", "summary": "Carrier SIP front-door call webhook", "tags": ["Webhook ingress"], "parameters": [], "description": "A call from a customer's own phone system that the carrier already admitted through that line's address list. Verified with the carrier's request signature; the SIP domain must be the one made for the employee holding the dialled number. Answers with call-control markup that forwards the call to the media server, or declines it. Off unless the deployment opens the SIP edge.", "security": [{"carrierSignature": []}], "x-sempera-server-to-server": true, "requestBody": {"required": true, "content": {"application/x-www-form-urlencoded": {"schema": {"$ref": "#/components/schemas/CarrierVoiceEvent"}}}}, "responses": {"200": {"description": "Call-control markup", "content": {"text/xml": {"schema": {"type": "string"}}}}, "400": {"description": "Invalid payload", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Invalid provider proof", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Ingress disabled or not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Payload too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Ingress unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks/telephony/voice": {"post": {"operationId": "telephonyVoiceWebhook", "summary": "Carrier inbound-call webhook (media stream)", "tags": ["Webhook ingress"], "parameters": [], "description": "Verified with the carrier's request signature, keyed by the account that holds the dialled number; an unbound number is refused. Answers with call-control markup that connects the call's audio to the media-stream route, or declines the call when the deployment or the workspace is at capacity. Off unless the deployment enables it.", "security": [{"carrierSignature": []}], "x-sempera-server-to-server": true, "requestBody": {"required": true, "content": {"application/x-www-form-urlencoded": {"schema": {"$ref": "#/components/schemas/CarrierVoiceEvent"}}}}, "responses": {"200": {"description": "Call-control markup", "content": {"text/xml": {"schema": {"type": "string"}}}}, "400": {"description": "Invalid payload", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Invalid provider proof", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Ingress disabled or not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "413": {"description": "Payload too large", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "503": {"description": "Ingress unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks/text-assistant": {"post": {"operationId": "receiveTextAssistantMessage", "summary": "Verified text Assistant ingress", "tags": ["Webhook ingress"], "parameters": [], "description": "Server-to-server signed text ingress. Requires webhook-id, webhook-timestamp and webhook-signature over the raw body. Closed unless the channel is configured.", "security": [{"textSignature": []}], "x-sempera-server-to-server": true, "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TextProviderEvent"}}}}, "responses": {"202": {"description": "Accepted", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TextProviderReceipt"}}}}, "503": {"description": "Channel unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks/{webhook_id}": {"get": {"operationId": "getWebhook", "summary": "Get a webhook endpoint", "tags": ["Webhooks"], "parameters": [{"name": "webhook_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["webhooks:read"]}], "x-sempera-scope": "webhooks:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/WebhookEndpoint"}, {"type": "object", "required": ["agent"], "properties": {"agent": {"type": ["string", "null"], "description": "Immutable agent slug, or null for a workspace webhook."}}}]}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "patchWebhook", "summary": "Update a webhook endpoint", "tags": ["Webhooks"], "parameters": [{"name": "webhook_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["webhooks:write"]}], "x-sempera-scope": "webhooks:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookEndpointPatch"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/WebhookEndpoint"}, {"type": "object", "required": ["agent"], "properties": {"agent": {"type": ["string", "null"], "description": "Immutable agent slug, or null for a workspace webhook."}}}]}}}}, "409": {"description": "conflict with reason stale_webhook: the optional expected_updated_at sent is not the endpoint's updated_at any more; nothing is written, and the error names the updated_at on file", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "deleteWebhook", "summary": "Delete a webhook endpoint", "tags": ["Webhooks"], "parameters": [{"name": "webhook_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["webhooks:write"]}], "x-sempera-scope": "webhooks:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"allOf": [{"$ref": "#/components/schemas/WebhookEndpointDeleted"}, {"type": "object", "required": ["agent"], "properties": {"agent": {"type": ["string", "null"], "description": "Immutable agent slug, or null for a workspace webhook."}}}]}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks/{webhook_id}/deliveries": {"get": {"operationId": "listWebhookDeliveries", "summary": "Delivery attempts", "tags": ["Webhooks"], "parameters": [{"name": "webhook_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["webhooks:read"]}], "x-sempera-scope": "webhooks:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookDeliveryList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks/{webhook_id}/deliveries/{delivery_id}/resend": {"post": {"operationId": "resendWebhookDelivery", "summary": "Resend a recorded webhook delivery", "tags": ["Webhooks"], "parameters": [{"name": "webhook_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "delivery_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["webhooks:write"]}], "x-sempera-scope": "webhooks:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookResend"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/webhooks/{webhook_id}/test": {"post": {"operationId": "testWebhook", "summary": "Send a signed test event", "tags": ["Webhooks"], "parameters": [{"name": "webhook_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["webhooks:write"]}], "x-sempera-scope": "webhooks:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WebhookTest"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/widget-live-chats": {"get": {"operationId": "listWidgetLiveChats", "summary": "Read this agent's waiting and operator-held widget chats", "tags": ["Sessions"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["sessions:write"]}], "x-sempera-scope": "sessions:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["chats", "lifetime"], "properties": {"chats": {"type": "array", "items": {"type": "object", "required": ["id", "widget_id", "agent_id", "handoff", "revision", "messages", "expires_at"], "properties": {"id": {"type": "string"}, "widget_id": {"type": "string"}, "agent_id": {"type": "string"}, "handoff": {"type": "string", "enum": ["agent", "waiting", "operator"]}, "revision": {"type": "integer"}, "held_by_you": {"type": "boolean", "description": "Whether the caller is the desk member holding this chat"}, "messages": {"type": "array", "items": {"type": "object", "required": ["role", "text", "at"], "properties": {"id": {"type": "string"}, "role": {"type": "string", "enum": ["visitor", "agent", "operator"]}, "text": {"type": "string"}, "at": {"type": "string", "format": "date-time"}}}}, "expires_at": {"type": "string", "format": "date-time"}}}}, "lifetime": {"type": "string", "enum": ["chat"]}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/widget-live-chats/{chat_id}": {"post": {"operationId": "actOnWidgetLiveChat", "summary": "Claim, take over or reply to a widget chat, or return it to the agent", "tags": ["Sessions"], "parameters": [{"name": "agent_id", "in": "query", "required": true, "schema": {"type": "string"}}, {"name": "chat_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["sessions:write"]}], "x-sempera-scope": "sessions:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["action", "expected_revision"], "properties": {"action": {"type": "string", "enum": ["claim", "reclaim", "reply", "resume"]}, "expected_revision": {"type": "integer"}, "text": {"type": "string", "maxLength": 500}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["id", "widget_id", "agent_id", "handoff", "revision", "messages", "expires_at"], "properties": {"id": {"type": "string"}, "widget_id": {"type": "string"}, "agent_id": {"type": "string"}, "handoff": {"type": "string", "enum": ["agent", "waiting", "operator"]}, "revision": {"type": "integer"}, "held_by_you": {"type": "boolean", "description": "Whether the caller is the desk member holding this chat"}, "messages": {"type": "array", "items": {"type": "object", "required": ["role", "text", "at"], "properties": {"id": {"type": "string"}, "role": {"type": "string", "enum": ["visitor", "agent", "operator"]}, "text": {"type": "string"}, "at": {"type": "string", "format": "date-time"}}}}, "expires_at": {"type": "string", "format": "date-time"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/widget/custom-components": {"get": {"operationId": "listWidgetCustomComponents", "summary": "Widget custom components on this workspace's agents", "tags": ["Widgets"], "parameters": [], "security": [{"apiKey": ["sessions:read"]}], "x-sempera-scope": "sessions:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WidgetCustomComponentList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createWidgetCustomComponent", "summary": "Attach a custom component to a node of a widget's agent", "tags": ["Widgets"], "parameters": [], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "required": ["widget_id", "pathway_id", "pathway_node", "width", "height", "variables", "iframe_url"], "properties": {"widget_id": {"type": "string"}, "pathway_id": {"type": "string"}, "pathway_node": {"type": "string"}, "width": {"type": "string"}, "height": {"type": "string"}, "variables": {"type": "array", "items": {"type": "string"}}, "iframe_url": {"type": "string"}}}}}}, "responses": {"200": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WidgetCustomComponentEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/widget/custom-components/{id}": {"patch": {"operationId": "updateWidgetCustomComponent", "summary": "Update a widget custom component", "tags": ["Widgets"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"pathway_node": {"type": "string"}, "width": {"type": "string"}, "height": {"type": "string"}, "variables": {"type": "array", "items": {"type": "string"}}, "iframe_url": {"type": "string"}}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WidgetCustomComponentEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "deleteWidgetCustomComponent", "summary": "Remove a widget custom component", "tags": ["Widgets"], "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"204": {"description": "Deleted"}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/widget/threads": {"get": {"operationId": "compatListWidgetThreads", "summary": "Compatibility widget threads", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["sessions:read"]}], "x-sempera-scope": "sessions:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/widgets": {"get": {"operationId": "compatListWidgets", "summary": "Compatibility widgets", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["sessions:read"]}], "x-sempera-scope": "sessions:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/workspaces": {"get": {"operationId": "listWorkspaces", "summary": "List workspaces", "tags": ["Workspaces"], "parameters": [{"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 200}}, {"name": "cursor", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["workspaces:read"]}], "x-sempera-scope": "workspaces:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WorkspaceList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/workspaces/{workspace_id}": {"get": {"operationId": "getWorkspace", "summary": "Get a workspace", "tags": ["Workspaces"], "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["workspaces:read"]}], "x-sempera-scope": "workspaces:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Workspace"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "patchWorkspace", "summary": "Rename a workspace", "tags": ["Workspaces"], "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["workspaces:write"]}], "x-sempera-scope": "workspaces:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WorkspacePatch"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Workspace"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/workspaces/{workspace_id}/.well-known/jwks.json": {"get": {"operationId": "getWorkspaceJwks", "summary": "A workspace's public signing keys (JWKS)", "tags": ["Developer settings"], "parameters": [{"name": "workspace_id", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "Public by design, no credential: verify the RS256 JWT a signed request carries.", "security": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/WorkspaceJwks"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents": {"get": {"operationId": "compatV2ListAgents", "summary": "Compatibility v2 agents", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/starter": {"get": {"operationId": "compatV2GetStarter", "summary": "The workspace's starter agent", "tags": ["Compatibility"], "parameters": [], "description": "null data when the workspace has no AI employee yet.", "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "compatV2CreateStarter", "summary": "Create the workspace's starter agent once", "tags": ["Compatibility"], "parameters": [], "description": "Creates nothing when the workspace already has an employee.", "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"template": {"type": "string"}, "name": {"type": "string"}}}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "200": {"description": "The workspace already has one", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/starter-templates": {"get": {"operationId": "compatV2ListStarterTemplates", "summary": "Job templates a new agent can start from", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}": {"get": {"operationId": "compatV2GetAgent", "summary": "Compatibility v2 agent", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/branches": {"get": {"operationId": "compatV2ListBranches", "summary": "List v2 agent branches", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "compatV2CreateBranch", "summary": "Create v2 agent branch", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/branches/{branch_id}": {"delete": {"operationId": "compatV2DeleteBranch", "summary": "Delete v2 agent branch", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "branch_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/branches/{branch_id}/merge": {"post": {"operationId": "compatV2MergeBranch", "summary": "Merge v2 agent branch", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "branch_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/branches/{branch_id}/rebase": {"post": {"operationId": "compatV2RebaseBranch", "summary": "Rebase v2 agent branch", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "branch_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/branches/{branch_id}/rebase-preview": {"post": {"operationId": "compatV2PreviewBranchRebase", "summary": "Preview v2 agent branch rebase", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "branch_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/check-runs": {"get": {"operationId": "compatV2ListCheckRuns", "summary": "Compatibility v2 check runs", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["evals:read"]}], "x-sempera-scope": "evals:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/deployments": {"get": {"operationId": "compatV2ListDeployments", "summary": "Compatibility v2 deployments", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["deploy:read"]}], "x-sempera-scope": "deploy:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions": {"get": {"operationId": "compatV2ListDispositions", "summary": "List v2 agent dispositions", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "compatV2CreateDisposition", "summary": "Create v2 agent disposition", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/extractor-catalog": {"get": {"operationId": "compatV2GetDispositionExtractorCatalog", "summary": "List v2 published disposition extractors", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/extractors": {"get": {"operationId": "compatV2ListDispositionExtractors", "summary": "List v2 disposition extractors", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "Workspace-wide extractors plus this agent's scoped ones, most recently updated first.", "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "compatV2CreateDispositionExtractor", "summary": "Create v2 disposition extractor", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "Body {key, name, description?, scopedToAgent?, systemPromptMd?, promptMd, outputSchema, inferenceConfig}. Version 1 is created editable.", "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/extractors/{extractor_uuid}": {"get": {"operationId": "compatV2GetDispositionExtractor", "summary": "Get v2 disposition extractor", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "extractor_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/extractors/{extractor_uuid}/draft": {"patch": {"operationId": "compatV2UpdateDispositionExtractorDraft", "summary": "Update v2 disposition extractor draft", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "extractor_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "Guarded by expectedVersionId and expectedDraftRevision (409 when either moved).", "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/extractors/{extractor_uuid}/publish": {"post": {"operationId": "compatV2PublishDispositionExtractor", "summary": "Publish v2 disposition extractor", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "extractor_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "Archives the editable version as the active one and opens an editable copy. Owner role.", "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/extractors/{extractor_uuid}/versions/{version_uuid}": {"get": {"operationId": "compatV2GetDispositionExtractorVersion", "summary": "Get v2 disposition extractor version", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "extractor_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "version_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/model-profile-catalog": {"get": {"operationId": "compatV2GetDispositionModelProfileCatalog", "summary": "List v2 disposition extractor model profiles", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "The one post-call reader Sempera runs, as the profile `balanced`.", "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/variable-catalog": {"get": {"operationId": "compatV2GetDispositionVariableCatalog", "summary": "List v2 disposition variable catalog", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/{disposition_uuid}": {"get": {"operationId": "compatV2GetDisposition", "summary": "Get v2 agent disposition", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "compatV2DeleteDisposition", "summary": "Delete v2 agent disposition", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/{disposition_uuid}/disable": {"post": {"operationId": "compatV2DisableDisposition", "summary": "Disable v2 disposition", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/{disposition_uuid}/draft": {"get": {"operationId": "compatV2GetDispositionDraft", "summary": "Get v2 disposition draft", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "compatV2UpdateDispositionDraft", "summary": "Replace v2 disposition draft", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/{disposition_uuid}/estimates": {"post": {"operationId": "compatV2EstimateDisposition", "summary": "Estimate v2 disposition cost", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/{disposition_uuid}/publish": {"post": {"operationId": "compatV2PublishDisposition", "summary": "Publish v2 disposition", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/{disposition_uuid}/runs": {"get": {"operationId": "compatV2ListDispositionRuns", "summary": "List v2 disposition test runs", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "compatV2CreateDispositionRun", "summary": "Start v2 disposition test run", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/{disposition_uuid}/runs/{run_uuid}": {"get": {"operationId": "compatV2GetDispositionRun", "summary": "Get v2 disposition test run", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "run_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/{disposition_uuid}/runs/{run_uuid}/align": {"post": {"operationId": "compatV2AlignDispositionRun", "summary": "Align v2 disposition test run", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "run_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "Body {valueIds?, instructions?}. Proposes rewrites from the run's corrections and writes nothing; 503 when no model is reachable, 429 past 30 requests an hour per workspace.", "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/{disposition_uuid}/runs/{run_uuid}/cases/{call_id}/annotations/{value_id}": {"get": {"operationId": "compatV2ListDispositionRunAnnotations", "summary": "List v2 disposition test run corrections", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "run_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "call_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "value_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "put": {"operationId": "compatV2PutDispositionRunAnnotation", "summary": "Correct v2 disposition test run value", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "run_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "call_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "value_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/{disposition_uuid}/runs/{run_uuid}/export-csv": {"get": {"operationId": "compatV2ExportDispositionRunCsv", "summary": "Export v2 disposition test run CSV", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "run_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "Success is text/csv (UTF-8 with a byte order mark, CRLF rows); errors use the JSON envelope.", "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "string"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/{disposition_uuid}/runs/{run_uuid}/rows": {"get": {"operationId": "compatV2ListDispositionRunRows", "summary": "List v2 disposition test run rows", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "run_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 250}}, {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/{disposition_uuid}/versions": {"get": {"operationId": "compatV2ListDispositionVersions", "summary": "List v2 disposition versions", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "beforeVersion", "in": "query", "schema": {"type": "integer", "minimum": 1}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/dispositions/{disposition_uuid}/versions/{version_uuid}": {"get": {"operationId": "compatV2GetDispositionVersion", "summary": "Get v2 disposition version", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "disposition_uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "version_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/environments": {"get": {"operationId": "compatV2ListEnvironments", "summary": "Compatibility v2 environments", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["deploy:read"]}], "x-sempera-scope": "deploy:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/environments/staging/checks": {"get": {"operationId": "compatV2GetStagingChecks", "summary": "Compatibility v2 staging checks", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["deploy:read"]}], "x-sempera-scope": "deploy:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/environments/{env}/variables": {"get": {"operationId": "compatV2ListVariables", "summary": "List v2 agent environment variables", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "env", "in": "path", "required": true, "schema": {"type": "string", "enum": ["dev", "staging", "prod", "production"]}}], "description": "Sorted by key. A secret's value is always null.", "security": [{"apiKey": ["deploy:read"]}], "x-sempera-scope": "deploy:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "compatV2SaveVariable", "summary": "Create or replace a v2 agent environment variable", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "env", "in": "path", "required": true, "schema": {"type": "string", "enum": ["dev", "staging", "prod", "production"]}}], "description": "Body {key, value, secret}. prod needs the owner role; dev and staging an operator.", "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/environments/{env}/variables/{key}": {"put": {"operationId": "compatV2PutVariable", "summary": "Set a v2 agent environment variable", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "env", "in": "path", "required": true, "schema": {"type": "string", "enum": ["dev", "staging", "prod", "production"]}}, {"name": "key", "in": "path", "required": true, "schema": {"type": "string", "pattern": "^[A-Z][A-Z0-9_]{0,63}$"}}], "description": "Body {value, is_secret}. prod needs the owner role; dev and staging an operator.", "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "compatV2DeleteVariable", "summary": "Delete a v2 agent environment variable", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "env", "in": "path", "required": true, "schema": {"type": "string", "enum": ["dev", "staging", "prod", "production"]}}, {"name": "key", "in": "path", "required": true, "schema": {"type": "string", "pattern": "^[A-Z][A-Z0-9_]{0,63}$"}}], "description": "A key that is not there answers 200 with deleted false.", "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/experiments": {"get": {"operationId": "compatV2ListExperiments", "summary": "List experiments", "tags": ["Experiments"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "Splits new conversations only on the channels in served_on. It does not enable a channel, place calls, change consent or bypass admission caps. Only verified published versions of this agent can be compared. Republishing the baseline suspends assignment; stopping affects new conversations, not conversations already open. Schedules and call quotas are not supported and are rejected. See /docs/tests-and-evals.md#experiments.", "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["experiments", "served_on", "not_served"], "properties": {"experiments": {"type": "array", "items": {"type": "object", "required": ["id", "agent_id", "client", "name", "status", "variant_version_id", "variant_percent", "traffic_percentage", "control_version_id", "baseline_current_version_id", "created_at", "started_at", "stopped_at", "served_on", "not_served"], "properties": {"id": {"type": "string", "format": "uuid"}, "agent_id": {"type": "string"}, "client": {"type": "string"}, "name": {"type": "string", "minLength": 1, "maxLength": 80}, "status": {"enum": ["draft", "running", "stopped"]}, "variant_version_id": {"type": "string"}, "variant_percent": {"type": "integer", "minimum": 1, "maximum": 99}, "traffic_percentage": {"type": "integer", "minimum": 1, "maximum": 99}, "control_version_id": {"type": ["string", "null"]}, "baseline_current_version_id": {"type": ["string", "null"]}, "created_at": {"type": ["string", "null"], "format": "date-time"}, "started_at": {"type": ["string", "null"], "format": "date-time"}, "stopped_at": {"type": ["string", "null"], "format": "date-time"}, "served_on": {"type": "array", "items": {"type": "string"}}, "not_served": {"type": "array", "items": {"type": "string"}}}}}, "served_on": {"type": "array", "items": {"type": "string"}}, "not_served": {"type": "array", "items": {"type": "string"}}}}, "errors": {"type": "null"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createExperiment", "summary": "Create and start experiment", "tags": ["Experiments"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "Splits new conversations only on the channels in served_on. It does not enable a channel, place calls, change consent or bypass admission caps. Only verified published versions of this agent can be compared. Republishing the baseline suspends assignment; stopping affects new conversations, not conversations already open. Schedules and call quotas are not supported and are rejected. See /docs/tests-and-evals.md#experiments.", "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "minProperties": 1, "properties": {"name": {"type": "string", "minLength": 1, "maxLength": 80}, "traffic_percentage": {"type": "integer", "minimum": 1, "maximum": 99}, "variant_percent": {"type": "integer", "minimum": 1, "maximum": 99}, "variant_version_id": {"type": "string", "minLength": 1}}, "required": ["variant_version_id"], "anyOf": [{"required": ["traffic_percentage"]}, {"required": ["variant_percent"]}], "not": {"required": ["traffic_percentage", "variant_percent"]}}}}}, "responses": {"201": {"description": "Experiment started", "content": {"application/json": {"schema": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["experiment"], "properties": {"experiment": {"type": "object", "required": ["id", "agent_id", "client", "name", "status", "variant_version_id", "variant_percent", "traffic_percentage", "control_version_id", "baseline_current_version_id", "created_at", "started_at", "stopped_at", "served_on", "not_served"], "properties": {"id": {"type": "string", "format": "uuid"}, "agent_id": {"type": "string"}, "client": {"type": "string"}, "name": {"type": "string", "minLength": 1, "maxLength": 80}, "status": {"enum": ["draft", "running", "stopped"]}, "variant_version_id": {"type": "string"}, "variant_percent": {"type": "integer", "minimum": 1, "maximum": 99}, "traffic_percentage": {"type": "integer", "minimum": 1, "maximum": 99}, "control_version_id": {"type": ["string", "null"]}, "baseline_current_version_id": {"type": ["string", "null"]}, "created_at": {"type": ["string", "null"], "format": "date-time"}, "started_at": {"type": ["string", "null"], "format": "date-time"}, "stopped_at": {"type": ["string", "null"], "format": "date-time"}, "served_on": {"type": "array", "items": {"type": "string"}}, "not_served": {"type": "array", "items": {"type": "string"}}}}}}, "errors": {"type": "null"}}}}}}, "503": {"description": "Customer database unavailable", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/experiments/{experiment_id}": {"get": {"operationId": "getExperiment", "summary": "Get experiment", "tags": ["Experiments"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "experiment_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["experiment"], "properties": {"experiment": {"type": "object", "required": ["id", "agent_id", "client", "name", "status", "variant_version_id", "variant_percent", "traffic_percentage", "control_version_id", "baseline_current_version_id", "created_at", "started_at", "stopped_at", "served_on", "not_served"], "properties": {"id": {"type": "string", "format": "uuid"}, "agent_id": {"type": "string"}, "client": {"type": "string"}, "name": {"type": "string", "minLength": 1, "maxLength": 80}, "status": {"enum": ["draft", "running", "stopped"]}, "variant_version_id": {"type": "string"}, "variant_percent": {"type": "integer", "minimum": 1, "maximum": 99}, "traffic_percentage": {"type": "integer", "minimum": 1, "maximum": 99}, "control_version_id": {"type": ["string", "null"]}, "baseline_current_version_id": {"type": ["string", "null"]}, "created_at": {"type": ["string", "null"], "format": "date-time"}, "started_at": {"type": ["string", "null"], "format": "date-time"}, "stopped_at": {"type": ["string", "null"], "format": "date-time"}, "served_on": {"type": "array", "items": {"type": "string"}}, "not_served": {"type": "array", "items": {"type": "string"}}}}}}, "errors": {"type": "null"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "patch": {"operationId": "updateExperiment", "summary": "Update experiment", "tags": ["Experiments"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "experiment_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": false, "minProperties": 1, "properties": {"name": {"type": "string", "minLength": 1, "maxLength": 80}, "traffic_percentage": {"type": "integer", "minimum": 1, "maximum": 99}, "variant_percent": {"type": "integer", "minimum": 1, "maximum": 99}}, "not": {"required": ["traffic_percentage", "variant_percent"]}}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["experiment"], "properties": {"experiment": {"type": "object", "required": ["id", "agent_id", "client", "name", "status", "variant_version_id", "variant_percent", "traffic_percentage", "control_version_id", "baseline_current_version_id", "created_at", "started_at", "stopped_at", "served_on", "not_served"], "properties": {"id": {"type": "string", "format": "uuid"}, "agent_id": {"type": "string"}, "client": {"type": "string"}, "name": {"type": "string", "minLength": 1, "maxLength": 80}, "status": {"enum": ["draft", "running", "stopped"]}, "variant_version_id": {"type": "string"}, "variant_percent": {"type": "integer", "minimum": 1, "maximum": 99}, "traffic_percentage": {"type": "integer", "minimum": 1, "maximum": 99}, "control_version_id": {"type": ["string", "null"]}, "baseline_current_version_id": {"type": ["string", "null"]}, "created_at": {"type": ["string", "null"], "format": "date-time"}, "started_at": {"type": ["string", "null"], "format": "date-time"}, "stopped_at": {"type": ["string", "null"], "format": "date-time"}, "served_on": {"type": "array", "items": {"type": "string"}}, "not_served": {"type": "array", "items": {"type": "string"}}}}}}, "errors": {"type": "null"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/experiments/{experiment_id}/results": {"get": {"operationId": "getExperimentResults", "summary": "Get observed experiment results", "tags": ["Experiments"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "experiment_id", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "Observed outcomes from experiment-tagged conversation records, not projected traffic. Empty arms have null rates. No automatic winner or disposition scores.", "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["experiment", "arms", "reading", "measure", "dispositions", "served_on", "not_served"], "properties": {"experiment": {"type": "object", "required": ["id", "agent_id", "client", "name", "status", "variant_version_id", "variant_percent", "traffic_percentage", "control_version_id", "baseline_current_version_id", "created_at", "started_at", "stopped_at", "served_on", "not_served"], "properties": {"id": {"type": "string", "format": "uuid"}, "agent_id": {"type": "string"}, "client": {"type": "string"}, "name": {"type": "string", "minLength": 1, "maxLength": 80}, "status": {"enum": ["draft", "running", "stopped"]}, "variant_version_id": {"type": "string"}, "variant_percent": {"type": "integer", "minimum": 1, "maximum": 99}, "traffic_percentage": {"type": "integer", "minimum": 1, "maximum": 99}, "control_version_id": {"type": ["string", "null"]}, "baseline_current_version_id": {"type": ["string", "null"]}, "created_at": {"type": ["string", "null"], "format": "date-time"}, "started_at": {"type": ["string", "null"], "format": "date-time"}, "stopped_at": {"type": ["string", "null"], "format": "date-time"}, "served_on": {"type": "array", "items": {"type": "string"}}, "not_served": {"type": "array", "items": {"type": "string"}}}}, "arms": {"type": "array", "minItems": 2, "maxItems": 2, "items": {"type": "object", "required": ["arm", "agent_version_id", "conversations", "outcomes", "reached_result", "result_rate", "average_turns", "flagged"], "properties": {"arm": {"enum": ["control", "variant"]}, "agent_version_id": {"type": ["string", "null"]}, "conversations": {"type": "integer", "minimum": 0}, "reached_result": {"type": "integer", "minimum": 0}, "flagged": {"type": "integer", "minimum": 0}, "result_rate": {"type": ["number", "null"]}, "average_turns": {"type": ["number", "null"]}, "outcomes": {"type": "array", "items": {"type": "object", "required": ["key", "label", "count"], "properties": {"key": {"type": "string"}, "label": {"type": "string"}, "count": {"type": "integer", "minimum": 0}}}}}}}, "reading": {"type": "object", "required": ["level", "difference_points", "margin_points", "sentence"], "properties": {"level": {"enum": ["none", "too_few", "early", "enough"]}, "sentence": {"type": "string"}, "difference_points": {"type": ["number", "null"]}, "margin_points": {"type": ["number", "null"]}}}, "measure": {"type": "string"}, "dispositions": {"type": "object", "required": ["available", "reason"], "properties": {"available": {"const": false}, "reason": {"type": "string"}}}, "served_on": {"type": "array", "items": {"type": "string"}}, "not_served": {"type": "array", "items": {"type": "string"}}}}, "errors": {"type": "null"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/experiments/{experiment_id}/stop": {"post": {"operationId": "stopExperiment", "summary": "Stop experiment", "tags": ["Experiments"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "experiment_id", "in": "path", "required": true, "schema": {"type": "string"}}], "description": "No options. Repeated stops return the same stopped experiment. Existing conversations keep their version.", "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["experiment"], "properties": {"experiment": {"type": "object", "required": ["id", "agent_id", "client", "name", "status", "variant_version_id", "variant_percent", "traffic_percentage", "control_version_id", "baseline_current_version_id", "created_at", "started_at", "stopped_at", "served_on", "not_served"], "properties": {"id": {"type": "string", "format": "uuid"}, "agent_id": {"type": "string"}, "client": {"type": "string"}, "name": {"type": "string", "minLength": 1, "maxLength": 80}, "status": {"enum": ["draft", "running", "stopped"]}, "variant_version_id": {"type": "string"}, "variant_percent": {"type": "integer", "minimum": 1, "maximum": 99}, "traffic_percentage": {"type": "integer", "minimum": 1, "maximum": 99}, "control_version_id": {"type": ["string", "null"]}, "baseline_current_version_id": {"type": ["string", "null"]}, "created_at": {"type": ["string", "null"], "format": "date-time"}, "started_at": {"type": ["string", "null"], "format": "date-time"}, "stopped_at": {"type": ["string", "null"], "format": "date-time"}, "served_on": {"type": "array", "items": {"type": "string"}}, "not_served": {"type": "array", "items": {"type": "string"}}}}}}, "errors": {"type": "null"}}}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/inbound": {"get": {"operationId": "compatV2GetInbound", "summary": "Compatibility v2 inbound", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/pathway-organization": {"post": {"operationId": "organizeAgentPathways", "summary": "Create pathway folders, move pathways and save their order", "tags": ["Scenarios"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/scenarios": {"get": {"operationId": "listAgentScenarios", "summary": "List an agent's scenarios", "tags": ["Scenarios"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "createAgentScenario", "summary": "Add a scenario to an agent's draft", "tags": ["Scenarios"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/scenarios/agent/history": {"get": {"operationId": "compatV2GetAgentScenarioHistory", "summary": "The agent's own words per published version", "tags": ["Scenarios"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/scenarios/{scenario_uuid}": {"get": {"operationId": "getAgentScenario", "summary": "One scenario", "tags": ["Scenarios"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "scenario_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "post": {"operationId": "updateAgentScenario", "summary": "Update a pathway in the agent's draft", "tags": ["Scenarios"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "scenario_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "409": {"description": "CONFLICT: a stale save carries reason stale_scenario and the current draft revision; ask the owner before retrying. Other conflicts carry neither field.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}, "delete": {"operationId": "deleteAgentScenario", "summary": "Delete a scenario (from the draft, or from the archive)", "tags": ["Scenarios"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "scenario_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/scenarios/{scenario_uuid}/archive": {"post": {"operationId": "archiveAgentScenario", "summary": "Archive a scenario (out of the draft, restorable)", "tags": ["Scenarios"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "scenario_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/scenarios/{scenario_uuid}/copy": {"post": {"operationId": "copyAgentScenario", "summary": "Copy a scenario to another agent of this workspace", "tags": ["Scenarios"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "scenario_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object"}}}}, "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/scenarios/{scenario_uuid}/history": {"get": {"operationId": "compatV2GetScenarioHistory", "summary": "One scenario per published version", "tags": ["Scenarios"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "scenario_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/scenarios/{scenario_uuid}/restore": {"post": {"operationId": "restoreAgentScenario", "summary": "Restore an archived scenario into the draft", "tags": ["Scenarios"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "scenario_uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:write"]}], "x-sempera-scope": "agents:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/versions": {"get": {"operationId": "compatV2ListVersions", "summary": "Compatibility v2 versions", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["deploy:read"]}], "x-sempera-scope": "deploy:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/agents/{uuid}/versions/latest": {"get": {"operationId": "compatV2GetLatestVersion", "summary": "Compatibility v2 latest version", "tags": ["Compatibility"], "parameters": [{"name": "uuid", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["deploy:read"]}], "x-sempera-scope": "deploy:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/analytics/overview": {"get": {"operationId": "compatV2GetAnalyticsOverview", "summary": "Compatibility v2 analytics overview", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/batches/create": {"post": {"operationId": "createBatch", "summary": "Create and start a call batch", "tags": ["Batches"], "parameters": [{"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "responses": {"201": {"description": "Created", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicBatchCreated"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/batches/list": {"get": {"operationId": "compatV2ListBatches", "summary": "Compatibility v2 batches", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/batches/schema/files": {"get": {"operationId": "compatV2GetBatchFileSchema", "summary": "Compatibility v2 batch file schema", "tags": ["Compatibility"], "parameters": [], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/batches/{batch_id}": {"get": {"operationId": "getBatch", "summary": "Get batch", "tags": ["Batches"], "parameters": [{"name": "batch_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicBatchDetail"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/batches/{batch_id}/logs": {"get": {"operationId": "getBatchLogs", "summary": "Get batch attempts", "tags": ["Batches"], "parameters": [{"name": "batch_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["calls:read"]}], "x-sempera-scope": "calls:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicBatchLogs"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/batches/{batch_id}/run": {"post": {"operationId": "advanceBatch", "summary": "Advance due batch recipients", "tags": ["Batches"], "parameters": [{"name": "batch_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": true, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicBatchPass"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/batches/{batch_id}/stop": {"post": {"operationId": "stopBatch", "summary": "Stop queued batch recipients", "tags": ["Batches"], "parameters": [{"name": "batch_id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "Idempotency-Key", "in": "header", "required": false, "schema": {"type": "string", "maxLength": 255}, "description": "Replays the stored answer for a retry of the same request; 409 for a different request under the same key."}], "security": [{"apiKey": ["calls:write"]}], "x-sempera-scope": "calls:write", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicBatchStopped"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/models": {"get": {"operationId": "listModelsV2Public", "summary": "Public, unauthenticated model discovery", "tags": ["Models"], "parameters": [], "description": "Sempera's text-to-speech models in the list shape many client libraries expect.", "security": [], "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ModelDiscovery"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/scenarios": {"get": {"operationId": "listWorkspaceScenarios", "summary": "Every agent's scenarios in this workspace", "tags": ["Scenarios"], "parameters": [{"name": "agent_id", "in": "query", "schema": {"type": "string"}}], "security": [{"apiKey": ["agents:read"]}], "x-sempera-scope": "agents:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CompatEnvelope"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/tts/models": {"get": {"operationId": "listTtsModelsV2", "summary": "List what each Sempera TTS model supports", "tags": ["Models"], "parameters": [], "security": [{"apiKey": ["models:read"]}], "x-sempera-scope": "models:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TtsModelList"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "404": {"description": "Not found (or not in your scope)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v2/tts/models/{model_id}": {"get": {"operationId": "getTtsModelV2", "summary": "What one Sempera TTS model supports", "tags": ["Models"], "parameters": [{"name": "model_id", "in": "path", "required": true, "schema": {"type": "string"}}], "security": [{"apiKey": ["models:read"]}], "x-sempera-scope": "models:read", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TtsModel"}}}}, "404": {"description": "Unknown model", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "400": {"description": "Validation failed", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "401": {"description": "Authentication required or invalid credential", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "403": {"description": "Insufficient scope or role", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "409": {"description": "Conflict", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "429": {"description": "Rate limited (Retry-After)", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}}, "components": {"schemas": {"CreditBalance": {"type": "object", "required": ["object", "workspace_id", "balance", "held", "spent_total", "costs", "packs"], "properties": {"object": {"const": "credit_balance"}, "workspace_id": {"type": "string"}, "balance": {"type": "integer", "minimum": 0, "description": "Credits available now."}, "held": {"type": "integer", "minimum": 0, "description": "Credits held for work in progress, already out of balance."}, "spent_total": {"type": "integer", "minimum": 0}, "free_grant": {"type": "integer"}, "expires": {"const": false, "description": "Credits never expire."}, "pays_for": {"type": "string"}, "does_not_pay_for": {"type": "string"}, "also": {"type": "string"}, "debt": {"type": "integer", "minimum": 0, "description": "Credits owed after a refund or dispute. Blocks building and packs."}, "can_buy": {"type": "boolean"}, "buy_note": {"type": ["string", "null"]}, "test_packs_add_credits": {"type": "boolean"}, "costs": {"type": "array", "items": {"type": "object", "required": ["action", "label", "credits", "unit", "held"], "properties": {"action": {"type": "string"}, "label": {"type": "string"}, "credits": {"type": "integer"}, "unit": {"type": "string"}, "held": {"type": "integer", "description": "What one start holds before its size is known."}}}}, "packs": {"type": "array", "items": {"type": "object", "required": ["pack", "credits", "amount_cents", "currency"], "properties": {"pack": {"type": "string"}, "credits": {"type": "integer"}, "amount_cents": {"type": "integer"}, "currency": {"type": "string"}}}}}}, "CreditHistory": {"type": "object", "required": ["object", "data", "has_more", "next_before"], "properties": {"object": {"const": "list"}, "has_more": {"type": "boolean"}, "next_before": {"type": ["integer", "null"]}, "data": {"type": "array", "items": {"type": "object", "required": ["id", "kind", "description", "amount", "balance_after", "created_at"], "properties": {"object": {"const": "credit_entry"}, "id": {"type": "integer"}, "kind": {"enum": ["grant", "purchase", "spend", "refund", "reversal", "restore"]}, "action": {"type": ["string", "null"]}, "description": {"type": "string"}, "amount": {"type": "integer"}, "balance_after": {"type": "integer"}, "created_at": {"type": "string"}}}}}}, "AgentDeleted": {"type": "object", "description": "Deletion confirmation and public receipt fields. Legacy diagnostics are not part of this contract.", "required": ["object", "id", "deleted", "result"], "properties": {"object": {"const": "agent"}, "id": {"type": "string"}, "deleted": {"const": true}, "result": {"type": "object", "required": ["client", "receipt_id"], "properties": {"client": {"type": "string"}, "receipt_id": {"type": ["string", "null"]}, "deleted": {"const": true}, "already_deleted": {"const": true}, "counts": {"type": "object", "additionalProperties": {"type": "integer"}}}}}}, "AgentDraftDiscarded": {"type": "object", "description": "Discard confirmation with the public identity and published version from the editor reading.", "required": ["object", "agent_id", "discarded", "result"], "properties": {"object": {"const": "agent_draft"}, "agent_id": {"type": "string"}, "discarded": {"const": true}, "result": {"type": "object", "properties": {"client": {"type": "string"}, "business": {"type": ["string", "null"]}, "published": {"type": ["object", "null"], "properties": {"version_number": {"type": ["integer", "null"]}, "agent_version_id": {"type": ["string", "null"]}, "created_at": {"type": ["string", "null"]}}}}}}}, "AgentPreviewTurn": {"type": "object", "description": "Typed reply, transcript and tool timing. Runtime diagnostics are not documented.", "required": ["object", "agent_id", "version", "session_id", "reply", "transcript", "tool_calls", "ended", "note"], "properties": {"object": {"const": "agent_preview_turn"}, "agent_id": {"type": "string"}, "version": {"type": "string"}, "session_id": {"type": "string"}, "reply": {"type": "string"}, "ended": {"type": "boolean"}, "note": {"type": ["string", "null"]}, "supply_posture": {"type": "string"}, "evaluation_label": {"type": "string"}, "transcript": {"type": "array", "items": {"type": "object", "required": ["role", "text", "at"], "properties": {"role": {"type": "string"}, "text": {"type": "string"}, "at": {"type": "string"}}}}, "tool_calls": {"type": "array", "items": {"type": "object", "properties": {"name": {"type": "string"}, "environment": {"type": ["string", "null"]}, "ms": {"type": ["number", "null"]}}}}}}, "AgentPublished": {"type": "object", "description": "Published version and applied changes. Internal build evidence and check jobs are not documented.", "required": ["object", "agent_id", "version", "result"], "properties": {"object": {"const": "agent_publish"}, "agent_id": {"type": "string"}, "version": {"anyOf": [{"type": "null"}, {"$ref": "#/components/schemas/AgentVersion"}]}, "result": {"type": "object", "required": ["ok", "client", "version", "changes"], "properties": {"ok": {"const": true}, "client": {"type": "string"}, "version": {"type": "object", "required": ["version_number", "agent_version_id", "created_at", "created"], "properties": {"version_number": {"type": ["integer", "null"]}, "agent_version_id": {"type": ["string", "null"]}, "created_at": {"type": ["string", "null"]}, "created": {"type": "boolean"}}}, "changes": {"type": "array", "items": {"type": "object", "required": ["id", "label", "risk", "status"], "properties": {"id": {"type": "string"}, "label": {"type": "string"}, "risk": {"type": "string"}, "status": {"const": "APPLIED"}}}}}}}}, "DeploymentControl": {"type": "object", "required": ["available", "why", "will_happen", "will_not_happen"], "properties": {"available": {"type": "boolean"}, "why": {"type": "string"}, "will_happen": {"type": "string"}, "will_not_happen": {"type": "string"}}}, "AgentDeploymentLedger": {"type": "object", "description": "Public version, deployment history and available controls from the legacy ledger. Infrastructure records are not documented.", "required": ["client", "current_version", "current_version_error", "deployments", "rollbacks", "live_statement", "controls", "derived", "rule"], "properties": {"client": {"type": "string"}, "derived": {"const": true}, "rule": {"type": "string"}, "current_version": {"type": ["object", "null"], "required": ["agent_version_id", "version_number"], "properties": {"agent_version_id": {"type": "string"}, "version_number": {"type": "integer"}}}, "current_version_error": {"type": ["string", "null"]}, "live_statement": {"type": "string"}, "deployments": {"type": "array", "items": {"type": "object", "properties": {"deployment_id": {"type": "string"}, "agent_version_id": {"type": "string"}, "version_number": {"type": ["integer", "null"]}, "outcome": {"type": "string"}}}}, "rollbacks": {"type": "array", "items": {"$ref": "#/components/schemas/AgentRollbackRecord"}}, "controls": {"type": "object", "additionalProperties": {"$ref": "#/components/schemas/DeploymentControl"}}}}, "AgentRollbackRecord": {"type": "object", "required": ["rollback_id", "from_deployment_id", "to_deployment_id", "agent_version_id", "version_number", "requested_by", "requested_at", "outcome", "detail"], "properties": {"rollback_id": {"type": "string"}, "from_deployment_id": {"type": ["string", "null"]}, "to_deployment_id": {"type": "string"}, "agent_version_id": {"type": "string"}, "version_number": {"type": ["integer", "null"]}, "requested_by": {"type": "string"}, "requested_at": {"type": "string"}, "outcome": {"type": "string"}, "detail": {"type": ["string", "null"]}}}, "AgentRolledBack": {"type": "object", "required": ["object", "agent_id", "rollback", "view"], "properties": {"object": {"const": "agent_rollback"}, "agent_id": {"type": "string"}, "rollback": {"$ref": "#/components/schemas/AgentRollbackRecord"}, "view": {"$ref": "#/components/schemas/AgentDeploymentLedger"}}}, "AgentArchived": {"allOf": [{"$ref": "#/components/schemas/Agent"}], "required": ["archive"], "properties": {"archive": {"type": "object", "required": ["client", "archived", "archived_at", "archived_by", "reason"], "properties": {"client": {"type": "string"}, "archived": {"const": true}, "archived_at": {"type": "string"}, "archived_by": {"type": "string"}, "reason": {"type": "string"}}}}}, "AgentUnarchived": {"allOf": [{"$ref": "#/components/schemas/Agent"}], "required": ["archive"], "properties": {"archive": {"type": "object", "required": ["client", "archived"], "properties": {"client": {"type": "string"}, "archived": {"const": false}}}}}, "IntegrationVerification": {"type": "object", "description": "Connection test status and whether a request was sent. Request headers and credential references are not documented.", "required": ["object", "integration_id", "status", "connector", "name", "sent", "environment", "will_happen", "will_not_happen"], "properties": {"object": {"const": "integration_verification"}, "integration_id": {"type": "string"}, "status": {"enum": ["connected", "error"]}, "connector": {"type": ["string", "null"]}, "name": {"type": ["string", "null"]}, "sent": {"type": "boolean"}, "environment": {"enum": ["MOCK", "SANDBOX"]}, "will_happen": {"type": ["string", "null"]}, "will_not_happen": {"type": ["string", "null"]}}}, "KnowledgeMutationDocument": {"type": "object", "required": ["id", "filename", "status"], "properties": {"id": {"type": "string"}, "filename": {"type": "string"}, "status": {"type": "string"}, "error": {"type": ["string", "null"]}}}, "KnowledgeSourceDeleted": {"type": "object", "required": ["object", "id", "agent_id", "deleted", "result"], "properties": {"object": {"const": "knowledge_source"}, "id": {"type": "string"}, "agent_id": {"type": "string"}, "deleted": {"const": true}, "result": {"type": "object", "required": ["ok", "client", "document", "will_happen", "will_not_happen"], "properties": {"ok": {"const": true}, "client": {"type": "string"}, "document": {"$ref": "#/components/schemas/KnowledgeMutationDocument"}, "will_happen": {"type": "string"}, "will_not_happen": {"type": "string"}}}}}, "KnowledgeSourceReparsed": {"type": "object", "required": ["object", "id", "agent_id", "processing", "result"], "properties": {"object": {"const": "knowledge_source"}, "id": {"type": "string"}, "agent_id": {"type": "string"}, "processing": {"type": "object", "required": ["state", "error"], "properties": {"state": {"type": ["string", "null"]}, "error": {"type": ["string", "null"]}}}, "result": {"type": "object", "required": ["ok", "client", "document"], "properties": {"ok": {"const": true}, "client": {"type": "string"}, "document": {"$ref": "#/components/schemas/KnowledgeMutationDocument"}}}}}, "EvalResults": {"type": "object", "description": "Stored verdict counts and empty-state explanation. Evaluator diagnostics are not documented.", "required": ["object", "agent_id", "client", "derived", "counts", "empty_reason"], "properties": {"object": {"const": "eval_results"}, "agent_id": {"type": "string"}, "client": {"type": "string"}, "derived": {"const": true}, "rule": {"type": "string"}, "statement": {"type": "string"}, "empty_reason": {"type": ["string", "null"]}, "counts": {"type": "array", "items": {"type": "object", "required": ["criterion_id", "name", "pass", "fail", "unknown", "total", "pass_rate", "pass_rate_note"], "properties": {"criterion_id": {"type": "string"}, "name": {"type": "string"}, "pass": {"type": "integer"}, "fail": {"type": "integer"}, "unknown": {"type": "integer"}, "total": {"type": "integer"}, "pass_rate": {"type": ["number", "null"]}, "pass_rate_note": {"type": ["string", "null"]}}}}}}, "EvalQuickRun": {"type": "object", "description": "Unsaved per-call verdicts. Evaluator identity and runtime diagnostics are not documented.", "required": ["object", "template_id", "agent_id", "saved", "calls_considered", "results"], "properties": {"object": {"const": "judge_quick_run"}, "template_id": {"type": "string"}, "agent_id": {"type": "string"}, "saved": {"const": false}, "calls_considered": {"type": "integer"}, "results": {"type": "array", "items": {"type": "object", "required": ["call_id", "recorded_at", "verdict", "score", "rationale"], "properties": {"call_id": {"type": "string"}, "recorded_at": {"type": ["string", "null"]}, "verdict": {"type": ["string", "null"]}, "score": {"type": ["number", "null"]}, "rationale": {"type": ["string", "null"]}}}}}}, "EvalRunAccepted": {"type": "object", "description": "Evaluation counts and optional recorded run id. Evaluator diagnostics are not documented.", "required": ["object", "agent_id", "client", "evaluated", "unknown", "skipped"], "properties": {"object": {"const": "eval_run"}, "agent_id": {"type": "string"}, "client": {"type": "string"}, "evaluated": {"type": "integer"}, "unknown": {"type": "integer"}, "skipped": {"type": "integer"}, "run_id": {"type": ["string", "null"], "description": "Null when no run was recorded; absent on an evaluator failure."}}}, "CompatInboundNumbers": {"type": "object", "description": "Bound numbers and supported public call settings. Unrecorded settings are nullable; unsupported legacy setup fields are not documented.", "required": ["inboundNumbers", "subscriptionStatus"], "properties": {"subscriptionStatus": {"type": "object", "maxProperties": 0}, "inboundNumbers": {"type": "array", "items": {"type": "object", "required": ["id", "agent_id", "phone_number", "created_at", "org_id", "user_id", "persona_id", "webhook", "webhook_events"], "properties": {"id": {"type": "string"}, "agent_id": {"type": "string"}, "phone_number": {"type": "string"}, "created_at": {"type": ["string", "null"]}, "org_id": {"type": "string"}, "user_id": {"type": "string"}, "persona_id": {"type": "string"}, "persona_version_id": {"type": ["string", "null"]}, "webhook": {"type": ["string", "null"]}, "webhook_events": {"type": ["array", "null"], "items": {"type": "string"}}, "prompt": {"type": ["string", "null"]}, "first_sentence": {"type": ["string", "null"]}, "voice": {"type": ["string", "null"]}, "language": {"type": ["string", "null"]}, "record": {"type": ["boolean", "null"]}, "max_duration": {"type": ["number", "null"]}, "custom_tools": {"type": ["string", "null"], "description": "JSON-encoded list of attached tool ids."}, "disposition_ids": {"type": ["array", "null"], "items": {"type": "string"}}, "citation_schema_id": {"type": ["string", "null"]}, "citation_schema_ids": {"type": ["array", "null"], "items": {"type": "string"}}}}}}}, "JudgeSuite": {"type": "object", "required": ["id", "object", "name", "agent_id", "template_ids", "workspace_id", "created_at", "created_by", "archived_at"], "properties": {"id": {"type": "string"}, "object": {"const": "judge_suite"}, "name": {"type": "string"}, "agent_id": {"type": "string"}, "template_ids": {"type": "array", "items": {"type": "string"}}, "workspace_id": {"type": ["string", "null"]}, "created_at": {"type": "string"}, "created_by": {"type": "string"}, "archived_at": {"type": "null"}}}, "EvalTestCase": {"type": "object", "required": ["call_id", "object", "agent_id", "kind", "recorded_at", "turns", "verdicts"], "properties": {"call_id": {"type": "string"}, "object": {"const": "judge_test_case"}, "agent_id": {"type": "string"}, "kind": {"type": "string"}, "recorded_at": {"type": ["string", "null"]}, "turns": {"type": "integer"}, "verdicts": {"type": "array", "items": {"type": "object", "required": ["judge_id", "judge_name", "verdict", "score", "rationale", "evaluated_at", "development_fixture"], "properties": {"judge_id": {"type": "string"}, "judge_name": {"type": ["string", "null"]}, "verdict": {"type": ["string", "null"]}, "score": {"type": ["number", "null"]}, "rationale": {"type": ["string", "null"]}, "evaluated_at": {"type": ["string", "null"]}, "development_fixture": {"type": "boolean"}}}}}}, "EvalTestCaseList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/EvalTestCase"}}}}, "TestbedSide": {"type": ["object", "null"], "required": ["said", "routed_to", "captured", "outcome", "failed_because", "error"], "properties": {"said": {"type": "string"}, "routed_to": {"type": ["string", "null"]}, "captured": {"type": "array", "items": {"type": "string"}}, "outcome": {"type": ["string", "null"]}, "failed_because": {"type": ["string", "null"]}, "error": {"type": ["string", "null"]}}}, "TestbedComparison": {"type": ["object", "null"], "required": ["original", "current", "candidate", "effect", "reply_changed", "route_changed", "current_keeps_original_route", "candidate_keeps_original_route"], "properties": {"original": {"$ref": "#/components/schemas/TestbedOriginal"}, "current": {"$ref": "#/components/schemas/TestbedSide"}, "candidate": {"$ref": "#/components/schemas/TestbedSide"}, "effect": {"enum": ["not_run", "error", "unjudged", "unchanged_pass", "improved", "regressed", "unchanged_fail"]}, "reply_changed": {"type": "boolean"}, "route_changed": {"type": "boolean"}, "current_keeps_original_route": {"type": ["boolean", "null"]}, "candidate_keeps_original_route": {"type": ["boolean", "null"]}}}, "TestbedOriginal": {"type": "object", "required": ["say", "routed_to", "captured"], "properties": {"say": {"type": "string"}, "routed_to": {"type": ["string", "null"]}, "captured": {"type": "array", "items": {"type": "string"}}}}, "TestbedRun": {"type": "object", "required": ["id", "object", "agent_id", "client", "by", "state", "step", "current_prompt", "candidate_prompt", "version_number", "started_at", "finished_at", "detail", "evidence_class", "situations", "summary", "proposal"], "properties": {"id": {"type": "string"}, "object": {"const": "testbed_run"}, "agent_id": {"type": "string"}, "client": {"type": "string"}, "by": {"type": "string"}, "state": {"enum": ["queued", "running", "completed", "failed", "interrupted"]}, "step": {"type": "string"}, "current_prompt": {"type": "string"}, "candidate_prompt": {"type": ["string", "null"]}, "version_number": {"type": ["integer", "null"]}, "started_at": {"type": "string"}, "finished_at": {"type": ["string", "null"]}, "detail": {"type": ["string", "null"]}, "evidence_class": {"const": "TESTBED"}, "situations": {"type": "array", "items": {"type": "object", "required": ["key", "conversation_id", "turn"], "properties": {"key": {"type": "string"}, "conversation_id": {"type": "string"}, "turn": {"type": "integer"}, "situation": {"$ref": "#/components/schemas/StandardSituation"}, "redacted": {"type": "boolean"}, "original": {"$ref": "#/components/schemas/TestbedOriginal"}, "result": {"$ref": "#/components/schemas/TestbedComparison"}, "scrubbed": {"type": "string", "description": "When call text expires, replaces situation, redacted, original and result."}}}}, "summary": {"type": ["object", "null"], "required": ["situations", "effects", "reply_changed", "route_changed", "candidate_keeps_original_route", "current_keeps_original_route"], "properties": {"situations": {"type": "integer"}, "effects": {"type": "object", "additionalProperties": {"type": "integer"}}, "reply_changed": {"type": "integer"}, "route_changed": {"type": "integer"}, "candidate_keeps_original_route": {"type": "integer"}, "current_keeps_original_route": {"type": "integer"}}}, "proposal": {"type": ["object", "null"], "required": ["applied", "step", "before", "after", "diff", "change_request", "note"], "properties": {"applied": {"const": false}, "step": {"type": "string"}, "before": {"type": "string"}, "after": {"type": "string"}, "diff": {"type": "string"}, "note": {"type": "string"}, "change_request": {"type": ["object", "null"], "required": ["intent", "proposed_patch"], "properties": {"intent": {"const": "update_prompt_wording"}, "proposed_patch": {"type": "object", "required": ["spec", "path", "value"], "properties": {"spec": {"const": "agent.yaml"}, "path": {"type": "array", "items": {"type": "string"}}, "value": {"type": "string"}}}}}}}}}, "StandardSituation": {"type": "object", "required": ["script"], "properties": {"script": {"type": "array", "items": {"type": "string"}}, "caller_phone": {"type": "string"}, "seed": {"type": "object", "required": ["history", "collected"], "properties": {"history": {"type": "array", "items": {"type": "object", "required": ["caller", "say"], "properties": {"caller": {"type": "string"}, "say": {"type": "string"}}}}, "collected": {"type": "object", "additionalProperties": {"type": "string"}}}}}}, "StandardExpectation": {"type": "object", "required": ["name", "step", "kind", "intent", "pattern", "threshold"], "properties": {"name": {"type": "string"}, "step": {"type": "string"}, "kind": {"type": "string"}, "intent": {"type": "string"}, "pattern": {"type": "string"}, "threshold": {"type": "number"}, "target": {"type": "string"}}}, "Standard": {"type": "object", "required": ["id", "object", "name", "step", "situation", "expectations", "repeats", "enabled", "created_at", "updated_at", "created_by", "revision"], "properties": {"id": {"type": "string"}, "object": {"const": "standard"}, "name": {"type": "string"}, "step": {"type": "string"}, "situation": {"$ref": "#/components/schemas/StandardSituation"}, "expectations": {"type": "array", "items": {"$ref": "#/components/schemas/StandardExpectation"}}, "repeats": {"type": "integer"}, "enabled": {"type": "boolean"}, "revision": {"type": "string"}, "created_at": {"type": "string"}, "updated_at": {"type": "string"}, "created_by": {"type": "string"}}}, "StandardResult": {"type": "object", "required": ["standard_id", "name", "step", "revision", "verdict", "passed", "attempts", "expectations", "observed"], "properties": {"standard_id": {"type": "string"}, "name": {"type": "string"}, "step": {"type": "string"}, "revision": {"type": "string"}, "verdict": {"enum": ["passed", "failed", "unknown", "error", "incomplete"]}, "passed": {"type": "boolean"}, "attempts": {"type": "integer"}, "expectations": {"type": "array", "items": {"type": "object", "required": ["name", "kind", "verdict", "rate", "threshold", "why"], "properties": {"name": {"type": "string"}, "kind": {"type": "string"}, "verdict": {"type": "string"}, "rate": {"type": ["number", "null"]}, "threshold": {"type": "number"}, "why": {"type": ["string", "null"]}}}}, "observed": {"type": "object", "required": ["reached", "steps", "said_at_step", "went_on_to", "captured_at_step", "outcome", "failed_because"], "properties": {"reached": {"type": "boolean"}, "steps": {"type": "array", "items": {"type": "string"}}, "said_at_step": {"type": "array", "items": {"type": "string"}}, "went_on_to": {"type": "array", "items": {"type": "string"}}, "captured_at_step": {"type": "array", "items": {"type": "string"}}, "outcome": {"type": ["string", "null"]}, "failed_because": {"type": ["string", "null"]}}}}}, "StandardWithResult": {"allOf": [{"$ref": "#/components/schemas/Standard"}], "required": ["last_result"], "properties": {"last_result": {"anyOf": [{"type": "null"}, {"allOf": [{"$ref": "#/components/schemas/StandardResult"}], "required": ["run_id", "at", "current"], "properties": {"run_id": {"type": ["string", "null"]}, "at": {"type": ["string", "null"]}, "current": {"type": "boolean"}}}]}}}, "StandardList": {"type": "object", "required": ["object", "agent_id", "version_number", "data", "blocks_promotion", "gate"], "properties": {"object": {"const": "list"}, "agent_id": {"type": "string"}, "version_number": {"type": ["integer", "null"]}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/StandardWithResult"}}, "blocks_promotion": {"type": "boolean"}, "gate": {"type": ["string", "null"]}}}, "StandardDeleted": {"type": "object", "required": ["object", "id", "deleted"], "properties": {"object": {"const": "standard"}, "id": {"type": "string"}, "deleted": {"const": true}}}, "StandardsRun": {"type": "object", "required": ["run_id", "set_id", "state", "started_at", "finished_at", "by", "agent_version_id", "version_number", "detail", "requested", "results", "passed"], "properties": {"run_id": {"type": "string"}, "set_id": {"type": "string"}, "state": {"type": "string"}, "started_at": {"type": "string"}, "finished_at": {"type": ["string", "null"]}, "by": {"type": "string"}, "agent_version_id": {"type": ["string", "null"]}, "version_number": {"type": ["integer", "null"]}, "detail": {"type": ["string", "null"]}, "requested": {"type": "array", "items": {"type": "string"}}, "results": {"type": "array", "items": {"$ref": "#/components/schemas/StandardResult"}}, "passed": {"type": "boolean"}}}, "StandardsRunList": {"type": "object", "required": ["object", "agent_id", "data"], "properties": {"object": {"const": "list"}, "agent_id": {"type": "string"}, "data": {"type": "array", "items": {"$ref": "#/components/schemas/StandardsRun"}}}}, "StandardsRunAccepted": {"type": "object", "required": ["id", "client", "state", "keys", "repeats", "version_number", "started_at", "source", "finished_at", "by", "origin", "progress", "detail", "timeout_s", "judge", "pass_rate", "flaky", "passed", "failed", "unknown", "errored", "step_assertions", "object", "agent_id"], "properties": {"id": {"type": "string"}, "client": {"type": "string"}, "state": {"const": "queued"}, "keys": {"type": "array", "items": {"type": "string"}}, "repeats": {"type": "integer"}, "version_number": {"type": ["integer", "null"]}, "started_at": {"type": "string"}, "source": {"const": "standards"}, "finished_at": {"type": "null"}, "by": {"type": "string"}, "origin": {"type": ["string", "null"]}, "progress": {"type": "object", "required": ["done", "total"], "properties": {"done": {"type": "integer"}, "total": {"type": "integer"}}}, "detail": {"type": "null"}, "timeout_s": {"type": "integer"}, "judge": {"type": "null"}, "pass_rate": {"type": ["number", "null"]}, "flaky": {"type": "array", "items": {"type": "string"}}, "passed": {"type": "integer"}, "failed": {"type": "integer"}, "unknown": {"type": "integer"}, "errored": {"type": "integer"}, "step_assertions": {"type": "integer"}, "object": {"const": "standards_run"}, "agent_id": {"type": "string"}}}, "TestAnalyticsNode": {"type": "object", "required": ["node", "visits", "failures", "by_source", "rate", "sufficient"], "properties": {"node": {"type": "string"}, "visits": {"type": "integer"}, "failures": {"type": "integer"}, "by_source": {"type": "object", "additionalProperties": {"type": "object", "required": ["visits", "failures"], "properties": {"visits": {"type": "integer"}, "failures": {"type": "integer"}}}}, "rate": {"type": ["number", "null"]}, "sufficient": {"type": "boolean"}}}, "TestAnalytics": {"type": "object", "required": ["window", "min_samples", "nodes", "weakest", "attempts", "sets", "excluded_unreadable", "excluded_unattributed_attempts", "sources", "object", "agent_id"], "properties": {"window": {"type": "object", "required": ["since", "until", "days"], "properties": {"since": {"type": "string"}, "until": {"type": "string"}, "days": {"type": "integer"}}}, "min_samples": {"type": "integer"}, "nodes": {"type": "array", "items": {"$ref": "#/components/schemas/TestAnalyticsNode"}}, "weakest": {"anyOf": [{"type": "null"}, {"$ref": "#/components/schemas/TestAnalyticsNode"}]}, "attempts": {"type": "integer"}, "sets": {"type": "integer"}, "excluded_unreadable": {"type": "integer"}, "excluded_unattributed_attempts": {"type": "integer"}, "sources": {"type": "object", "required": ["counted", "not_counted"], "properties": {"counted": {"type": "object", "additionalProperties": {"type": "object", "required": ["sets", "attempts"], "properties": {"sets": {"type": "integer"}, "attempts": {"type": "integer"}}}}, "not_counted": {"type": "array", "items": {"type": "string"}}}}, "object": {"const": "test_analytics"}, "agent_id": {"type": "string"}}}, "TestbedSituation": {"type": "object", "required": ["step", "turn", "situation", "redacted", "original", "conversation_id", "current_prompt", "editable", "object", "agent_id"], "properties": {"step": {"type": "string"}, "turn": {"type": "integer"}, "situation": {"$ref": "#/components/schemas/StandardSituation"}, "redacted": {"type": "boolean"}, "original": {"type": "object", "required": ["say", "routed_to", "captured"], "properties": {"say": {"type": "string"}, "routed_to": {"type": ["string", "null"]}, "captured": {"type": "array", "items": {"type": "string"}}}}, "conversation_id": {"type": "string"}, "current_prompt": {"type": "string"}, "editable": {"type": "boolean"}, "object": {"const": "testbed_situation"}, "agent_id": {"type": "string"}}}, "WidgetCustomComponent": {"type": "object", "required": ["id", "org_id", "widget_id", "pathway_id", "pathway_node", "width", "height", "variables", "iframe_url", "created_at", "updated_at"], "properties": {"id": {"type": "string"}, "org_id": {"type": "string"}, "widget_id": {"type": "string"}, "pathway_id": {"type": "string"}, "pathway_node": {"type": "string"}, "width": {"type": "string"}, "height": {"type": "string"}, "variables": {"type": "array", "items": {"type": "string"}}, "iframe_url": {"type": "string"}, "created_at": {"type": ["string", "null"]}, "updated_at": {"type": ["string", "null"]}}}, "WidgetCustomComponentEnvelope": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"$ref": "#/components/schemas/WidgetCustomComponent"}, "errors": {"type": "null"}}}, "WidgetCustomComponentList": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/WidgetCustomComponent"}}, "errors": {"type": "null"}}}, "ToolExecutionList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "required": ["note"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/ToolExecution"}}, "note": {"const": "recent test-mode executions on this origin"}}}, "CompatSession": {"type": "object", "required": ["session", "user"], "properties": {"session": {"type": ["object", "null"], "required": ["id", "userId", "createdAt", "expiresAt"], "properties": {"id": {"type": "string"}, "userId": {"type": "string"}, "createdAt": {"type": ["string", "null"]}, "expiresAt": {"type": ["string", "null"]}}}, "user": {"type": "object", "required": ["id", "email", "emailVerified", "phoneNumber", "phoneNumberVerified", "name", "first_name", "last_name", "image", "role", "banned", "is_banned", "marketing_consent", "createdAt", "updatedAt"], "properties": {"id": {"type": "string"}, "email": {"type": ["string", "null"]}, "emailVerified": {"type": "boolean"}, "phoneNumber": {"type": ["string", "null"]}, "phoneNumberVerified": {"type": "boolean"}, "name": {"type": ["string", "null"]}, "first_name": {"type": ["string", "null"]}, "last_name": {"type": ["string", "null"]}, "image": {"type": "null"}, "role": {"type": "string"}, "banned": {"type": "boolean"}, "is_banned": {"type": "boolean"}, "marketing_consent": {"type": "array", "items": {"enum": ["email", "sms"]}}, "createdAt": {"type": ["string", "null"]}, "updatedAt": {"type": ["string", "null"]}}}}}, "CompatMissingUser": {"type": "object", "required": ["error", "message"], "properties": {"error": {"const": "not_found"}, "message": {"const": "User could not be found."}}}, "CompatCurrentWebhook": {"type": "object", "required": ["webhook_url"], "properties": {"webhook_url": {"type": ["string", "null"]}}}, "CompatPathways": {"type": "array", "maxItems": 0, "items": false, "description": "This compatibility facade always returns an empty array."}, "ApiRoot": {"type": "object", "required": ["object", "name", "version", "status", "documentation", "openapi", "llms_txt", "docs", "health"], "properties": {"object": {"const": "api"}, "name": {"type": "string"}, "version": {"type": "string"}, "status": {"const": "ok"}, "documentation": {"type": "string", "format": "uri"}, "openapi": {"type": "string", "format": "uri"}, "llms_txt": {"type": "string", "format": "uri"}, "docs": {"type": "array", "items": {"type": "string", "format": "uri"}}, "health": {"type": "string", "format": "uri"}}}, "Health": {"type": "object", "required": ["ok", "object", "api", "build", "build_sha", "environment", "status", "ready", "schema", "scheduler"], "properties": {"ok": {"const": true}, "object": {"const": "health"}, "api": {"type": "string"}, "build": {"type": ["string", "null"]}, "build_sha": {"type": ["string", "null"]}, "environment": {"type": ["string", "null"]}, "status": {"enum": ["unknown", "ready", "not_ready"]}, "ready": {"type": ["boolean", "null"]}, "schema": {"type": ["object", "null"], "properties": {"applied_max": {"type": "integer"}, "required_max": {"type": "integer"}, "required_pending": {"type": "array", "items": {"type": "string"}}, "optional_pending": {"type": "array", "items": {"type": "string"}}, "drift": {"type": "boolean"}, "applied_count": {"type": "integer"}, "applied_digest": {"type": "string"}}}, "scheduler": {"type": "object", "required": ["state"], "properties": {"state": {"type": "string"}}}, "publication": {"type": "object", "description": "Present on the native runtime only.", "properties": {"durable_producer": {"type": "boolean"}, "consumer_ready": {"type": "boolean"}, "notification_state": {"const": "pending"}, "delivery_proved": {"const": false}}}}}, "WorkspaceSecret": {"type": "object", "required": ["id", "object", "name", "key", "type", "status", "reference", "id_reference", "has_value", "archived", "created_by", "updated_by", "created_at", "updated_at", "refresh"], "properties": {"id": {"type": "string"}, "object": {"const": "secret"}, "name": {"type": "string"}, "key": {"type": "string"}, "type": {"enum": ["Static", "Refresh"]}, "status": {"enum": ["Active", "Paused"]}, "reference": {"type": "string"}, "id_reference": {"type": "string"}, "has_value": {"type": "boolean"}, "archived": {"type": "boolean"}, "created_by": {"type": ["string", "null"]}, "updated_by": {"type": ["string", "null"]}, "created_at": {"type": ["string", "null"]}, "updated_at": {"type": ["string", "null"]}, "refresh": {"type": ["object", "null"], "description": "Refresh configuration without credentials or request body.", "properties": {"url": {"type": ["string", "null"]}, "method": {"type": ["string", "null"]}, "header_names": {"type": "array", "items": {"type": "string"}}, "interval_minutes": {"type": ["integer", "null"]}, "json_path": {"type": ["string", "null"]}, "last_refreshed_at": {"type": ["string", "null"]}, "last_attempt_at": {"type": ["string", "null"]}, "last_error": {"type": ["string", "null"]}}}}}, "WorkspaceSecretDeleted": {"allOf": [{"$ref": "#/components/schemas/WorkspaceSecret"}], "required": ["deleted"], "properties": {"deleted": {"const": true}}}, "SigningKey": {"type": "object", "required": ["id", "object", "kid", "algorithm", "status", "public_key_pem", "created_at", "retired_at", "revoked_at"], "properties": {"id": {"type": "string"}, "object": {"const": "signing_key"}, "kid": {"type": "string"}, "algorithm": {"const": "RS256"}, "status": {"enum": ["active", "previous", "revoked"]}, "public_key_pem": {"type": "string"}, "created_at": {"type": ["string", "null"]}, "retired_at": {"type": ["string", "null"]}, "revoked_at": {"type": ["string", "null"]}}}, "PublishedSigningKey": {"allOf": [{"$ref": "#/components/schemas/SigningKey"}], "required": ["published"], "properties": {"published": {"type": "boolean"}}}, "RequestSigning": {"type": "object", "required": ["object", "workspace_id", "algorithm", "settings", "keys", "issuer", "jwks_url", "jwks_path", "key_storage_configured", "signed_requests"], "properties": {"object": {"const": "request_signing"}, "workspace_id": {"type": "string"}, "algorithm": {"const": "RS256"}, "settings": {"type": "object", "required": ["enabled", "header_name", "header_prefix", "audience", "include_protocol", "ttl_seconds", "custom_claims"], "properties": {"enabled": {"type": "boolean"}, "header_name": {"type": "string"}, "header_prefix": {"type": "string"}, "audience": {"type": "string"}, "include_protocol": {"type": "boolean"}, "ttl_seconds": {"type": "integer"}, "custom_claims": {"type": "object", "additionalProperties": {"type": "string"}}}}, "keys": {"type": "array", "items": {"$ref": "#/components/schemas/PublishedSigningKey"}}, "issuer": {"type": "string"}, "jwks_url": {"type": "string", "format": "uri"}, "jwks_path": {"type": "string"}, "key_storage_configured": {"type": "boolean"}, "signed_requests": {"type": "array", "items": {"enum": ["tool_calls", "webhooks"]}}}}, "SigningKeyGenerated": {"allOf": [{"$ref": "#/components/schemas/RequestSigning"}], "required": ["generated"], "properties": {"generated": {"$ref": "#/components/schemas/SigningKey"}}}, "SigningKeysRevoked": {"allOf": [{"$ref": "#/components/schemas/RequestSigning"}], "required": ["revoked"], "properties": {"revoked": {"type": "integer"}}}, "WorkspaceJwks": {"type": "object", "required": ["keys"], "properties": {"keys": {"type": "array", "items": {"type": "object", "required": ["kty", "use", "alg", "kid", "n", "e"], "properties": {"kty": {"const": "RSA"}, "use": {"const": "sig"}, "alg": {"const": "RS256"}, "kid": {"type": "string"}, "n": {"type": "string"}, "e": {"type": "string"}}}}}}, "ReleaseDeployment": {"type": "object", "required": ["id", "object", "agent_id", "agent_name", "workspace_id", "version_id", "version_number", "environment", "action", "status", "by", "at"], "properties": {"id": {"type": ["string", "null"]}, "object": {"const": "release_deployment"}, "agent_id": {"type": "string"}, "agent_name": {"type": "string"}, "workspace_id": {"type": "string"}, "version_id": {"type": ["string", "null"]}, "version_number": {"type": ["integer", "null"]}, "environment": {"type": "string"}, "action": {"type": "string"}, "status": {"type": "string"}, "by": {"type": ["string", "null"]}, "at": {"type": ["string", "null"]}}}, "McpClientSetup": {"type": "object", "required": ["client", "label", "url", "header", "file", "snippet"], "properties": {"client": {"type": "string"}, "label": {"type": "string"}, "url": {"type": "string", "format": "uri"}, "header": {"type": "string"}, "file": {"type": "string"}, "snippet": {"type": "string"}}}, "McpConnection": {"type": "object", "required": ["id", "object", "name", "kind", "role", "scopes", "key_prefix", "workspace_id", "created_by", "status", "created_at", "expires_at", "revoked_at", "last_used_at", "client", "label", "access", "call_records", "phone"], "properties": {"id": {"type": "string"}, "object": {"const": "mcp_connection"}, "name": {"type": "string"}, "kind": {"type": "string"}, "role": {"type": "string"}, "scopes": {"type": "array", "items": {"type": "string"}}, "key_prefix": {"type": "string"}, "workspace_id": {"type": "string"}, "created_by": {"type": ["string", "null"], "description": "The user who minted the connection's key, or null."}, "status": {"enum": ["active", "revoked", "expired"]}, "created_at": {"type": ["string", "null"]}, "expires_at": {"type": ["string", "null"]}, "revoked_at": {"type": ["string", "null"]}, "last_used_at": {"type": ["string", "null"]}, "client": {"type": "string"}, "label": {"type": "string"}, "access": {"enum": ["read", "draft", "test", "build", "write"]}, "call_records": {"type": "boolean"}, "phone": {"type": "boolean", "description": "Holds the phone plan's scopes."}}}, "McpConnectionCreated": {"allOf": [{"$ref": "#/components/schemas/McpConnection"}], "required": ["secret", "setup", "note"], "properties": {"secret": {"type": "string", "description": "Shown once, only on creation."}, "setup": {"$ref": "#/components/schemas/McpClientSetup"}, "note": {"type": "string"}}}, "ClientGrant": {"type": "object", "required": ["id", "object", "kind", "client", "label", "verified", "redirect_host", "scopes", "status", "workspace_id", "created_at", "expires_at", "last_used_at", "revoked_at"], "properties": {"id": {"type": "string"}, "object": {"const": "client_grant"}, "kind": {"enum": ["oauth", "bearer", "rest"]}, "client": {"type": "string"}, "label": {"type": "string"}, "verified": {"type": "boolean"}, "redirect_host": {"type": ["string", "null"]}, "scopes": {"type": "array", "items": {"type": "string"}}, "status": {"enum": ["active", "revoked", "expired"]}, "workspace_id": {"type": "string"}, "created_at": {"type": ["string", "null"]}, "expires_at": {"type": ["string", "null"]}, "last_used_at": {"type": ["string", "null"]}, "revoked_at": {"type": ["string", "null"]}}}, "ClientGrantCreated": {"allOf": [{"$ref": "#/components/schemas/ClientGrant"}], "required": ["secret", "note"], "properties": {"secret": {"type": "string", "description": "Shown once, only on creation."}, "note": {"type": "string"}}}, "TtsCapabilities": {"type": "object", "required": ["encodings", "sample_rates", "containers", "controls"], "properties": {"encodings": {"type": "array", "items": {"type": "string"}}, "sample_rates": {"type": "array", "items": {"type": "integer"}}, "containers": {"type": "array", "items": {"type": "string"}}, "controls": {"type": "object", "maxProperties": 0}}}, "TtsModel": {"allOf": [{"$ref": "#/components/schemas/TtsCapabilities"}], "required": ["id"], "properties": {"id": {"type": "string"}}}, "TtsModelList": {"type": "object", "required": ["models"], "properties": {"models": {"type": "array", "items": {"$ref": "#/components/schemas/TtsModel"}}}}, "ModelDiscovery": {"type": "object", "required": ["object", "data"], "properties": {"object": {"const": "list"}, "data": {"type": "array", "items": {"type": "object", "required": ["id", "object", "created", "owned_by", "name", "modality", "capabilities"], "properties": {"id": {"type": "string"}, "object": {"const": "model"}, "created": {"const": 0}, "owned_by": {"const": "sempera"}, "name": {"type": "string"}, "modality": {"const": "text-to-speech"}, "capabilities": {"$ref": "#/components/schemas/TtsCapabilities"}}}}}}, "ModelListV1": {"type": "object", "required": ["status", "models"], "properties": {"status": {"const": "success"}, "models": {"type": "array", "items": {"type": "object", "required": ["model_id", "display_name", "description", "sample_rates", "can_clone", "languages", "is_recommended"], "properties": {"model_id": {"type": "string"}, "display_name": {"type": "string"}, "description": {"type": "string"}, "sample_rates": {"type": "array", "items": {"type": "integer"}}, "can_clone": {"type": "boolean"}, "languages": {"type": "array", "items": {"type": "string"}}, "is_recommended": {"type": "boolean"}}}}}}, "WebhookEndpointDeleted": {"allOf": [{"$ref": "#/components/schemas/WebhookEndpoint"}], "required": ["deleted"], "properties": {"deleted": {"const": true}}}, "WebhookDelivery": {"type": "object", "required": ["id", "object", "event_id", "event_type", "attempt", "status", "response_code", "error", "sent_at", "created_at"], "properties": {"id": {"type": "string"}, "object": {"const": "webhook_delivery"}, "event_id": {"type": "string"}, "event_type": {"type": "string"}, "attempt": {"type": "integer"}, "status": {"type": "string"}, "response_code": {"type": ["integer", "null"]}, "error": {"type": ["string", "null"]}, "sent_at": {"type": ["string", "null"]}, "created_at": {"type": ["string", "null"]}}}, "WebhookTest": {"type": "object", "required": ["object", "endpoint_id", "event_id", "status", "attempts", "response_code", "error"], "properties": {"object": {"const": "webhook_test"}, "endpoint_id": {"type": "string"}, "event_id": {"type": "string"}, "status": {"enum": ["delivered", "failed"]}, "attempts": {"type": "integer"}, "response_code": {"type": ["integer", "null"]}, "error": {"type": "string"}}}, "McpRpc": {"type": "object", "additionalProperties": true, "description": "JSON-RPC 2.0 MCP envelope (initialize, tools/list, tools/call)."}, "Error": {"type": "object", "required": ["error"], "properties": {"error": {"type": "object", "required": ["code", "message", "request_id"], "properties": {"code": {"type": "string", "enum": ["AGENT_ENV_UNPINNED", "CALL_RL_PLAN_ALLOWANCE", "CALL_RL_PLAN_CONCURRENCY", "CALL_RL_PLAN_DAILY", "CALL_RL_PLAN_DAILY_MINUTES", "CALL_RL_PLAN_HOURLY", "PHONE_AGENT_UNPINNED", "PHONE_APPROVAL_EXPIRED", "PHONE_APPROVAL_INVALID", "PHONE_APPROVAL_REQUIRED", "PHONE_COST_UNKNOWN", "PHONE_DESTINATION_BLOCKED", "PHONE_FUNDING_NOT_LIVE", "PHONE_NUMBER_MISSING", "PHONE_OUTSIDE_HOURS", "PHONE_PLAN_INACTIVE", "PHONE_RECIPIENT_OPTED_OUT", "SMS_RL_PLAN_ALLOWANCE", "SMS_RL_PLAN_DAILY", "SMS_RL_PLAN_HOURLY", "authentication_required", "capability_unavailable", "conflict", "credits_exhausted", "credits_unavailable", "csrf_failed", "forbidden", "gone", "idempotency_key_reused", "insufficient_scope", "internal_error", "invalid_credential", "method_not_allowed", "not_found", "owner_setup_required", "payload_too_large", "provider_failed", "provider_timeout", "rate_limited", "service_unavailable", "validation_failed", "workspace_suspended"]}, "message": {"type": "string"}, "request_id": {"type": "string"}, "field": {"type": "string"}, "scope": {"type": "string"}, "reason": {"type": "string"}}, "additionalProperties": true}}}, "ListEnvelope": {"type": "object", "required": ["object", "data", "has_more"], "properties": {"object": {"type": "string", "const": "list"}, "data": {"type": "array", "items": {}}, "has_more": {"type": "boolean"}, "next_cursor": {"type": ["string", "null"]}}}, "CompatEnvelope": {"type": "object", "required": ["data", "errors"], "properties": {"data": {}, "errors": {}}, "additionalProperties": true}, "Agent": {"type": "object", "required": ["id", "object", "status"], "properties": {"id": {"type": "string", "description": "Stable Sempera id (never a provider id)."}, "object": {"const": "agent"}, "name": {"type": ["string", "null"]}, "business_name": {"type": ["string", "null"]}, "persona": {"type": ["string", "null"]}, "workspace_id": {"type": ["string", "null"]}, "status": {"type": "string", "enum": ["draft", "published", "archived", "needs_repair"]}, "lifecycle": {"type": ["string", "null"]}, "stage": {"type": ["string", "null"]}, "published_version_id": {"type": ["string", "null"]}, "published_version_number": {"type": ["integer", "null"]}, "published_at": {"type": ["string", "null"], "format": "date-time"}, "gates": {"type": "object"}, "channels": {"type": "object"}, "readiness": {"type": "object"}, "draft": {"type": "object"}, "published": {"type": "object"}, "voice": {}, "language": {}, "instructions": {}, "fields": {}, "tools": {}, "knowledge": {}}, "additionalProperties": true}, "MemorySchema": {"type": "object", "required": ["object", "enabled", "entity_schemas"], "properties": {"object": {"const": "memory_schema"}, "enabled": {"type": "boolean"}, "source": {"type": ["string", "null"]}, "entity_schemas": {"type": "array", "items": {"type": "object"}}}, "additionalProperties": true}, "CitationSchemaList": {"$ref": "#/components/schemas/ListEnvelope"}, "CitationSchemaBackfill": {"type": "object", "properties": {"agent_id": {"type": "string"}, "client": {"type": "string"}}}, "CitationSchemaBackfillResult": {"type": "object", "required": ["object"], "properties": {"object": {"const": "citation_schema_backfill"}, "agent_id": {"type": "string"}, "schemas": {"type": "integer"}, "quality": {"type": "array"}}}, "LiveCallStream": {"type": "object", "additionalProperties": true}, "LiveTranscriptStream": {"type": "object", "additionalProperties": true}, "RecordingDownload": {"type": "object", "required": ["object", "id", "url"], "properties": {"object": {"const": "recording"}, "id": {"type": "string"}, "url": {"type": "string"}, "download": {"type": "boolean"}, "expires_at": {"type": "string"}}}, "AgentCreate": {"type": "object", "required": ["name"], "properties": {"name": {"type": "string", "maxLength": 200, "description": "The business name."}, "template": {"type": "string", "description": "A starter template slug; omit for a blank agent."}, "answers": {"type": "object", "description": "Onboarding answers (the App wizard's shape)."}, "provenance": {"type": "array", "items": {"type": "object"}}}}, "AgentDelete": {"type": "object", "required": ["confirm"], "properties": {"confirm": {"type": "string", "description": "Must equal the agent id."}}}, "AgentDraft": {"type": "object", "properties": {"object": {"const": "agent_draft"}, "agent_id": {"type": "string"}, "revision": {"type": ["string", "null"]}, "updated_at": {"type": ["string", "null"]}, "by": {"type": ["string", "null"]}, "fields": {"type": "object"}, "warnings": {"type": "array", "description": "Advice about the draft's values as they stand, each naming its field (`field`, `label`, `code`, `message`). Never a refusal: the save and Publish go ahead. Today: an opening line that already says what Sempera adds after it (the AI disclosure, or the recording notice when calls are recorded), so callers would hear it twice.", "items": {"type": "object", "properties": {"field": {"type": "string"}, "label": {"type": "string"}, "code": {"type": "string"}, "message": {"type": "string"}}}}, "summary": {}, "editable_fields": {}, "result": {}}, "additionalProperties": true}, "AgentDraftPatch": {"type": "object", "required": ["fields"], "properties": {"fields": {"type": "object", "description": "Field key -> new value. Keys are the editor's field keys (`editable_fields`)."}, "expect_revision": {"type": "string", "description": "Refuse the save if the draft moved on."}}}, "AgentPreview": {"type": "object", "required": ["message"], "properties": {"message": {"type": "string", "maxLength": 4000}, "session_id": {"type": "string"}, "version": {"type": "string", "enum": ["draft", "published"], "default": "draft"}}}, "AgentPublish": {"type": "object", "properties": {"reason": {"type": "string"}, "decided_by": {"type": "string"}}}, "AgentRollback": {"type": "object", "required": ["to_deployment_id"], "properties": {"to_deployment_id": {"type": "string"}, "confirm": {"type": "string"}}}, "AgentVersion": {"type": "object", "required": ["id", "object", "agent_id"], "properties": {"id": {"type": "string"}, "object": {"const": "agent_version"}, "agent_id": {"type": "string"}, "version_number": {"type": ["integer", "null"]}, "created_at": {"type": ["string", "null"]}, "spec_hash": {"type": ["string", "null"]}, "compiled_artifact_id": {"type": ["string", "null"]}}}, "Session": {"type": "object", "required": ["id", "object", "agent_id", "channel"], "properties": {"id": {"type": "string"}, "object": {"const": "session"}, "agent_id": {"type": "string"}, "channel": {"type": "string", "enum": ["web_voice", "web_chat", "simulator", "phone", "test", "unknown"]}, "status": {"type": "string"}, "started_at": {}, "ended_at": {}, "duration_s": {}, "outcome": {}, "language": {}, "agent_version_id": {}, "caller": {}, "summary": {}, "turns": {"type": ["array", "null"]}, "recording": {}, "provider": {}, "call_id": {}, "runtime_identity": {"$ref": "#/components/schemas/RuntimeIdentity"}}, "additionalProperties": true}, "SessionCreate": {"type": "object", "required": ["agent_id"], "properties": {"agent_id": {"type": "string"}, "channel": {"type": "string", "enum": ["web_voice", "simulator"], "default": "web_voice"}, "end_user_id": {"type": "string", "description": "Your identifier for the person; becomes the room participant identity."}, "language": {"type": "string", "enum": ["en", "fr", "es"]}, "voice_id": {"type": "string"}, "synthetic_caller": {"type": "string", "description": "simulator only: ten digits."}}}, "SessionToken": {"type": "object", "required": ["id", "object", "transport", "url", "token", "expires_at"], "properties": {"id": {"type": "string"}, "object": {"const": "session"}, "agent_id": {"type": "string"}, "channel": {"type": "string"}, "status": {"const": "ready"}, "transport": {"type": "string", "description": "Names the realtime media transport that `url` and `token` are for. Treat it as an opaque label: connect with the web client the guide describes (/docs/web-sdk.md), not with a Sempera protocol."}, "url": {"type": "string", "description": "The realtime signaling URL (WebSocket)."}, "token": {"type": "string", "description": "Short-lived, single-room token for the browser. Never an API key."}, "expires_at": {"type": "string", "format": "date-time"}, "voice": {}, "speech_recognition": {}, "voice_source": {}, "note": {}}}, "CallCreate": {"type": "object", "additionalProperties": false, "required": ["agent_id", "consent_basis"], "oneOf": [{"required": ["to"]}, {"required": ["phone_number"]}], "properties": {"agent_id": {"type": "string", "description": "The line this call goes out on: its number, consent, do-not-contact list, calling hours, caps and billing. With mode prompt it is not the conversation."}, "mode": {"type": "string", "enum": ["agent", "prompt"], "default": "agent", "description": "agent (default): the published agent runs, and task supplements its rules. prompt: the conversation is only the prompt (task or settings.prompt), which is required. The named agent_id remains the line. agent_version, production and environment are refused. prompt_only is not a field; sending it is refused and skips nothing."}, "to": {"type": "string", "description": "Destination phone number, E.164 or national digits."}, "phone_number": {"type": "string", "description": "Alias for to. Send only one name for an option."}, "from": {"type": "string", "description": "Optional owned caller id."}, "from_number": {"type": "string", "description": "Alias for from."}, "dialing_pool_id": {"type": "string", "format": "uuid", "description": "Owned number pool for local caller ID. Mutually exclusive with from. Requires workspace entitlement and verified, unexpired A attestation evidence. Exhausted pools refuse without a default-line fallback."}, "name": {"type": "string", "maxLength": 80}, "agent_version": {"type": ["string", "integer"], "description": "Installed published agent version id or number. A different version is refused, never substituted. Refused when mode is prompt."}, "agent_version_id": {"type": ["string", "integer"], "description": "Alias for agent_version. Refused when mode is prompt."}, "production": {"type": "boolean", "description": "Resolve the version pinned to the production environment. Refused with AGENT_ENV_UNPINNED when none is pinned. Refused when mode is prompt."}, "use_production": {"type": "boolean", "description": "Alias for production. Refused when mode is prompt."}, "environment": {"type": "string", "enum": ["production"], "description": "Environment to resolve; production only. Refused when mode is prompt."}, "message": {"type": "string", "description": "Opening message after the required automated-call disclosure."}, "opening": {"type": "string", "description": "Alias for message."}, "first_sentence": {"type": "string", "description": "Alias for message; the automated-call disclosure is always retained."}, "consent_basis": {"type": "string", "description": "Sentence recording why this person opted in."}, "metadata": {"type": "object", "additionalProperties": {"type": "string"}, "description": "Existing opening-template context, not a per-call webhook payload."}, "timezone": {"type": "string", "default": "America/Toronto"}, "window": {"type": "string", "default": "09:00-18:00", "description": "Recipient calling hours, HH:MM-HH:MM."}, "precall_dtmf": {"type": "string", "description": "Keys pressed after connection, before the employee speaks."}, "precall_dtmf_sequence": {"type": "string", "description": "Alias for precall_dtmf."}, "voicemail": {"type": "object", "description": "Alias for settings.voicemail; unsupported actions are refused."}, "webhook": {"type": "string", "format": "uri", "description": "URL of an enabled signed endpoint already registered in this workspace."}, "webhook_events": {"type": "array", "items": {"const": "call.completed"}, "minItems": 1, "maxItems": 1}, "voice": {"type": "string", "description": "Alias for settings.voice_id."}, "language": {"type": "string", "description": "Alias for settings.language."}, "task": {"type": "string", "maxLength": 2000, "description": "Alias for settings.prompt. With mode prompt this is the whole conversation and is required. Otherwise it supplements the agent's published rules."}, "request_data": {"type": "object", "minProperties": 1, "maxProperties": 20, "propertyNames": {"pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,39}$"}, "additionalProperties": {"type": "string", "maxLength": 200}, "description": "Alias for settings.call_data. Named facts available throughout this call, separate from opening-template metadata."}, "max_duration": {"type": "integer", "minimum": 2, "maximum": 60, "description": "Alias for settings.max_call_minutes; platform safety ceilings still apply."}, "keywords": {"type": "array", "minItems": 1, "items": {"type": "string"}}, "background_track": {"type": "string", "enum": ["none", "off", "office", "coffee_shop", "restaurant"]}, "block_interruptions": {"type": "boolean", "description": "True blocks interruptions; false allows them."}, "country": {"type": "string", "description": "ISO country code for a `to` written without +; one of the countries the App's Send a call page lists."}, "settings": {"type": "object", "description": "This call's own settings, checked as the App's Send a call page checks them: voice_id, language, max_call_minutes, interruptibility, acknowledgements, background_noise, voicemail, prompt, keywords, call_data, noise_cancellation and interruption_threshold. Unknown keys are refused."}}}, "Call": {"allOf": [{"$ref": "#/components/schemas/Session"}], "properties": {"object": {"const": "call"}, "mode": {"type": "string", "enum": ["agent", "prompt"], "description": "prompt when the conversation was only the prompt. The line agent is agent_id either way."}}}, "Voice": {"type": "object", "required": ["id"], "properties": {"id": {"type": "string", "pattern": "^voice_[a-z2-7]+$", "description": "Sempera's stable id for the voice. Send it back as a draft's `voice.id` or a session's `voice_id`. Older raw ids are still accepted on write."}, "voice_id": {"type": "string", "description": "The same id as `id`."}, "name": {}, "display_name": {}, "language": {}, "description": {}, "source": {"enum": ["built_in", "library", "clone", "design", "custom"]}, "visibility": {}, "production_eligible": {"type": ["boolean", "null"]}, "preview_available": {}, "available": {"type": "boolean"}}}, "PhoneNumber": {"type": "object", "required": ["id", "object", "number"], "properties": {"id": {"type": "string"}, "object": {"const": "phone_number"}, "agent_id": {"type": "string"}, "number": {"type": "string", "description": "E.164"}, "bound_at": {}, "released_at": {}, "carrier": {}, "workspace_id": {}}}, "PhoneNumberBind": {"type": "object", "required": ["agent_id", "number"], "properties": {"agent_id": {"type": "string"}, "number": {"type": "string", "description": "E.164 or national digits."}}}, "Tool": {"type": "object", "required": ["id", "object"], "properties": {"id": {"type": "string"}, "object": {"const": "tool"}, "name": {}, "description": {}, "kind": {}, "status": {"type": "string", "enum": ["enabled", "disabled"]}, "revision": {}, "parameters": {}, "auth": {"description": "Secret REFERENCES, reported configured-or-not; values never appear."}, "request": {}, "config": {}, "created_at": {}, "updated_at": {}, "archived_at": {}}, "additionalProperties": true}, "ToolCreate": {"type": "object", "required": ["definition"], "properties": {"definition": {"type": "object", "description": "A tool definition (see docs/tools-and-integrations.md)."}}}, "ToolUpdate": {"type": "object", "required": ["revision", "definition"], "properties": {"revision": {"type": "integer"}, "definition": {"type": "object"}}}, "ToolExecute": {"type": "object", "properties": {"arguments": {"type": "object"}, "environment": {"type": "string", "enum": ["FIXTURE", "MOCK", "SANDBOX"], "default": "FIXTURE"}, "confirm_write": {"type": "boolean"}}}, "ToolExecution": {"type": "object", "required": ["id", "object", "tool_id", "status"], "properties": {"id": {"type": "string"}, "object": {"const": "tool_execution"}, "tool_id": {"type": "string"}, "environment": {"type": "string"}, "input": {"type": "object"}, "output": {}, "status": {"type": "string", "enum": ["succeeded", "refused", "failed"]}, "error": {}, "started_at": {}, "latency_ms": {"type": "integer"}, "request_id": {"type": "string"}, "actor": {}}}, "Snippet": {"type": "object", "required": ["id", "object", "name"], "properties": {"id": {"type": "string", "pattern": "^snip_[0-9a-f]{16}$"}, "object": {"const": "snippet"}, "name": {"type": "string"}, "description": {"type": "string"}, "status": {"type": "string", "enum": ["active", "archived"]}, "latest_published": {"type": ["integer", "null"]}, "draft_version": {"type": ["integer", "null"]}, "versions": {"type": "array", "items": {"$ref": "#/components/schemas/SnippetVersion"}}, "used_by": {"type": "array", "items": {"type": "object"}}, "created_at": {}, "updated_at": {}, "archived_at": {}, "created_by": {}}}, "SnippetVersion": {"type": "object", "required": ["object", "snippet_id", "version", "state"], "properties": {"object": {"const": "snippet_version"}, "snippet_id": {"type": "string"}, "version": {"type": "integer", "minimum": 1}, "state": {"type": "string", "enum": ["draft", "published"], "description": "A published version never changes; an edit opens a new draft."}, "source": {"type": "string", "description": "An expression in the restricted transform language."}, "inputs": {"type": "array", "items": {"type": "object"}}, "output_schema": {"type": "object", "description": "A subset of JSON Schema; a result that does not match is an error."}, "timeout_ms": {"type": "integer", "minimum": 250, "maximum": 5000}, "content_hash": {"type": "string"}, "created_by": {}, "created_at": {}, "updated_at": {}, "published_by": {}, "published_at": {}, "snippet_name": {}, "snippet_archived": {}}}, "SnippetCreate": {"type": "object", "required": ["name", "source", "output_schema"], "properties": {"name": {"type": "string", "pattern": "^[a-z][a-z0-9_]{1,63}$"}, "description": {"type": "string"}, "source": {"type": "string"}, "inputs": {"type": "array", "items": {"type": "object"}}, "output_schema": {"type": "object"}, "timeout_ms": {"type": "integer", "minimum": 250, "maximum": 5000}}}, "SnippetDraft": {"type": "object", "properties": {"description": {"type": "string"}, "source": {"type": "string"}, "inputs": {"type": "array", "items": {"type": "object"}}, "output_schema": {"type": "object"}, "timeout_ms": {"type": "integer", "minimum": 250, "maximum": 5000}}}, "SnippetTest": {"type": "object", "properties": {"version": {"type": ["integer", "string"], "description": "A version number, or \"draft\"."}, "arguments": {"type": "object"}}}, "SnippetTestResult": {"type": "object", "required": ["object", "status"], "properties": {"object": {"const": "snippet_test"}, "snippet_id": {"type": "string"}, "version": {"type": "integer"}, "state": {"type": "string"}, "input": {"type": "object"}, "status": {"type": "string", "enum": ["succeeded", "failed"]}, "output": {"description": "Present only when the result matched the output shape."}, "error": {}, "error_code": {}, "latency_ms": {}, "audit": {}}}, "Integration": {"type": "object", "required": ["id", "object"], "properties": {"id": {"type": "string"}, "object": {"const": "integration"}, "name": {}, "kind": {}, "status": {"type": "string", "enum": ["configured", "verification_required", "connected", "degraded", "disabled", "error"]}, "revision": {}, "auth": {}, "created_at": {}, "updated_at": {}, "archived_at": {}}, "additionalProperties": true}, "IntegrationCreate": {"type": "object", "required": ["definition"], "properties": {"definition": {"type": "object"}}}, "IntegrationUpdate": {"type": "object", "required": ["revision", "definition"], "properties": {"revision": {"type": "integer"}, "definition": {"type": "object"}}}, "Persona": {"type": "object", "required": ["id", "name", "current_draft_version", "current_production_version"], "properties": {"id": {"type": "string"}, "name": {}, "description": {}, "image_url": {}, "created_at": {}, "updated_at": {}, "deleted_at": {}, "current_draft_version_id": {}, "current_production_version_id": {}, "current_draft_version": {"type": "object"}, "current_production_version": {"type": "object"}, "inbound_numbers": {"type": "array", "items": {"type": "object"}}, "workspace_id": {}}}, "KnowledgeSource": {"type": "object", "required": ["id", "object", "agent_id"], "properties": {"id": {"type": "string"}, "object": {"const": "knowledge_source"}, "agent_id": {"type": "string"}, "type": {"type": "string"}, "name": {"type": ["string", "null"]}, "content_type": {"type": ["string", "null"], "description": "Media type of the kind Sempera read the file as (text/plain, text/markdown, text/csv, text/html, the Word document type or application/pdf)."}, "size_bytes": {"type": ["integer", "null"]}, "processing": {"type": "object", "properties": {"state": {"type": "string", "enum": ["queued", "parsed", "failed"]}, "error": {"type": ["string", "null"]}}}, "collections": {"type": ["array", "null"], "items": {"type": "string"}, "description": "Ids of this agent's collections that hold the source."}, "attached": {"type": ["boolean", "null"], "description": "Whether a collection holding it is attached in the agent's draft."}, "added_at": {"type": ["string", "null"], "format": "date-time", "description": "When the file now on record was uploaded; an in-place edit moves it."}, "raw": {"type": "object"}}}, "KnowledgeSourceUpload": {"type": "object", "required": ["file"], "properties": {"file": {"type": "string", "format": "binary"}, "collection": {"type": "string"}}, "description": "multipart/form-data"}, "TestRun": {"type": "object", "required": ["id", "object"], "properties": {"id": {"type": "string"}, "object": {"const": "test_run"}, "agent_id": {}, "status": {}, "kind": {}, "scenarios": {}, "step_assertions": {}, "started_at": {}, "finished_at": {}, "result": {}, "evidence": {}, "raw": {}, "candidate": {"type": "object"}, "runtime_policy": {"$ref": "#/components/schemas/CandidateRuntimePolicy"}, "release_evidence": {"const": false}}}, "CandidateRuntimePolicy": {"type": "object", "additionalProperties": false, "required": ["evidence", "tools", "max_cost"], "properties": {"evidence": {"const": "local-model"}, "tools": {"const": "fixture"}, "max_cost": {"const": 0}}}, "TestRunCreate": {"type": "object", "required": ["agent_id"], "properties": {"agent_id": {"type": "string"}, "scenarios": {"type": "array", "items": {"type": "string"}}, "candidate_revision": {"type": "string", "minLength": 1}, "runtime_policy": {"$ref": "#/components/schemas/CandidateRuntimePolicy"}, "step_assertions": {"type": "array", "items": {"type": "object"}}}}, "Eval": {"type": "object", "required": ["id", "object"], "properties": {"id": {"type": "string"}, "object": {"const": "eval"}, "name": {}, "description": {}, "kind": {}, "instructions": {}, "applies_to": {}, "revision": {}, "archived_at": {}, "mode": {"type": "string", "enum": ["transcript", "audio"], "description": "Legacy rows without mode use transcript."}, "audio_rule": {"oneOf": [{"type": "null"}, {"$ref": "#/components/schemas/AudioJudgeRule"}]}}, "additionalProperties": true}, "AudioJudgeRule": {"type": "object", "required": ["metric", "operator", "threshold"], "properties": {"metric": {"type": "string", "enum": ["duration_s", "rms", "quiet_ratio", "clipping_ratio"]}, "operator": {"type": "string", "enum": ["lte", "gte"]}, "threshold": {"type": "number", "minimum": 0, "maximum": 1800, "description": "Maximum 1 for ratios and RMS; maximum 1800 for duration in seconds."}}}, "EvalCreate": {"type": "object", "required": ["definition"], "properties": {"definition": {"type": "object"}}}, "EvalUpdate": {"type": "object", "required": ["revision", "definition"], "properties": {"revision": {"type": "integer"}, "definition": {"type": "object"}}}, "EvalRunCreate": {"type": "object", "required": ["agent_id"], "properties": {"agent_id": {"type": "string"}, "eval_id": {"type": "string", "description": "Run one criterion of this workspace instead of all of them."}, "call_ids": {"type": "array", "items": {"type": "string"}, "minItems": 1, "maxItems": 200, "description": "Score only these calls."}}}, "EvalRun": {"type": "object", "required": ["id", "object", "agent_id", "status"], "properties": {"id": {"type": "string", "description": "The run_id the POST /v1/evals/run answer carries."}, "object": {"const": "eval_run"}, "agent_id": {"type": "string"}, "status": {"type": "string", "enum": ["completed", "partial"], "description": "partial: a judge returned unknown for at least one result."}, "started_at": {"type": ["string", "null"]}, "finished_at": {"type": ["string", "null"]}, "duration_seconds": {"type": ["integer", "null"]}, "started_by": {}, "judges": {"type": "array", "items": {"type": "object"}}, "agent_versions": {"type": "array", "items": {"type": "integer"}}, "case_count": {"type": "integer"}, "pair_count": {"type": "integer"}, "scored": {"type": "integer"}, "carried_over": {"type": "integer"}, "previous_run_id": {"type": ["string", "null"]}}, "additionalProperties": true}, "RuntimeIdentity": {"type": ["object", "null"], "description": "What heard, thought and spoke on this session, as a workspace member reads it: `legs` (stt, llm, tts: each with `engine`, `model`, `machine` as a category, and for tts `ended_on`), `fallbacks` (whether a leg handed over), `worker` (`runtime` origin or hosted, `transport`), `latency` timings, `traffic` (`class`: customer, demo, test or unrecorded) and `verified`, false when the stored block no longer matches its own integrity checksum. Engines and models carry Sempera's sealed names (`engine_...`), never a supplier's. null for a session recorded before the block existed.", "properties": {"schema": {}, "traffic": {"type": "object"}, "legs": {"type": "object"}, "fallbacks": {"type": "object"}, "worker": {"type": "object"}, "latency": {"type": "object"}, "verified": {"type": ["boolean", "null"]}}, "additionalProperties": true}, "Workspace": {"type": "object", "required": ["id", "object", "name"], "properties": {"id": {"type": "string"}, "object": {"const": "workspace"}, "name": {"type": "string"}, "handle": {}, "kind": {}, "status": {}, "created_at": {}, "organization_id": {}, "your_role": {}, "agents": {}}}, "WorkspacePatch": {"type": "object", "required": ["name"], "properties": {"name": {"type": "string", "maxLength": 120}}}, "Organization": {"type": "object", "required": ["id", "object", "name"], "properties": {"id": {"type": "string"}, "object": {"const": "organization"}, "name": {"type": "string"}, "kind": {}, "workspaces": {"type": "array", "items": {"$ref": "#/components/schemas/Workspace"}}}}, "ApiKey": {"type": "object", "required": ["id", "object", "kind", "role", "scopes"], "properties": {"id": {"type": "string"}, "object": {"const": "api_key"}, "name": {}, "kind": {"type": "string"}, "role": {"type": "string"}, "scopes": {"type": "array", "items": {"type": "string"}}, "key_prefix": {}, "workspace_id": {}, "status": {"type": "string", "enum": ["active", "revoked", "expired"]}, "created_by": {"type": ["string", "null"], "description": "The user who minted the key, or null for a key the platform minted."}, "created_at": {}, "expires_at": {}, "revoked_at": {}, "last_used_at": {}}}, "ApiKeyCreate": {"type": "object", "required": ["kind", "scopes"], "properties": {"kind": {"type": "string", "enum": ["developer", "runtime", "ci", "service", "admin"]}, "name": {"type": "string"}, "scopes": {"type": "array", "items": {"type": "string"}}, "role": {"type": "string", "enum": ["owner", "operator", "viewer"]}, "expires_at": {"type": "string", "format": "date-time"}}}, "ApiKeyPatch": {"type": "object", "required": ["name"], "properties": {"name": {"type": "string", "minLength": 1, "maxLength": 120}}}, "ApiKeyCreated": {"allOf": [{"$ref": "#/components/schemas/ApiKey"}], "properties": {"secret": {"type": "string", "description": "Shown once. Store it now."}}}, "Platform": {"type": "object", "required": ["object", "build", "production"], "properties": {"object": {"const": "platform"}, "build": {"type": "object"}, "production": {"type": "boolean"}, "capacity": {"type": "object"}, "request_id": {"type": "string"}}}, "Credential": {"type": "object", "properties": {"object": {"const": "credential"}, "kind": {"type": "string"}, "key_kind": {}, "key_id": {}, "identity": {}, "workspace_id": {}, "role": {}, "scopes": {}, "agents": {}}}, "WebhookEndpoint": {"type": "object", "required": ["id", "object", "url", "events", "enabled"], "properties": {"id": {"type": "string"}, "object": {"const": "webhook_endpoint"}, "url": {"type": "string"}, "post_call_filter": {"$ref": "#/components/schemas/PostCallFilter"}, "description": {}, "events": {"type": "array", "items": {"type": "string"}}, "enabled": {"type": "boolean"}, "has_secret": {"type": "boolean"}, "workspace_id": {}, "created_at": {}, "updated_at": {}}}, "WebhookEndpointCreate": {"type": "object", "required": ["url", "secret"], "properties": {"post_call_filter": {"$ref": "#/components/schemas/PostCallFilter", "description": "Optional immutable call_id or phone_number selector; requires events [call.completed]. Omit for account-wide delivery."}, "url": {"type": "string", "format": "uri"}, "description": {"type": "string"}, "events": {"type": "array", "items": {"type": "string"}}, "secret": {"type": "string", "minLength": 16, "maxLength": 256, "description": "Write-only signing secret."}}}, "WebhookEndpointPatch": {"type": "object", "properties": {"url": {"type": "string"}, "description": {"type": "string"}, "events": {"type": "array", "items": {"type": "string"}}, "enabled": {"type": "boolean"}, "secret": {"type": "string"}, "expected_updated_at": {"type": "string", "format": "date-time", "description": "Optional. The updated_at you read, sent back unchanged (a time with a zone). The change, a rotated secret included, is saved only if the endpoint still has that updated_at; otherwise 409 conflict with reason stale_webhook and nothing is written."}}}, "PostCallFilter": {"oneOf": [{"type": "object", "maxProperties": 0}, {"type": "object", "required": ["call_id"], "properties": {"call_id": {"type": "string"}}, "additionalProperties": false}, {"type": "object", "required": ["phone_number"], "properties": {"phone_number": {"type": "string"}}, "additionalProperties": false}]}, "WebhookResend": {"type": "object", "required": ["object", "event_id", "status", "attempts", "response_code", "error"], "properties": {"object": {"const": "webhook_resend"}, "event_id": {"type": "string"}, "status": {"type": "string"}, "attempts": {"type": "integer", "minimum": 0}, "response_code": {"type": ["integer", "null"]}, "error": {"type": "string"}}}, "PublicBatch": {"type": "object", "required": ["id", "kind", "name", "state", "summary", "recipients"], "properties": {"id": {"type": "string"}, "kind": {"type": "string"}, "name": {"type": "string"}, "state": {"type": "string"}, "consent_basis": {"type": "string"}, "timezone": {"type": "string"}, "window": {"type": "object", "required": ["start", "end"], "properties": {"start": {"type": "string"}, "end": {"type": "string"}}}, "concurrency": {"type": "integer", "minimum": 0}, "max_attempts": {"type": "integer", "minimum": 0}, "retry_after_s": {"type": "integer", "minimum": 0}, "created_at": {"type": "number"}, "stopped_reason": {"type": ["string", "null"]}, "paused_reason": {"type": ["string", "null"]}, "held_reason": {"type": ["string", "null"]}, "precall_dtmf": {"type": ["string", "null"]}, "from_number": {"type": ["string", "null"]}, "operator_approved": {"type": "boolean"}, "start_at": {"type": ["number", "null"]}, "starts_later": {"type": "boolean"}, "last_pass": {"type": ["object", "null"], "properties": {"at": {"type": "number"}, "road": {"type": "string"}, "placed": {"type": "integer", "minimum": 0}}}, "summary": {"type": "object", "additionalProperties": {"type": "integer", "minimum": 0}}, "single_call": {"const": true}, "call_settings": {"type": "object", "description": "The owner-selected settings for a single call."}, "recipients": {"type": "array", "items": {"type": "object", "required": ["number", "timezone", "state", "precall_dtmf", "attempts", "reason", "last"], "properties": {"number": {"type": "string"}, "timezone": {"type": "string"}, "state": {"type": "string"}, "precall_dtmf": {"type": ["string", "null"]}, "attempts": {"type": "integer", "minimum": 0}, "reason": {"type": ["string", "null"]}, "last": {"anyOf": [{"type": "null"}, {"type": "object", "required": [], "properties": {"at": {"type": "number"}, "n": {"type": "integer", "minimum": 0}, "ok": {"type": "boolean"}, "status": {"type": "string"}, "dialed": {"type": "boolean"}, "agent_version_id": {"type": "string"}}}]}}}}}}, "PublicBatchDetail": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"allOf": [{"$ref": "#/components/schemas/PublicBatch"}], "properties": {"agent_id": {"type": "string"}}}, "errors": {"type": "null"}}}, "PublicBatchCreated": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["batch_id", "batch", "scheduler"], "properties": {"batch_id": {"type": "string"}, "batch": {"$ref": "#/components/schemas/PublicBatch"}, "scheduler": {"type": "object", "required": ["automatic", "every_s"], "properties": {"automatic": {"type": "boolean"}, "every_s": {"type": "integer", "minimum": 0}}}}}, "errors": {"type": "null"}}}, "PublicBatchLogs": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "array", "items": {"type": "object", "required": ["batch_id", "agent_id", "recipient_index"], "properties": {"batch_id": {"type": "string"}, "agent_id": {"type": "string"}, "recipient_index": {"type": "integer", "minimum": 0}, "at": {"type": "number"}, "n": {"type": "integer", "minimum": 0}, "ok": {"type": "boolean"}, "status": {"type": "string"}, "dialed": {"type": "boolean"}}}}, "errors": {"type": "null"}}}, "PublicBatchStopped": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "null"}, "errors": {"type": "null"}}}, "PublicBatchPass": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["client", "batch", "placed", "state", "summary"], "properties": {"client": {"type": "string"}, "batch": {"$ref": "#/components/schemas/PublicBatch"}, "placed": {"type": "array", "items": {"type": "object", "required": [], "properties": {"at": {"type": "number"}, "n": {"type": "integer", "minimum": 0}, "ok": {"type": "boolean"}, "status": {"type": "string"}, "dialed": {"type": "boolean"}, "agent_version_id": {"type": "string"}}}}, "state": {"type": "string"}, "summary": {"type": "object", "additionalProperties": {"type": "integer", "minimum": 0}}, "refused": {"type": "object", "required": ["code", "reason"], "properties": {"code": {"type": "string"}, "reason": {"type": "string"}}}}}, "errors": {"type": "null"}}}, "SmsSendResult": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["status", "sent"], "properties": {"conversation_id": {"type": "string"}, "message_id": {"type": "string"}, "status": {"type": "string"}, "sent": {"type": "boolean"}, "error": {"type": ["string", "null"]}, "index": {"type": "integer", "minimum": 0}}}, "errors": {"type": "null"}}}, "SmsBatchResult": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["batch_id", "messages"], "properties": {"batch_id": {"type": "string"}, "messages": {"type": "array", "items": {"type": "object", "required": ["status", "sent"], "properties": {"conversation_id": {"type": "string"}, "message_id": {"type": "string"}, "status": {"type": "string"}, "sent": {"type": "boolean"}, "error": {"type": ["string", "null"]}, "index": {"type": "integer", "minimum": 0}}}}}}, "errors": {"type": "null"}}}, "SmsConversation": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["id", "agent_id", "effective_channel", "user_number", "agent_number", "is_active", "handoff", "messages"], "properties": {"id": {"type": "string"}, "agent_id": {"type": "string"}, "effective_channel": {"const": "sms"}, "user_number": {"type": ["string", "null"]}, "agent_number": {"type": ["string", "null"]}, "is_active": {"type": "boolean"}, "handoff": {"enum": ["ai", "human", "ended"]}, "messages": {"type": "array", "items": {"type": "object", "required": ["id", "message", "sender", "created_at", "delivery"], "properties": {"id": {"type": "string"}, "message": {"type": "string"}, "sender": {"type": "string"}, "created_at": {"type": "string"}, "delivery": {"type": ["object", "null"], "properties": {"status": {"type": "string"}, "sent": {"type": "boolean"}, "error": {"type": ["string", "null"]}}}}}}}}, "errors": {"type": "null"}}}, "SmsMessages": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "array", "items": {"type": "object", "required": ["id", "message", "sender", "created_at", "delivery"], "properties": {"id": {"type": "string"}, "message": {"type": "string"}, "sender": {"type": "string"}, "created_at": {"type": "string"}, "delivery": {"type": ["object", "null"], "properties": {"status": {"type": "string"}, "sent": {"type": "boolean"}, "error": {"type": ["string", "null"]}}}}}}, "errors": {"type": "null"}}}, "SmsPolicy": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["thread", "state", "consent", "do_not_contact", "can_send", "reason", "sending_hours", "max_body_chars"], "properties": {"thread": {"type": "string"}, "state": {"enum": ["ai", "human", "ended"]}, "consent": {"enum": ["not_opted_out", "opted_out", "unreadable"]}, "do_not_contact": {"type": "boolean"}, "can_send": {"type": "boolean"}, "reason": {"type": ["string", "null"]}, "sending_hours": {"type": "object", "required": ["timezone", "window", "human_reply_exempt"], "properties": {"timezone": {"type": "string"}, "window": {"type": "string"}, "human_reply_exempt": {"type": "boolean"}}}, "max_body_chars": {"type": "integer", "minimum": 0}}}, "errors": {"type": "null"}}}, "SmsHandoff": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["thread", "state", "ai_replies", "can_reply"], "properties": {"thread": {"type": ["string", "null"]}, "state": {"enum": ["ai", "human", "ended"]}, "ai_replies": {"type": "boolean"}, "can_reply": {"type": "boolean"}}}, "errors": {"type": "null"}}}, "OAuthError": {"type": "object", "properties": {"error": {"type": "string"}, "error_description": {"type": "string"}}, "required": ["error", "error_description"]}, "OAuthProtectedResource": {"type": "object", "properties": {"resource": {"type": "string", "format": "uri"}, "authorization_servers": {"type": "array", "items": {"type": "string"}}, "scopes_supported": {"type": "array", "items": {"type": "string"}}, "bearer_methods_supported": {"type": "array", "items": {"const": "header"}}, "resource_name": {"const": "Sempera"}}, "required": ["resource", "authorization_servers", "scopes_supported", "bearer_methods_supported", "resource_name"]}, "OAuthAuthorizationServer": {"type": "object", "properties": {"issuer": {"type": "string", "format": "uri"}, "authorization_endpoint": {"type": "string", "format": "uri"}, "token_endpoint": {"type": "string", "format": "uri"}, "registration_endpoint": {"type": "string", "format": "uri"}, "response_types_supported": {"type": "array", "items": {"type": "string"}}, "grant_types_supported": {"type": "array", "items": {"type": "string"}}, "code_challenge_methods_supported": {"type": "array", "items": {"type": "string"}}, "token_endpoint_auth_methods_supported": {"type": "array", "items": {"type": "string"}}, "scopes_supported": {"type": "array", "items": {"type": "string"}}, "authorization_response_iss_parameter_supported": {"const": true}}, "required": ["issuer", "authorization_endpoint", "token_endpoint", "registration_endpoint", "response_types_supported", "grant_types_supported", "code_challenge_methods_supported", "token_endpoint_auth_methods_supported", "scopes_supported", "authorization_response_iss_parameter_supported"]}, "OAuthClientRegistration": {"type": "object", "properties": {"redirect_uris": {"type": "array", "items": {"type": "string"}, "minItems": 1, "maxItems": 10, "description": "Exact HTTPS redirects, or HTTP on loopback."}, "client_name": {"type": "string"}, "token_endpoint_auth_method": {"enum": ["none", "client_secret_post", "client_secret_basic"]}, "grant_types": {"type": "array", "items": {"enum": ["authorization_code", "refresh_token"]}}, "response_types": {"type": "array", "items": {"const": "code"}}}, "required": ["redirect_uris"]}, "OAuthClient": {"type": "object", "properties": {"redirect_uris": {"type": "array", "items": {"type": "string"}, "minItems": 1, "maxItems": 10, "description": "Exact HTTPS redirects, or HTTP on loopback."}, "client_name": {"type": "string"}, "token_endpoint_auth_method": {"enum": ["none", "client_secret_post", "client_secret_basic"]}, "grant_types": {"type": "array", "items": {"enum": ["authorization_code", "refresh_token"]}}, "response_types": {"type": "array", "items": {"const": "code"}}, "client_id": {"type": "string"}, "client_id_issued_at": {"type": "integer"}, "client_secret": {"type": "string"}, "client_secret_expires_at": {"const": 0}}, "required": ["redirect_uris", "client_name", "token_endpoint_auth_method", "grant_types", "response_types", "client_id", "client_id_issued_at"]}, "OAuthTokenRequest": {"type": "object", "properties": {"grant_type": {"enum": ["authorization_code", "refresh_token"]}, "client_id": {"type": "string"}, "client_secret": {"type": "string"}, "code": {"type": "string"}, "redirect_uri": {"type": "string", "format": "uri"}, "code_verifier": {"type": "string"}, "refresh_token": {"type": "string"}, "scope": {"type": "string"}, "resource": {"type": "string", "format": "uri"}}, "required": ["grant_type"], "description": "Authenticate a public client with client_id; confidential clients use body credentials or HTTP Basic. Code exchange requires code, redirect_uri and code_verifier; refresh requires refresh_token."}, "OAuthToken": {"type": "object", "properties": {"access_token": {"type": "string"}, "token_type": {"const": "Bearer"}, "expires_in": {"type": "integer"}, "refresh_token": {"type": "string"}, "scope": {"type": "string"}}, "required": ["access_token", "token_type", "expires_in", "refresh_token", "scope"]}, "PaymentProviderEvent": {"type": "object", "properties": {"id": {"type": "string"}, "type": {"type": "string"}, "data": {"type": "object", "properties": {"object": {"type": "object"}}, "required": ["object"]}}, "required": ["id", "type", "data"], "description": "Signed raw provider event. Additional provider fields are preserved for verification."}, "PaymentProviderReceipt": {"type": "object", "properties": {"received": {"const": true}, "result": {"type": "string"}, "workspace_id": {"type": ["string", "null"]}, "invoice_id": {"type": "string"}}, "required": ["received", "result", "workspace_id"], "additionalProperties": true}, "TelephonyProviderEvent": {"type": "object", "properties": {"call_id": {"type": "string"}, "provider_call_id": {"type": "string"}, "provider": {"type": "string"}, "to": {"type": "string"}, "to_number": {"type": "string"}, "from": {"type": "string"}, "started_at": {"type": "string"}, "created_at": {"type": "string"}, "ended_at": {"type": "string"}, "outcome": {"type": "string"}, "summary": {"type": "string"}, "agent_version": {"type": "string"}, "language": {"type": "string"}, "recording_url": {"type": "string"}, "carrier_recording_sid": {"type": "string"}, "concatenated_transcript": {"type": "string"}, "duration_s": {"type": "number"}, "call_length": {"type": "number"}, "record": {"type": "boolean"}, "transcripts": {"type": "array", "items": {"type": "object", "properties": {"user": {"type": "string"}, "speaker": {"type": "string"}, "text": {"type": "string"}, "say": {"type": "string"}, "content": {"type": "string"}}, "required": []}}}, "required": [], "additionalProperties": true}, "TelephonyProviderReceipt": {"type": "object", "properties": {"accepted": {"const": true}, "call_id": {"type": ["string", "null"]}, "stored": {"type": "boolean"}, "replay": {"type": "boolean"}, "reason": {"type": "string"}, "recording_stored": {"type": "boolean"}}, "required": ["accepted", "call_id", "stored"]}, "CarrierVoiceEvent": {"type": "object", "properties": {"To": {"type": "string"}, "CallSid": {"type": "string", "pattern": "^CA[0-9a-fA-F]{32}$"}, "Direction": {"const": "inbound"}, "From": {"type": "string"}, "ForwardedFrom": {"type": "string"}}, "required": ["To", "CallSid", "Direction"]}, "CarrierMessageEvent": {"type": "object", "properties": {"To": {"type": "string"}, "CallSid": {"type": "string"}, "RecordingSid": {"type": "string"}, "RecordingUrl": {"type": "string"}, "RecordingDuration": {"type": "string"}, "From": {"type": "string"}, "ForwardedFrom": {"type": "string"}}, "required": ["To", "CallSid", "RecordingSid", "RecordingUrl"]}, "TextProviderEvent": {"type": "object", "properties": {"api_version": {"const": "v3"}, "webhook_version": {"const": "2026-02-03"}, "event_id": {"type": "string"}, "event_type": {"type": "string"}, "data": {"type": "object", "properties": {"id": {"type": "string"}, "chat": {"type": "object", "properties": {"id": {"type": "string"}, "is_group": {"const": false}, "owner_handle": {"type": "object", "properties": {"handle": {"type": "string"}, "is_me": {"const": true}}, "required": ["handle", "is_me"]}}, "required": ["id", "is_group", "owner_handle"]}, "sender_handle": {"type": "object", "properties": {"handle": {"type": "string", "pattern": "^\\+[1-9][0-9]{7,14}$"}, "is_me": {"const": false}}, "required": ["handle", "is_me"]}, "direction": {"const": "inbound"}, "service": {"const": "iMessage"}, "parts": {"type": "array", "minItems": 1, "items": {"type": "object", "properties": {"type": {"const": "text"}, "value": {"type": "string"}}, "required": ["type", "value"]}}}, "required": ["id", "chat", "sender_handle", "direction", "service", "parts"], "description": "Required for message.received. Other event types are acknowledged without processing data."}}, "required": ["api_version", "webhook_version", "event_id", "event_type"]}, "TextProviderReceipt": {"type": "object", "properties": {"accepted": {"const": true}}, "required": ["accepted"]}, "ServiceIngressError": {"type": "object", "properties": {"error": {"type": "string"}}, "required": ["error"]}, "RepositoryProviderEvent": {"type": "object", "properties": {"action": {"type": "string"}, "installation": {"type": "object"}, "repository": {"type": "object"}, "ref": {"type": "string"}, "after": {"type": "string"}}, "required": [], "additionalProperties": true}, "RepositoryProviderReceipt": {"type": "object", "properties": {"ok": {"type": "boolean"}, "event": {"type": "string"}, "ignored": {"type": "string"}, "duplicate": {"type": "boolean"}, "results": {"type": "array", "items": {"type": "object"}}}, "required": ["ok"], "additionalProperties": true}, "LegacyHandoffEvent": {"type": "object", "properties": {"call_id": {"type": "string", "pattern": "^[A-Za-z0-9_-]{1,128}$"}, "subject": {"type": "string", "maxLength": 160, "pattern": "^\\[Layla\\] "}, "text": {"type": "string", "minLength": 1}, "html": {"type": "string", "minLength": 1}, "attachments": {"type": "array", "maxItems": 1, "items": {"type": "object", "properties": {"filename": {"type": "string"}, "content": {"type": "string", "contentEncoding": "base64"}}, "required": ["filename", "content"]}}}, "required": ["call_id", "subject", "text", "html"]}, "LegacyHandoffReceipt": {"type": "object", "properties": {"state": {"enum": ["sent", "unknown", "failed", "retry"]}}, "required": ["state"]}, "OperationalReviewCreate": {"type": "object", "properties": {"issue": {"type": "string", "pattern": "^SEM-[1-9][0-9]{0,6}$"}, "kind": {"enum": ["provider", "weekly", "monthly", "credential"]}, "resource": {"type": "string", "maxLength": 80, "description": "Plain handle, or an existing non-secret credential registry name."}, "evidence_date": {"type": "string", "format": "date", "description": "Non-future UTC date."}, "state": {"enum": ["planned", "source-built", "merged", "deployed", "production-verified"]}, "owner": {"type": ["string", "null"], "pattern": "^[a-z][a-z0-9-]{1,31}$"}, "next_action": {"enum": ["read-production", "read-provider", "reconcile-linear", "reconcile-cogs", "owner-review", "rotate-credential", "review-scope", "offboard-access", "recovery-drill", "verify-delivery", "review-next-window"]}, "blocker": {"enum": ["none", "production-proof", "account-access", "owner-decision", "finance", "legal", "delivery", "acceptance"]}, "source_sha": {"type": ["string", "null"], "pattern": "^[0-9a-f]{40}$"}, "deployment_sha": {"type": ["string", "null"], "pattern": "^[0-9a-f]{40}$"}, "ci_run": {"type": ["string", "null"], "pattern": "^[1-9][0-9]{0,19}$"}, "evidence_ref": {"type": ["string", "null"], "maxLength": 400}, "acceptance_ref": {"type": "string", "maxLength": 400, "description": "Canonical issue URL matching issue. Built states need source_sha and evidence_ref; deployed states also need deployment_sha. Production-verified requires matching SHAs, ci_run and outcome=pass."}, "outcome": {"enum": ["pass", "fail", "unknown"]}}, "required": ["issue", "kind", "resource", "evidence_date", "state", "owner", "next_action", "blocker", "source_sha", "deployment_sha", "ci_run", "evidence_ref", "acceptance_ref", "outcome"], "additionalProperties": false}, "OperationalReview": {"type": "object", "properties": {"issue": {"type": "string", "pattern": "^SEM-[1-9][0-9]{0,6}$"}, "kind": {"enum": ["provider", "weekly", "monthly", "credential"]}, "resource": {"type": "string", "maxLength": 80, "description": "Plain handle, or an existing non-secret credential registry name."}, "evidence_date": {"type": "string", "format": "date", "description": "Non-future UTC date."}, "state": {"enum": ["planned", "source-built", "merged", "deployed", "production-verified"]}, "owner": {"type": ["string", "null"], "pattern": "^[a-z][a-z0-9-]{1,31}$"}, "next_action": {"enum": ["read-production", "read-provider", "reconcile-linear", "reconcile-cogs", "owner-review", "rotate-credential", "review-scope", "offboard-access", "recovery-drill", "verify-delivery", "review-next-window"]}, "blocker": {"enum": ["none", "production-proof", "account-access", "owner-decision", "finance", "legal", "delivery", "acceptance"]}, "source_sha": {"type": ["string", "null"], "pattern": "^[0-9a-f]{40}$"}, "deployment_sha": {"type": ["string", "null"], "pattern": "^[0-9a-f]{40}$"}, "ci_run": {"type": ["string", "null"], "pattern": "^[1-9][0-9]{0,19}$"}, "evidence_ref": {"type": ["string", "null"], "maxLength": 400}, "acceptance_ref": {"type": "string", "maxLength": 400, "description": "Canonical issue URL matching issue. Built states need source_sha and evidence_ref; deployed states also need deployment_sha. Production-verified requires matching SHAs, ci_run and outcome=pass."}, "outcome": {"enum": ["pass", "fail", "unknown"]}, "reviewed_at": {"type": "string", "format": "date-time"}, "due_date": {"type": "string", "format": "date"}, "overdue": {"type": "boolean"}, "attestation_only": {"const": true}, "receipt_id": {"type": "string"}}, "required": ["issue", "kind", "resource", "evidence_date", "state", "owner", "next_action", "blocker", "source_sha", "deployment_sha", "ci_run", "evidence_ref", "acceptance_ref", "outcome", "reviewed_at", "due_date", "overdue", "attestation_only", "receipt_id"]}, "OperationalReviewList": {"type": "object", "properties": {"reviews": {"type": "array", "items": {"$ref": "#/components/schemas/OperationalReview"}}, "history": {"type": "array", "items": {"$ref": "#/components/schemas/OperationalReview"}, "maxItems": 200}, "has_more": {"type": "boolean"}, "authority": {"type": "string"}}, "required": ["reviews", "history", "has_more", "authority"]}, "AgentList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Agent"}}}}, "AgentVersionList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/AgentVersion"}}}}, "SessionList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Session"}}}}, "CallList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Call"}}}}, "VoiceList": {"type": "object", "required": ["voices"], "properties": {"voices": {"type": "array", "items": {"$ref": "#/components/schemas/Voice"}}}}, "PhoneNumberList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/PhoneNumber"}}}}, "ToolList": {"type": "object", "required": ["status", "tools", "hasMore", "nextCursor", "data", "errors"], "properties": {"status": {"const": "success"}, "tools": {"type": "array", "items": {"$ref": "#/components/schemas/Tool"}}, "hasMore": {"type": "boolean"}, "nextCursor": {"type": ["string", "null"]}, "data": {"type": "null"}, "errors": {"type": "null"}}}, "SnippetList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Snippet"}}}}, "IntegrationList": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "object", "required": ["count", "integrations"], "properties": {"count": {"type": "integer"}, "integrations": {"type": "array", "items": {"type": "object"}}}}, "errors": {"type": "null"}}}, "KnowledgeSourceList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/KnowledgeSource"}}, "collections": {"type": "array", "items": {"type": "object"}, "description": "The agent's collections, with whether each is attached and how it stands against the last build."}, "pdf_supported": {"type": "boolean", "description": "Whether this machine can read a PDF upload."}}}, "PersonaList": {"type": "object", "required": ["data", "errors"], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Persona"}}, "errors": {"type": "null"}}}, "TestRunList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/TestRun"}}}}, "EvalList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Eval"}}}}, "EvalRunList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/EvalRun"}}}}, "WorkspaceList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Workspace"}}}}, "OrganizationList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/Organization"}}}}, "ApiKeyList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/ApiKey"}}}}, "WebhookEndpointList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/WebhookEndpoint"}}}}, "ReleaseDeploymentList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/ReleaseDeployment"}}}}, "McpConnectionList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/McpConnection"}}}}, "ClientGrantList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/ClientGrant"}}}}, "WebhookDeliveryList": {"allOf": [{"$ref": "#/components/schemas/ListEnvelope"}], "properties": {"data": {"type": "array", "items": {"$ref": "#/components/schemas/WebhookDelivery"}}}}, "PhoneProfile": {"type": "object", "required": ["object", "client", "plan"], "properties": {"object": {"const": "phone_profile"}, "client": {"type": "object"}, "plan": {"type": ["object", "null"]}, "number": {"type": ["string", "null"]}, "agent": {"type": ["object", "null"]}, "allowance": {"type": ["object", "null"]}, "recent_threads": {"type": "array", "items": {"type": "string"}}}}, "PhoneTaskPreview": {"type": "object", "additionalProperties": false, "required": ["to", "task", "permitted_actions"], "properties": {"to": {"type": "string"}, "task": {"type": "string", "minLength": 1, "maxLength": 1500}, "permitted_actions": {"type": "array", "items": {"type": "string"}, "minItems": 1}, "max_minutes": {"type": "integer", "minimum": 1}}}, "PhoneTaskStart": {"type": "object", "additionalProperties": false, "required": ["id", "to", "task", "permitted_actions", "spend_bound_cents"], "properties": {"to": {"type": "string"}, "task": {"type": "string", "minLength": 1, "maxLength": 1500}, "permitted_actions": {"type": "array", "items": {"type": "string"}, "minItems": 1}, "max_minutes": {"type": "integer", "minimum": 1}, "id": {"type": "string", "format": "uuid"}, "spend_bound_cents": {"type": "integer", "minimum": 0}}}, "PhoneTask": {"type": "object", "required": ["id", "object", "state", "direction"], "properties": {"id": {"type": "string", "format": "uuid"}, "object": {"const": "phone_task"}, "state": {"type": "string", "enum": ["awaiting_approval", "reserved", "dispatching", "ringing", "connected", "completed", "failed", "cancelled", "reconciling"]}, "direction": {"type": "string"}, "to": {"type": "string"}, "client_id": {"type": ["string", "null"]}, "max_minutes": {"type": "integer"}, "permitted_actions": {"type": "array", "items": {"type": "string"}}, "spend_bound_cents": {"type": "integer"}, "reserved_minutes": {"type": "integer"}, "billed_minutes": {"type": ["integer", "null"]}, "agent_version_id": {"type": ["string", "null"]}, "call_id": {"type": ["string", "null"]}, "provider_call_id": {"type": ["string", "null"]}, "error": {"type": ["string", "null"]}, "error_reason": {"type": ["string", "null"]}, "approval": {"type": "object", "required": ["standing", "url"], "properties": {"standing": {"type": "boolean"}, "url": {"type": ["string", "null"]}}}, "result": {"type": ["object", "null"]}}}, "PhoneMessagePreview": {"type": "object", "additionalProperties": false, "required": ["to", "body"], "properties": {"to": {"type": "string"}, "body": {"type": "string"}}}, "PhoneMessageSend": {"type": "object", "additionalProperties": false, "required": ["id", "to", "body", "spend_bound_cents"], "properties": {"to": {"type": "string"}, "body": {"type": "string"}, "id": {"type": "string", "format": "uuid"}, "spend_bound_cents": {"type": "integer", "minimum": 0}}}, "PhoneMessage": {"type": "object", "required": ["id", "object", "state", "segments"], "properties": {"id": {"type": "string", "format": "uuid"}, "object": {"const": "phone_message"}, "state": {"type": "string"}, "direction": {"type": "string"}, "segments": {"type": "integer"}, "segments_settled": {"type": "boolean"}, "encoding": {"type": "string"}, "thread_id": {"type": ["string", "null"]}, "provider_message_id": {"type": ["string", "null"]}, "spend_bound_cents": {"type": "integer"}, "error": {"type": ["string", "null"]}, "approval": {"type": "object", "required": ["standing", "url"], "properties": {"standing": {"type": "boolean"}, "url": {"type": ["string", "null"]}}}}}, "PhoneThread": {"type": "object", "required": ["id", "object", "messages"], "properties": {"id": {"type": "string"}, "object": {"const": "phone_thread"}, "peer": {"type": "string"}, "number": {"type": "string"}, "state": {"type": "string"}, "note": {"type": "string"}, "messages": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "direction": {"type": "string"}, "body": {"type": ["string", "null"]}, "untrusted": {"type": "boolean"}}}}}}, "PhoneOnboarding": {"type": "object", "required": ["device_code", "user_code", "verification_url"], "properties": {"device_code": {"type": "string"}, "user_code": {"type": "string"}, "verification_url": {"type": "string"}, "verification_url_complete": {"type": "string"}, "expires_in": {"type": "integer"}, "interval": {"type": "integer"}}}, "PhoneOnboardingPoll": {"type": "object", "required": ["status"], "properties": {"status": {"type": "string", "enum": ["pending", "approved", "expired"]}, "interval": {"type": "integer"}, "api_key": {"type": "string"}, "workspace_id": {"type": "string"}, "phone_number": {"type": ["string", "null"]}, "plan": {"type": "object", "properties": {"name": {"type": ["string", "null"]}, "display_name": {"type": ["string", "null"]}, "status": {"type": "string", "enum": ["none", "active", "past_due"]}, "phone_number": {"type": ["string", "null"]}, "concurrency": {"type": ["integer", "null"]}, "max_call_duration_minutes": {"type": ["integer", "null"]}, "allowed_countries": {"type": ["array", "null"], "items": {"type": "string"}}, "current_period_end": {"type": ["string", "null"], "format": "date-time"}}}, "client_name": {"type": "string"}, "scopes": {"type": "array", "items": {"type": "string"}}}}, "PhoneOnboardingApproved": {"type": "object", "required": ["status", "api_key", "workspace_id", "plan"], "properties": {"status": {"type": "string", "enum": ["approved"]}, "api_key": {"type": "string"}, "workspace_id": {"type": "string"}, "phone_number": {"type": ["string", "null"]}, "plan": {"type": "object", "properties": {"name": {"type": ["string", "null"]}, "display_name": {"type": ["string", "null"]}, "status": {"type": "string", "enum": ["none", "active", "past_due"]}, "phone_number": {"type": ["string", "null"]}, "concurrency": {"type": ["integer", "null"]}, "max_call_duration_minutes": {"type": ["integer", "null"]}, "allowed_countries": {"type": ["array", "null"], "items": {"type": "string"}}, "current_period_end": {"type": ["string", "null"], "format": "date-time"}}}, "client_name": {"type": "string"}, "scopes": {"type": "array", "items": {"type": "string"}}}}}, "securitySchemes": {"oauthClientBasic": {"type": "http", "scheme": "basic", "description": "Confidential OAuth client credentials."}, "paymentProviderSignature": {"type": "apiKey", "in": "header", "name": "Stripe-Signature", "description": "Provider signature over the exact raw body, with a 300-second tolerance."}, "carrierToken": {"type": "apiKey", "in": "query", "name": "token", "description": "Shared carrier callback token."}, "carrierTokenHeader": {"type": "apiKey", "in": "header", "name": "X-Sempera-Telephony-Token"}, "carrierSignature": {"type": "apiKey", "in": "header", "name": "X-Twilio-Signature", "description": "Carrier signature over the public request URL and form fields."}, "textSignature": {"type": "apiKey", "in": "header", "name": "webhook-signature", "description": "Signature over webhook-id.webhook-timestamp.raw_body; both companion headers are required. 300-second tolerance."}, "repositorySignature": {"type": "apiKey", "in": "header", "name": "X-Hub-Signature-256", "description": "HMAC-SHA256 of raw body. X-GitHub-Delivery and X-GitHub-Event are also required."}, "handoffToken": {"type": "apiKey", "in": "header", "name": "X-Sempera-Handoff-Token"}, "apiKey": {"type": "http", "scheme": "bearer", "bearerFormat": "sempera_sk_...", "description": "A workspace-scoped API key. Scopes: agents:read, agents:write, agents:publish, sessions:read, sessions:write, calls:read, calls:write, phone_numbers:read, phone_numbers:write, tools:read, tools:write, tools:execute, integrations:read, integrations:write, knowledge:read, knowledge:write, tests:read, tests:write, evals:read, evals:write, workspaces:read, workspaces:write, organizations:read, organizations:write, api_keys:read, api_keys:write, webhooks:read, webhooks:write, deploy:read, models:read, prompts:read, prompts:write, phone:read, phone:call, phone:text. Kinds cap scopes: developer: agents:publish, agents:read, agents:write, api_keys:read, calls:read, calls:write, deploy:read, evals:read, evals:write, integrations:read, integrations:write, knowledge:read, knowledge:write, models:read, organizations:read, organizations:write, phone:call, phone:read, phone:text, phone_numbers:read, phone_numbers:write, prompts:read, prompts:write, sessions:read, sessions:write, tests:read, tests:write, tools:execute, tools:read, tools:write, webhooks:read, webhooks:write, workspaces:read, workspaces:write; runtime: knowledge:read, sessions:read, tools:execute, tools:read; ci: agents:read, api_keys:read, calls:read, deploy:read, evals:read, integrations:read, knowledge:read, models:read, organizations:read, phone:read, phone_numbers:read, prompts:read, sessions:read, tests:read, tools:read, webhooks:read, workspaces:read; service: agents:read, api_keys:read, calls:read, calls:write, deploy:read, evals:read, integrations:read, knowledge:read, models:read, organizations:read, phone:read, phone_numbers:read, prompts:read, sessions:read, sessions:write, tests:read, tools:read, webhooks:read, workspaces:read; admin: agents:publish, agents:read, agents:write, api_keys:read, api_keys:write, calls:read, calls:write, deploy:read, evals:read, evals:write, integrations:read, integrations:write, knowledge:read, knowledge:write, models:read, organizations:read, organizations:write, phone:call, phone:read, phone:text, phone_numbers:read, phone_numbers:write, prompts:read, prompts:write, sessions:read, sessions:write, tests:read, tests:write, tools:execute, tools:read, tools:write, webhooks:read, webhooks:write, workspaces:read, workspaces:write"}}, "headers": {"X-Request-Id": {"schema": {"type": "string"}, "description": "Correlation id on every response."}, "X-RateLimit-Limit": {"schema": {"type": "integer"}}, "X-RateLimit-Remaining": {"schema": {"type": "integer"}}, "X-RateLimit-Reset": {"schema": {"type": "integer"}, "description": "Unix seconds."}, "Retry-After": {"schema": {"type": "integer"}, "description": "Seconds, on 429."}, "Idempotent-Replayed": {"schema": {"type": "boolean"}}, "X-Sempera-Signature": {"schema": {"type": "string"}, "description": "t=<unix>,v1=<hex HMAC-SHA256 over '<t>.<body>'>"}}}, "x-sempera": {"pagination": {"style": "cursor", "query": ["limit", "cursor"], "response": ["data", "has_more", "next_cursor"]}, "errors": ["AGENT_ENV_UNPINNED", "CALL_RL_PLAN_ALLOWANCE", "CALL_RL_PLAN_CONCURRENCY", "CALL_RL_PLAN_DAILY", "CALL_RL_PLAN_DAILY_MINUTES", "CALL_RL_PLAN_HOURLY", "PHONE_AGENT_UNPINNED", "PHONE_APPROVAL_EXPIRED", "PHONE_APPROVAL_INVALID", "PHONE_APPROVAL_REQUIRED", "PHONE_COST_UNKNOWN", "PHONE_DESTINATION_BLOCKED", "PHONE_FUNDING_NOT_LIVE", "PHONE_NUMBER_MISSING", "PHONE_OUTSIDE_HOURS", "PHONE_PLAN_INACTIVE", "PHONE_RECIPIENT_OPTED_OUT", "SMS_RL_PLAN_ALLOWANCE", "SMS_RL_PLAN_DAILY", "SMS_RL_PLAN_HOURLY", "authentication_required", "capability_unavailable", "conflict", "credits_exhausted", "credits_unavailable", "csrf_failed", "forbidden", "gone", "idempotency_key_reused", "insufficient_scope", "internal_error", "invalid_credential", "method_not_allowed", "not_found", "owner_setup_required", "payload_too_large", "provider_failed", "provider_timeout", "rate_limited", "service_unavailable", "validation_failed", "workspace_suspended"], "rate_limits": {"per_key_per_minute": 600, "anonymous_per_ip_per_minute": 60}, "webhook_signature": {"header": "X-Sempera-Signature", "algorithm": "HMAC-SHA256", "signed": "{t}.{raw_body}", "tolerance_seconds": 300}, "realtime": {"transport": "realtime-media", "asyncapi": null, "note": "Sessions hand the browser a short-lived token for a realtime media connection; the wire protocol belongs to that media client library, not to Sempera, so no Sempera AsyncAPI document exists."}, "llms_txt": "https://api.sempera.org/llms.txt"}}