{"openapi":"3.1.0","info":{"title":"Platform API","description":"Management API for the Amigo platform. Provides CRUD operations for workspaces, API keys, and resources.","version":"1.0.0"},"paths":{"/v1/workspaces/{workspace_id}":{"get":{"tags":["Workspaces"],"summary":"Get a workspace","description":"Retrieve a workspace by ID. Requires `Workspace.view` permission.","operationId":"get-workspace","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"404":{"description":"Workspace not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"patch":{"tags":["Workspaces"],"summary":"Update a workspace","description":"Update workspace fields. Requires `Workspace.update` permission.","operationId":"update-workspace","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkspaceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"404":{"description":"Workspace not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/workspaces":{"get":{"tags":["Workspaces"],"summary":"List workspaces","description":"List workspaces accessible to this API key. Requires `Workspace.view` permission.","operationId":"list-workspaces","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_WorkspaceResponse_"}}}},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/workspaces/{workspace_id}/provision":{"post":{"tags":["Workspaces"],"summary":"Provision workspace resources","description":"Seed default integrations and mark workspace as provisioned. Idempotent. Requires `Workspace.update` permission.","operationId":"provision-workspace","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionResponse"}}}},"404":{"description":"Workspace not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/workspaces/{workspace_id}/archive":{"post":{"tags":["Workspaces"],"summary":"Archive a workspace","description":"Archive a workspace and remove it from active access flows while preserving underlying data. Requires owner access and slug confirmation.","operationId":"archive-workspace","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveWorkspaceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"404":{"description":"Workspace not found."},"403":{"description":"Only owners can archive a workspace."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Workspace slug confirmation did not match."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/workspaces/{workspace_id}/environment-check":{"get":{"tags":["Workspaces"],"summary":"Pre-check environment conversion","description":"Returns compliance warnings for converting between staging and production. Does not mutate.","operationId":"check-environment-conversion","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"target","in":"query","required":false,"schema":{"enum":["production","staging"],"type":"string","default":"production","title":"Target"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentCheckResponse"}}}},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/workspaces/{workspace_id}/convert-environment":{"post":{"tags":["Workspaces"],"summary":"Convert workspace environment","description":"Convert workspace between staging and production. Requires slug confirmation.","operationId":"convert-workspace-environment","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertEnvironmentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"404":{"description":"Workspace not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Workspace slug confirmation did not match."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/workspaces/{workspace_id}/test-caller-numbers":{"get":{"tags":["Workspaces"],"summary":"Get test caller numbers","description":"Get phone numbers configured as test callers for this workspace.","operationId":"get-test-caller-numbers","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCallerNumbersResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"put":{"tags":["Workspaces"],"summary":"Update test caller numbers","description":"Set phone numbers to be treated as test callers. Calls from these numbers will have direction='test' and be excluded from outbound EHR sync.","operationId":"update-test-caller-numbers","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCallerNumbersRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCallerNumbersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/me/workspaces":{"post":{"tags":["Account"],"summary":"Create a workspace under the authenticated identity","description":"Create a new workspace and attach the authenticated caller as the owner.","operationId":"create-my-workspace","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceResponse"}}}},"409":{"description":"Workspace slug already taken."},"403":{"description":"Missing the workspaces:write scope (developer grant) or unsupported principal type."},"503":{"description":"Identity service unavailable."},"422":{"description":"Invalid request body."}}}},"/v1/{workspace_id}/api-keys":{"post":{"tags":["API Keys"],"summary":"Create an API key","description":"Create a new API key for a workspace. The response includes the plaintext `api_key` — store it securely, it cannot be retrieved again.","operationId":"create-api-key","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"403":{"description":"Insufficient permissions or requested role exceeds caller access."},"422":{"description":"Invalid request body or role."},"401":{"description":"Missing or invalid API key."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["API Keys"],"summary":"List API keys","description":"List all API keys for a workspace with pagination. Requires `ApiKey.view` permission.","operationId":"list-api-keys","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"mine_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Mine Only"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_ApiKeyResponse_"}}}},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/api-keys/{key_id}":{"delete":{"tags":["API Keys"],"summary":"Delete an API key","description":"Revoke an API key. Requires `ApiKey.delete` permission.","operationId":"delete-api-key","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"API key not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/api-keys/{key_id}/rotate":{"post":{"tags":["API Keys"],"summary":"Rotate an API key","description":"Replace an API key secret in one step. The old secret stops working immediately, and the response includes the new plaintext `api_key` exactly once.","operationId":"rotate-api-key","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateApiKeyRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyResponse"}}}},"404":{"description":"API key not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/skills":{"post":{"tags":["Skills"],"summary":"Create a skill","description":"Create a new companion agent skill in a workspace. Requires `Skill.create` permission.","operationId":"create-skill","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSkillRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillResponse"}}}},"401":{"description":"Missing or invalid API key."},"403":{"description":"Insufficient permissions."},"429":{"description":"Rate limited."},"422":{"description":"Invalid request body."},"404":{"description":"Workspace not found."},"409":{"description":"Skill slug already taken or conflicts with a built-in tool name."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Skills"],"summary":"List skills","description":"List skills for a workspace with pagination. Optionally filter by enabled status. Requires `Skill.view` permission.","operationId":"list-skills","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"enabled","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SearchString"},{"type":"null"}],"title":"Search"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_SkillResponse_"}}}},"401":{"description":"Missing or invalid API key."},"403":{"description":"Insufficient permissions."},"429":{"description":"Rate limited."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/skills/{skill_id}":{"get":{"tags":["Skills"],"summary":"Get a skill","description":"Retrieve a skill by ID. Requires `Skill.view` permission.","operationId":"get-skill","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillResponse"}}}},"401":{"description":"Missing or invalid API key."},"403":{"description":"Insufficient permissions."},"429":{"description":"Rate limited."},"404":{"description":"Skill not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Skills"],"summary":"Update a skill","description":"Update a skill's configuration in place.\n\n**Field semantics.** Omitted fields and explicit ``null`` are treated identically — both leave the existing value unchanged. Empty-string is rejected with 422 for fields that carry a ``minLength`` bound (``model``). Clearing a previously-set optional value back to ``null`` is not currently supported via PUT.\n\nRequires `Skill.update` permission.","operationId":"update-skill","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Skill Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSkillRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillResponse"}}}},"401":{"description":"Missing or invalid API key."},"403":{"description":"Insufficient permissions."},"429":{"description":"Rate limited."},"422":{"description":"Invalid request body."},"404":{"description":"Skill not found."}}},"delete":{"tags":["Skills"],"summary":"Delete a skill","description":"Delete a skill.\n\n**Not idempotent.** A second concurrent caller racing the same delete will receive ``404 Not Found`` once the row is gone — clients should treat 404 as success-equivalent for cleanup workflows. Requires `Skill.delete` permission.","operationId":"delete-skill","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Skill Id"}}],"responses":{"204":{"description":"Successful Response"},"401":{"description":"Missing or invalid API key."},"403":{"description":"Insufficient permissions."},"429":{"description":"Rate limited."},"404":{"description":"Skill not found."},"409":{"description":"Skill is referenced by one or more context graphs."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/skills/{skill_id}/references":{"get":{"tags":["Skills"],"summary":"Get skill references","description":"Find all HSMs and services that reference this skill's slug in their latest version's tool_call_specs. Requires `Skill.view` permission.","operationId":"get-skill-references","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Skill Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillReferencesResponse"}}}},"401":{"description":"Missing or invalid API key."},"403":{"description":"Insufficient permissions."},"429":{"description":"Rate limited."},"404":{"description":"Skill not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/skills/{skill_id}/test":{"post":{"tags":["Skills"],"summary":"Test a skill","description":"Execute a skill in isolation with the given input.","operationId":"test-skill","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"skill_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Skill Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSkillRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestSkillResponse"}}}},"404":{"description":"Skill not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/integrations":{"post":{"tags":["Integrations"],"summary":"Create a REST integration","description":"Create a new REST integration in a workspace. Endpoints are added separately via `POST /integrations/{integration_id}/endpoints`. Requires `Integration.create` permission.","operationId":"create-integration","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__integrations__create_integration__Request"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestIntegrationResponse"}}}},"404":{"description":"Workspace not found."},"409":{"description":"Integration name already taken in this workspace."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Integrations"],"summary":"List integrations","description":"List every integration for a workspace. Optionally filter by `enabled` or `search` (name/display_name/id ilike). Sort via repeated `sort_by` query params; each entry is `+field` or `-field` (allowed fields: name, created_at, updated_at). Default: `-created_at`. Cursor opaque — round-trip `continuation_token` unchanged with the same `sort_by`. Requires `Integration.view` permission.","operationId":"list-integrations","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"enabled","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter to integrations with this enabled flag. None matches both.","title":"Enabled"},"description":"Filter to integrations with this enabled flag. None matches both."},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SearchString"},{"type":"null"}],"description":"Substring match against name, display_name, or id (case-insensitive).","title":"Search"},"description":"Substring match against name, display_name, or id (case-insensitive)."},{"name":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Sort axes. Repeated query param stacks left-to-right. Each entry is `+field` or `-field`\n(direction prefix REQUIRED). Allowed fields: ``name``, ``created_at``, ``updated_at``.\nDefault: ``-created_at``. ``id`` is always appended as the final tiebreaker.","default":[],"title":"Sort By"},"description":"Sort axes. Repeated query param stacks left-to-right. Each entry is `+field` or `-field`\n(direction prefix REQUIRED). Allowed fields: ``name``, ``created_at``, ``updated_at``.\nDefault: ``-created_at``. ``id`` is always appended as the final tiebreaker."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"description":"The maximum number of integrations to return.","default":50,"title":"Limit"},"description":"The maximum number of integrations to return."},{"name":"continuation_token","in":"query","required":false,"schema":{"description":"Opaque token from a prior response. Pass back unchanged with the same `sort_by` to advance.","title":"Continuation Token"},"description":"Opaque token from a prior response. Pass back unchanged with the same `sort_by` to advance."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__integrations__list_integrations__Response"}}}},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Query parameter failed validation or continuation_token is unparseable."}}}},"/v1/{workspace_id}/integrations/approvals/{conversation_id}/approve":{"post":{"tags":["Integrations"],"summary":"Approve a pending integration-write approval","description":"Approve a pending human-in-the-loop integration-write approval for a conversation. Publishes `integration.approval_granted` to the workspace event channel; the subscribed text session fires the gated write. Requires `ReviewQueue.review` permission.","operationId":"approve-integration-write","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationApprovalResponse"}}}},"404":{"description":"Conversation not found in this workspace."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"429":{"description":"Rate limited."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/integrations/approvals/{conversation_id}/reject":{"post":{"tags":["Integrations"],"summary":"Reject a pending integration-write approval","description":"Reject a pending human-in-the-loop integration-write approval for a conversation. Publishes `integration.approval_rejected` to the workspace event channel; the subscribed text session declines the gated write. Requires `ReviewQueue.review` permission.","operationId":"reject-integration-write","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationRejectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationApprovalResponse"}}}},"404":{"description":"Conversation not found in this workspace."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"429":{"description":"Rate limited."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/integrations/{integration_id}":{"get":{"tags":["Integrations"],"summary":"Get an integration","description":"Retrieve an integration by ID. Requires `Integration.view` permission.","operationId":"get-integration","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestIntegrationResponse"}}}},"404":{"description":"Integration not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Integrations"],"summary":"Update a REST integration","description":"Patch a REST integration. NOT NULL fields reject `null` at validation time; pass `auth: null` to clear the auth config. `auth` and `secret_value` are independent — update either alone to swap auth shape (reusing the existing secret) or rotate the secret (keeping the existing auth shape). Requires `Integration.update` permission.","operationId":"update-integration","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__integrations__update_integration__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestIntegrationResponse"}}}},"404":{"description":"Integration not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body, NOT NULL field set to null, or no fields to update."}}},"delete":{"tags":["Integrations"],"summary":"Delete a REST integration","description":"Delete a REST integration. Requires `Integration.delete` permission.","operationId":"delete-integration","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Integration not found."},"409":{"description":"Integration referenced by one or more skills."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/integrations/{integration_id}/endpoints":{"post":{"tags":["Integrations"],"summary":"Add an endpoint","description":"Add a new endpoint to a REST integration. Requires `Integration.update` permission.","operationId":"create-integration-endpoint","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__integrations__create_endpoint__Request"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointResponse"}}}},"404":{"description":"Integration not found."},"409":{"description":"Endpoint name already exists on this integration."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body."}}},"get":{"tags":["Integrations"],"summary":"List endpoints","description":"List endpoints on a REST integration. Optionally search by name/description. Sort via repeated `sort_by` query params; each entry is `+field` or `-field` (allowed fields: name, created_at, updated_at). Default: `-created_at`. Cursor opaque — round-trip `continuation_token` unchanged with the same `sort_by`. Requires `Integration.view` permission.","operationId":"list-integration-endpoints","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SearchString"},{"type":"null"}],"description":"Substring match against name or description (case-insensitive).","title":"Search"},"description":"Substring match against name or description (case-insensitive)."},{"name":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Sort axes. Repeated query param stacks left-to-right. Each entry is `+field` or `-field`\n(direction prefix REQUIRED). Allowed fields: ``name``, ``created_at``, ``updated_at``.\nDefault: ``-created_at``. ``id`` is always appended as the final tiebreaker.","default":[],"title":"Sort By"},"description":"Sort axes. Repeated query param stacks left-to-right. Each entry is `+field` or `-field`\n(direction prefix REQUIRED). Allowed fields: ``name``, ``created_at``, ``updated_at``.\nDefault: ``-created_at``. ``id`` is always appended as the final tiebreaker."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"description":"The maximum number of endpoints to return.","default":50,"title":"Limit"},"description":"The maximum number of endpoints to return."},{"name":"continuation_token","in":"query","required":false,"schema":{"description":"Opaque token from a prior response. Pass back unchanged with the same `sort_by` to advance.","title":"Continuation Token"},"description":"Opaque token from a prior response. Pass back unchanged with the same `sort_by` to advance."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__integrations__list_endpoints__Response"}}}},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Query parameter failed validation or continuation_token is unparseable."}}}},"/v1/{workspace_id}/integrations/{integration_id}/endpoints/{endpoint_id}":{"get":{"tags":["Integrations"],"summary":"Get an endpoint","description":"Get a single endpoint on a REST integration. Requires `Integration.view` permission.","operationId":"get-integration-endpoint","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}},{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointResponse"}}}},"404":{"description":"Endpoint not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Integrations"],"summary":"Update an endpoint","description":"Patch an endpoint on a REST integration. The endpoint `name` is immutable. Pass `response_template: null` to clear the Jinja template (the only DB-nullable column). Every other field rejects explicit null at validation time. Requires `Integration.update` permission.","operationId":"update-integration-endpoint","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}},{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__integrations__update_endpoint__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndpointResponse"}}}},"404":{"description":"Endpoint not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body, NOT NULL field set to null, or no fields to update."}}},"delete":{"tags":["Integrations"],"summary":"Delete an endpoint","description":"Delete an endpoint from a REST integration. Requires `Integration.update` permission.","operationId":"delete-integration-endpoint","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}},{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Endpoint not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/integrations/{integration_id}/endpoints/{endpoint_id}/test":{"post":{"tags":["Integrations"],"summary":"Test an integration endpoint","description":"Execute an integration endpoint with test parameters and return the full response pipeline breakdown. Requires `Integration.view` permission.","operationId":"test-integration-endpoint","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}},{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Endpoint Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__integrations__test_endpoint__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__integrations__test_endpoint__Response"}}}},"404":{"description":"Integration or endpoint not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/external-integrations":{"post":{"tags":["External Integrations"],"summary":"Create External Integration","operationId":"create-external-integration","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalIntegrationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalIntegrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["External Integrations"],"summary":"List External Integrations","operationId":"list-external-integrations","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SearchString"},{"type":"null"}],"title":"Search"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"default":"-created_at","title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_ExternalIntegrationResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/external-integrations/{integration_id}":{"get":{"tags":["External Integrations"],"summary":"Get External Integration","operationId":"get-external-integration","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalIntegrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["External Integrations"],"summary":"Update external integration","description":"Updates external integration metadata. Supports partial updates for `name`, `display_name`, and `description`; pass `description: null` to clear the description. Requires an admin or owner role with `ExternalIntegration.update` permission.","operationId":"update-external-integration","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalIntegrationUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalIntegrationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["External Integrations"],"summary":"Delete external integration","description":"Soft-deletes an active external integration by marking it inactive, then revokes any active client credentials for that integration in the same workspace-scoped transaction. Requires an admin or owner role with `ExternalIntegration.delete` and `ApiKey.delete` permissions.","operationId":"delete-external-integration","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/external-integrations/{integration_id}/credentials":{"post":{"tags":["External Integrations"],"summary":"Create External Integration Credential","operationId":"create-external-integration-credential","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalIntegrationCredentialRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalIntegrationCredentialSecretResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["External Integrations"],"summary":"List External Integration Credentials","operationId":"list-external-integration-credentials","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExternalIntegrationCredentialResponse"},"title":"Response List-External-Integration-Credentials"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/external-integrations/{integration_id}/credentials/{credential_id}/rotate":{"post":{"tags":["External Integrations"],"summary":"Rotate External Integration Credential","operationId":"rotate-external-integration-credential","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}},{"name":"credential_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Credential Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalIntegrationCredentialSecretResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/external-integrations/{integration_id}/credentials/{credential_id}":{"delete":{"tags":["External Integrations"],"summary":"Revoke External Integration Credential","operationId":"revoke-external-integration-credential","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"integration_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Integration Id"}},{"name":"credential_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Credential Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/conversations":{"post":{"tags":["conversations"],"summary":"Create a new text conversation","operationId":"create_conversation_v1__workspace_id__conversations_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConversationRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["conversations"],"summary":"List all conversations (voice + text)","operationId":"list_conversations_v1__workspace_id__conversations_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"channel_kind","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/ChannelKind"},{"type":"null"}],"description":"Filter by channel","title":"Channel Kind"},"description":"Filter by channel"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["active","closed","completed","in-progress","failed"],"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/conversations/{conversation_id}":{"get":{"tags":["conversations"],"summary":"Get conversation detail (voice or text)","operationId":"get_conversation_v1__workspace_id__conversations__conversation_id__get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"include_tool_calls","in":"query","required":false,"schema":{"type":"boolean","description":"Include per-turn tool_calls[] in the returned turns. Off by default so the payload stays small and (potentially PHI-bearing) tool output is opt-in, matching POST /turns?include_tool_calls=true.","default":false,"title":"Include Tool Calls"},"description":"Include per-turn tool_calls[] in the returned turns. Off by default so the payload stays small and (potentially PHI-bearing) tool output is opt-in, matching POST /turns?include_tool_calls=true."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["conversations"],"summary":"Close a conversation","operationId":"close_conversation_v1__workspace_id__conversations__conversation_id__delete","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/conversations/{conversation_id}/turns":{"post":{"tags":["conversations"],"summary":"Send a message and get the agent's response","description":"Send a user message and receive the agent's response. Set `Accept: text/event-stream` to receive an SSE stream of typed `TurnStreamEvent` frames (token, tool_call_started, tool_call_completed, thinking, message, done, error) instead of the synchronous JSON response. For new integrations prefer `POST /turns/stream`, which is always SSE.","operationId":"create_turn_v1__workspace_id__conversations__conversation_id__turns_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"include_tool_calls","in":"query","required":false,"schema":{"type":"boolean","description":"Include tool call details in response","default":false,"title":"Include Tool Calls"},"description":"Include tool call details in response"},{"name":"poll","in":"query","required":false,"schema":{"type":"boolean","description":"Poll for background results without sending a user message. Drains any background tool calls that completed since the last turn and reports them; returns empty output when nothing is pending. Must NOT be combined with a request-body ``message`` (422) or SSE streaming (422). Poll no more than once every ~5s per conversation — each poll loads session state.","default":false,"title":"Poll"},"description":"Poll for background results without sending a user message. Drains any background tool calls that completed since the last turn and reports them; returns empty output when nothing is pending. Must NOT be combined with a request-body ``message`` (422) or SSE streaming (422). Poll no more than once every ~5s per conversation — each poll loads session state."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnResponse"}},"text/event-stream":{"schema":{"$ref":"#/components/schemas/TurnStreamEvent"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/conversations/{conversation_id}/turns/stream":{"post":{"tags":["conversations"],"summary":"Send a message and receive a streamed agent response","description":"Streaming variant of `POST /turns`. Always returns `text/event-stream` regardless of the `Accept` header — no JSON fallback. Each frame is a `TurnStreamEvent` discriminated by the `event` field (token, tool_call_started, tool_call_completed, thinking, message, done, error). Use this endpoint for new integrations; the `Accept`-sniffing variant remains for backward compatibility.","operationId":"create_turn_stream_v1__workspace_id__conversations__conversation_id__turns_stream_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Conversation Id"}},{"name":"include_tool_calls","in":"query","required":false,"schema":{"type":"boolean","description":"Include tool_call_started / tool_call_completed frames in the stream","default":false,"title":"Include Tool Calls"},"description":"Include tool_call_started / tool_call_completed frames in the stream"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnRequest"}}}},"responses":{"200":{"description":"SSE stream of TurnStreamEvent frames","content":{"application/json":{"schema":{}},"text/event-stream":{"schema":{"$ref":"#/components/schemas/TurnStreamEvent"}}}},"404":{"description":"Conversation or service not found"},"409":{"description":"Conversation is closed"},"422":{"description":"Conversation is missing or has corrupt service binding"},"503":{"description":"Agent service unavailable"}}}},"/v1/{workspace_id}/use-cases":{"post":{"tags":["Use Cases"],"summary":"Create a channel use case","description":"Create a voice or email use case. Body is a discriminated union on the `channel` field. Requires Channel.create permission.","operationId":"create-use-case","requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/VoiceUseCaseRequest"},{"$ref":"#/components/schemas/EmailUseCaseRequest"}],"discriminator":{"propertyName":"channel","mapping":{"outbound_voice":"#/components/schemas/VoiceUseCaseRequest","inbound_voice":"#/components/schemas/VoiceUseCaseRequest","ringless_voicemail":"#/components/schemas/VoiceUseCaseRequest","email":"#/components/schemas/EmailUseCaseRequest"}},"title":"Body"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UseCaseResponse"}}}},"404":{"description":"Setup not found."},"409":{"description":"Use case already exists or setup not approved."},"403":{"description":"Insufficient permissions."},"502":{"description":"Channel manager unavailable."},"504":{"description":"Channel manager timed out."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Use Cases"],"summary":"List channel use cases","description":"List use cases with optional filters by entity_name, channel, setup_id. Requires Channel.view permission.","operationId":"list-use-cases","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Name"}},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"enum":["outbound_voice","inbound_voice","ringless_voicemail","email"],"type":"string"},{"type":"null"}],"title":"Channel"}},{"name":"setup_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Setup Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UseCaseListResponse"}}}},"403":{"description":"Insufficient permissions."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/use-cases/{use_case_id}":{"delete":{"tags":["Use Cases"],"summary":"Delete a channel use case","description":"Delete a use case. Refuses (409) while any service still binds the use case — call DELETE `/use-cases/{id}/service-binding` first. Also refuses if a Twilio use case still has phone-number assignments. Requires Channel.delete permission.","operationId":"delete-use-case","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Use case not found."},"409":{"description":"Use case is bound to a service, or still has active phone assignments."},"403":{"description":"Insufficient permissions."},"502":{"description":"Channel manager unavailable."},"504":{"description":"Channel manager timed out."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/use-cases/{use_case_id}/service-binding":{"put":{"tags":["Use Cases"],"summary":"Bind a use case to a platform service","description":"Bind this use case to a platform service in the current workspace. PUT semantics — rebinding to a different service replaces the prior binding. Inbound webhook events for the use case will resolve to this workspace; outbound dispatch from the service will route through this use case for its channel. 409 if a different use case already binds the same (service, channel) pair. 404 if the service or use case is missing or belongs to another workspace. Requires Channel.create permission.","operationId":"bind-use-case-to-service","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceBindingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceBindingResponse"}}}},"404":{"description":"Use case or service not found."},"409":{"description":"Service already has a different use case bound for this channel."},"422":{"description":"Unsupported use case channel."},"403":{"description":"Insufficient permissions."},"502":{"description":"Channel manager unavailable."},"504":{"description":"Channel manager timed out."}}},"delete":{"tags":["Use Cases"],"summary":"Unbind a use case from its platform service","description":"Release a use case from its bound service in this workspace. Soft-delete on the binding row. 404 if the use case is not currently bound (covers both 'never bound' and 'already unbound'). Requires Channel.delete permission.","operationId":"unbind-use-case-from-service","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Use case is not bound to a service in this workspace."},"403":{"description":"Insufficient permissions."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Use Cases"],"summary":"Get the service binding for a use case","description":"Return the platform service this use case is bound to in this workspace, or 404 if unbound. Requires Channel.view permission.","operationId":"get-use-case-service-binding","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"use_case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Use Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceBindingResponse"}}}},"404":{"description":"Use case is not bound to a service in this workspace."},"403":{"description":"Insufficient permissions."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/channels/ses-setup":{"post":{"tags":["Channels"],"summary":"Create an SES setup","description":"Create an SES tenant + verified email identity. Returns the DNS records the customer must publish (DKIM CNAMEs, MX, DMARC TXT). Subsequent ``GET`` or ``POST /verify`` calls re-run the live DNS lookup and update the per-record ``verified`` flag. Setups are shared platform-wide; any caller with ``Channel.create`` permission can create one.","operationId":"create-ses-setup","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSesSetupRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SesSetupDetailResponse"}}}},"409":{"description":"Tenant name or domain identity already exists upstream."},"422":{"description":"Invalid SES setup configuration."},"403":{"description":"Insufficient permissions."},"502":{"description":"Channel manager unavailable."},"504":{"description":"Channel manager timed out."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Channels"],"summary":"List SES setups","description":"Paginated list of every SES setup on the platform. Items carry the cached ``dns_verified`` aggregate; call ``GET /ses-setup/{id}`` for per-record DNS detail. Setups are shared platform-wide; any caller with ``Channel.view`` permission sees the full list.","operationId":"list-ses-setups","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_SesSetupListItemResponse_"}}}},"403":{"description":"Insufficient permissions."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/channels/ses-setup/{setup_id}":{"get":{"tags":["Channels"],"summary":"Get an SES setup with live DNS refresh","description":"Returns full SES setup detail including per-record DNS verification status. Channel-manager re-runs ``GetEmailIdentity`` + DMARC/MX resolvers on every call, so each GET is a live check. Requires ``Channel.view`` permission.","operationId":"get-ses-setup","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SesSetupDetailResponse"}}}},"404":{"description":"SES setup not found."},"403":{"description":"Insufficient permissions."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Channels"],"summary":"Delete an SES setup","description":"Tear down the upstream SES tenant + identity. Refuses (409) if any use case still references the setup. Requires ``Channel.delete`` permission.","operationId":"delete-ses-setup","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"SES setup not found."},"409":{"description":"Setup still referenced by live use cases."},"403":{"description":"Insufficient permissions."},"502":{"description":"Channel manager unavailable."},"504":{"description":"Channel manager timed out."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/channels/ses-setup/{setup_id}/verify":{"post":{"tags":["Channels"],"summary":"Refresh SES DNS verification","description":"Explicit DNS refresh endpoint. Equivalent to ``GET /ses-setup/{id}`` but exposed as a POST so UI ``Verify now`` actions read as actions rather than reads. Requires ``Channel.view`` permission.","operationId":"verify-ses-setup-dns","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"setup_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Setup Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SesSetupDetailResponse"}}}},"404":{"description":"SES setup not found."},"403":{"description":"Insufficient permissions."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/tables":{"get":{"tags":["Workspace Tables"],"summary":"List Workspace Tables","operationId":"list-workspace-tables","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__workspace_tables__list_workspace_tables__Response"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"post":{"tags":["Workspace Tables"],"summary":"Create Workspace Table","operationId":"create-workspace-table","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__workspace_tables__create_workspace_table__Request"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__workspace_tables__create_workspace_table__Response"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/tables/{table_id}":{"get":{"tags":["Workspace Tables"],"summary":"Get Workspace Table","operationId":"get-workspace-table","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"table_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Table Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__workspace_tables__get_workspace_table__Response"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Workspace Tables"],"summary":"Update Workspace Table","operationId":"update-workspace-table","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"table_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Table Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__workspace_tables__update_workspace_table__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__workspace_tables__update_workspace_table__Response"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Workspace Tables"],"summary":"Delete Workspace Table","operationId":"delete-workspace-table","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"table_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Table Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/query":{"post":{"tags":["Workspace Tables"],"summary":"Execute Workspace Query","operationId":"execute-workspace-query","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__workspace_tables__execute_workspace_query__Request"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__workspace_tables__execute_workspace_query__Response"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/data_queries":{"get":{"tags":["Workspace Data Queries"],"summary":"List workspace data queries","description":"List every registered query for a workspace. Sort via repeated `sort_by` query params; each entry is `+field` or `-field` (allowed field: deployed_at). Default: `-deployed_at`. Cursor opaque — round-trip `continuation_token` unchanged with the same `sort_by`. Requires `Workspace.view` permission.","operationId":"list-workspace-data-queries","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Sort axes, applied left-to-right. ``+field`` ascending, ``-field``\ndescending. Defaults to ``[(\"deployed_at\", -1)]`` (newest first).","default":[],"title":"Sort By"},"description":"Sort axes, applied left-to-right. ``+field`` ascending, ``-field``\ndescending. Defaults to ``[(\"deployed_at\", -1)]`` (newest first)."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"description":"Maximum number of queries to return per page.","default":50,"title":"Limit"},"description":"Maximum number of queries to return per page."},{"name":"continuation_token","in":"query","required":false,"schema":{"description":"Opaque continuation token from a prior response. Treat as a\nblack box — the server decodes it.","title":"Continuation Token"},"description":"Opaque continuation token from a prior response. Treat as a\nblack box — the server decodes it."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__workspace_data_queries__list_workspace_data_queries__Response"}}}},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Query parameter failed validation or continuation_token is unparseable."}}},"post":{"tags":["Workspace Data Queries"],"summary":"Create Workspace Data Query","operationId":"create-workspace-data-query","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__workspace_data_queries__create_workspace_data_query__Request"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDataQueryItem"}}}},"409":{"description":"A workspace data query with the given name already exists"},"422":{"description":"Validation or precondition failure"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/data_queries/{query_id}":{"get":{"tags":["Workspace Data Queries"],"summary":"Get Workspace Data Query","operationId":"get-workspace-data-query","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"query_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Query Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDataQueryItem"}}}},"404":{"description":"Workspace data query not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Workspace Data Queries"],"summary":"Update Workspace Data Query","operationId":"update-workspace-data-query","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"query_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Query Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__workspace_data_queries__update_workspace_data_query__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceDataQueryItem"}}}},"404":{"description":"Workspace data query not found"},"409":{"description":"A workspace data query with the given name already exists"},"422":{"description":"Validation failure"}}},"delete":{"tags":["Workspace Data Queries"],"summary":"Delete Workspace Data Query","operationId":"delete-workspace-data-query","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"query_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Query Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Workspace data query not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/data_queries/{query_id}/invoke":{"post":{"tags":["Workspace Data Queries"],"summary":"Invoke Workspace Data Query","operationId":"invoke-workspace-data-query","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"query_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Query Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__workspace_data_queries__invoke_workspace_data_query__Request"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__workspace_data_queries__invoke_workspace_data_query__Response"}}}},"404":{"description":"Workspace data query not found"},"503":{"description":"Execution failed"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/config/client":{"get":{"tags":["Config"],"summary":"Get client configuration","description":"Return client-safe configuration for the authenticated workspace.","operationId":"get-client-config","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientConfigResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/agents":{"post":{"tags":["Agents"],"summary":"Create an agent","description":"Create a new agent in a workspace. Requires `Agent.create` permission.","operationId":"create-agent","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"404":{"description":"Not found."},"409":{"description":"Name already taken."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Agents"],"summary":"List agents","description":"List agents in a workspace with pagination. Requires `Agent.view` permission.","operationId":"list-agents","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SearchString"},{"type":"null"}],"title":"Search"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_AgentResponse_"}}}},"404":{"description":"Not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/agents/{agent_id}":{"get":{"tags":["Agents"],"summary":"Get an agent","description":"Retrieve an agent by ID. Requires `Agent.view` permission.","operationId":"get-agent","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"404":{"description":"Not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Agents"],"summary":"Update an agent","description":"Update an agent's name or description. Requires `Agent.update` permission.","operationId":"update-agent","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentResponse"}}}},"404":{"description":"Not found."},"409":{"description":"Name already taken."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body."}}},"delete":{"tags":["Agents"],"summary":"Delete an agent","description":"Delete an agent. Agent versions are retained. Requires `Agent.delete` permission.","operationId":"delete-agent","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/agents/{agent_id}/versions":{"post":{"tags":["Agents"],"summary":"Create an agent version","description":"Create a new version of an agent. Version number is auto-incremented. Requires `Agent.create` permission for the first version and `Agent.update` permission afterward.","operationId":"create-agent-version","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentVersionRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionResponse"}}}},"404":{"description":"Not found."},"409":{"description":"Name already taken."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body."}}},"get":{"tags":["Agents"],"summary":"List agent versions","description":"List versions of an agent with pagination. Requires `Agent.view` permission.","operationId":"list-agent-versions","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_AgentVersionResponse_"}}}},"404":{"description":"Not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/agents/{agent_id}/versions/{version}":{"get":{"tags":["Agents"],"summary":"Get an agent version","description":"Retrieve a specific agent version by number, or 'latest'. Requires `Agent.view` permission.","operationId":"get-agent-version","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"agent_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Agent Id"}},{"name":"version","in":"path","required":true,"schema":{"anyOf":[{"type":"integer"},{"type":"string"}],"title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionResponse"}}}},"404":{"description":"Not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/context-graphs":{"post":{"tags":["Context Graphs"],"summary":"Create a context graph","description":"Create a new context graph in a workspace. Requires `ContextGraph.create` permission.","operationId":"create-context_graph","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContextGraphRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextGraphResponse"}}}},"404":{"description":"Not found."},"409":{"description":"Name already taken."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Context Graphs"],"summary":"List context graphs","description":"List context graphs in a workspace with pagination. Requires `ContextGraph.view` permission.","operationId":"list-context_graphs","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SearchString"},{"type":"null"}],"title":"Search"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_ContextGraphResponse_"}}}},"404":{"description":"Not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/context-graphs/{context_graph_id}":{"get":{"tags":["Context Graphs"],"summary":"Get a context graph","description":"Retrieve a context graph by ID. Requires `ContextGraph.view` permission.","operationId":"get-context_graph","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"context_graph_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Context Graph Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextGraphResponse"}}}},"404":{"description":"Not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Context Graphs"],"summary":"Update a context graph","description":"Update a context graph's name or description. Requires `ContextGraph.update` permission.","operationId":"update-context_graph","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"context_graph_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Context Graph Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContextGraphRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextGraphResponse"}}}},"404":{"description":"Not found."},"409":{"description":"Name already taken."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body."}}},"delete":{"tags":["Context Graphs"],"summary":"Delete a context graph","description":"Delete a context graph. context graph versions are retained. Requires `ContextGraph.delete` permission.","operationId":"delete-context_graph","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"context_graph_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Context Graph Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/context-graphs/{context_graph_id}/versions":{"post":{"tags":["Context Graphs"],"summary":"Create a context graph version","description":"Create a new version of a context graph. Version number is auto-incremented. Requires `ContextGraph.create` permission for the first version and `ContextGraph.update` permission afterward.","operationId":"create-context_graph-version","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"context_graph_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Context Graph Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContextGraphVersionRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextGraphVersionResponse"}}}},"404":{"description":"Not found."},"409":{"description":"Name already taken."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body."}}},"get":{"tags":["Context Graphs"],"summary":"List context graph versions","description":"List versions of a context graph with pagination. Requires `ContextGraph.view` permission.","operationId":"list-context_graph-versions","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"context_graph_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Context Graph Id"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_ContextGraphVersionResponse_"}}}},"404":{"description":"Not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/context-graphs/{context_graph_id}/versions/{version}":{"get":{"tags":["Context Graphs"],"summary":"Get a context graph version","description":"Retrieve a specific context graph version by number, or 'latest'. Requires `ContextGraph.view` permission.","operationId":"get-context_graph-version","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"context_graph_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Context Graph Id"}},{"name":"version","in":"path","required":true,"schema":{"anyOf":[{"type":"integer"},{"type":"string"}],"title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextGraphVersionResponse"}}}},"404":{"description":"Not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/services":{"post":{"tags":["Services"],"summary":"Create a service","description":"Create a new service linking an agent and HSM. Validates that agent_id and context_graph_id exist in the workspace. Requires `Service.create` permission.","operationId":"create-service","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateServiceRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceResponse"}}}},"404":{"description":"Not found."},"409":{"description":"Name already taken."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Services"],"summary":"List services","description":"List services in a workspace with pagination. Requires `Service.view` permission.","operationId":"list-services","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SearchString"},{"type":"null"}],"title":"Search"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_ServiceResponse_"}}}},"404":{"description":"Not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/services/{service_id}":{"get":{"tags":["Services"],"summary":"Get a service","description":"Retrieve a service by ID. Requires `Service.view` permission.","operationId":"get-service","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceResponse"}}}},"404":{"description":"Not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Services"],"summary":"Update a service","description":"Update a service's configuration. Requires `Service.update` permission.","operationId":"update-service","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateServiceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceResponse"}}}},"404":{"description":"Not found."},"409":{"description":"Name already taken."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body."}}},"delete":{"tags":["Services"],"summary":"Delete a service","description":"Delete a service. Requires `Service.delete` permission.","operationId":"delete-service","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Not found."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/services/{service_id}/version-sets/{name}":{"put":{"tags":["Services"],"summary":"Upsert a service version set","description":"Replace or create a named version set on a service. Pinned agent/HSM versions are validated.","operationId":"upsert-service-version-set","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id"}},{"name":"name","in":"path","required":true,"schema":{"type":"string","maxLength":40,"description":"Version set name (e.g. 'release')","title":"Name"},"description":"Version set name (e.g. 'release')"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertVersionSetRequest"}}}},"responses":{"204":{"description":"Successful Response"},"404":{"description":"Not found."},"409":{"description":"Name already taken."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Invalid request body."}}}},"/v1/{workspace_id}/services/{service_id}/voice-judge/recent":{"get":{"tags":["Voice Judge"],"summary":"Recent voice-judge results for a service","description":"Returns the most recent per-call voice-judge scores for one service, ordered newest first. Produced by the Databricks `voice_judge` job (stereo audio → Gemini 2.5 Flash → 10-dimension rubric). Used by the Agent Readiness page to populate Voice Quality criterion cards.\n\n**Latency**: 500ms-2s (reads from analytics warehouse, not OLTP).\n\n**Default limit**: 20. Max 100.","operationId":"list-voice-judge-recent","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id","description":"Service UUID"},"description":"Service UUID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max rows to return (default 20, max 100)","default":20,"title":"Limit"},"description":"Max rows to return (default 20, max 100)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset for pagination (default 0)","default":0,"title":"Offset"},"description":"Offset for pagination (default 0)"}],"responses":{"200":{"description":"Voice judge rows (newest first)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceJudgeRecentResponse"}}}},"503":{"description":"Analytics warehouse not configured or transiently unavailable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/services/{service_id}/voice-turn":{"post":{"tags":["Services"],"summary":"Voice Turn","description":"Run one WhatsApp-style voice-note turn against the service's agent.\n\nAccepts OGG Opus audio (or any format Deepgram's prerecorded endpoint\naccepts). Server keys the conversation on ``(workspace, service,\nphone_number)`` and returns the agent's spoken reply as OGG Opus.","operationId":"voice-turn","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_voice-turn"}}}},"responses":{"200":{"description":"OGG Opus agent reply","content":{"application/json":{"schema":{}},"audio/ogg":{}}},"204":{"description":"Agent elected silence"},"409":{"description":"Concurrent voice turn in progress for this speaker"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/services/{service_id}/text-turn":{"post":{"tags":["Services"],"summary":"Text Turn","description":"Run one WhatsApp-style text turn against the service's agent.","operationId":"text-turn","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextTurnRequest"}}}},"responses":{"200":{"description":"Agent text reply","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextTurnResponse"}}}},"204":{"description":"Agent elected silence"},"409":{"description":"Concurrent text turn in progress for this speaker"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/fhir/status":{"get":{"tags":["FHIR"],"summary":"Get clinical data status","description":"Get event and entity counts for the workspace's clinical data.","operationId":"fhir-status","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirStatusResponse"}}}},"404":{"description":"Workspace not found."},"401":{"description":"Missing or invalid API key."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/fhir/import":{"post":{"tags":["FHIR"],"summary":"Import FHIR Bundle","description":"Import a FHIR Bundle. Decomposes supported resources into upserted world events and creates patient entities. Unsupported resource types are skipped and reported; omitted resources are not deleted.","operationId":"fhir-import","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirImportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirImportResponse"}}}},"400":{"description":"Invalid bundle format."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/fhir/import-stream":{"post":{"tags":["FHIR"],"summary":"Import FHIR resources via NDJSON streaming","description":"Stream FHIR resources as NDJSON (one resource per line). Bypasses the buffered-body size cap on /fhir/import. Callers MUST pre-resolve any bundle-internal urn:uuid: references. Unsupported resource types are skipped and reported; omitted resources are not deleted.","operationId":"fhir-import-stream","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","maxLength":128,"default":"fhir_import","title":"Source"}},{"name":"source_system","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Source System"}},{"name":"data_source_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Data Source Id"}},{"name":"dedup","in":"query","required":false,"schema":{"type":"boolean","description":"Skip identical re-uploads via content-hash dedup","default":true,"title":"Dedup"},"description":"Skip identical re-uploads via content-hash dedup"},{"name":"unsupported_resource_policy","in":"query","required":false,"schema":{"$ref":"#/components/schemas/FhirUnsupportedResourcePolicy","description":"Use 'error' to report unsupported resources, or 'skip' to skip them without errors.","default":"error"},"description":"Use 'error' to report unsupported resources, or 'skip' to skip them without errors."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirImportResponse"}}}},"400":{"description":"Stream exceeded line cap."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/fhir/views/patients":{"get":{"tags":["FHIR"],"summary":"List patients (clinical view)","description":"Frontend-ready patient list with flattened demographics, conditions, medications, allergies, and insurance. Optionally scoped to a specific data source via data_source_id.","operationId":"fhir-patients-view","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by name","title":"Q"},"description":"Search by name"},{"name":"data_source_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Scope to data source","title":"Data Source Id"},"description":"Scope to data source"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirPatientListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/fhir/views/practitioners":{"get":{"tags":["FHIR"],"summary":"List practitioners","description":"Frontend-ready practitioner list with name, NPI, specialty, phone. Optionally scoped to a data source.","operationId":"fhir-practitioners-view","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by name","title":"Q"},"description":"Search by name"},{"name":"data_source_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Scope to data source","title":"Data Source Id"},"description":"Scope to data source"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirPractitionerListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/fhir/views/locations":{"get":{"tags":["FHIR"],"summary":"List locations","description":"Frontend-ready location list with name, address, phone, hours. Optionally scoped to a data source.","operationId":"fhir-locations-view","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by name","title":"Q"},"description":"Search by name"},{"name":"data_source_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Scope to data source","title":"Data Source Id"},"description":"Scope to data source"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirLocationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/fhir/views/appointments":{"get":{"tags":["FHIR"],"summary":"List appointments","description":"Frontend-ready appointment list with date, status, patient, practitioner, location, reason. Optionally scoped to a data source.","operationId":"fhir-appointments-view","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search","title":"Q"},"description":"Search"},{"name":"data_source_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Scope to data source","title":"Data Source Id"},"description":"Scope to data source"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirAppointmentListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/fhir/views/slots":{"get":{"tags":["FHIR"],"summary":"List availability slots","description":"Frontend-ready provider availability slot list with start, end, status, schedule reference, and provider display name. Optionally scoped to a data source.","operationId":"fhir-slots-view","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search","title":"Q"},"description":"Search"},{"name":"data_source_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Scope to data source","title":"Data Source Id"},"description":"Scope to data source"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Slot status (e.g. 'free', 'busy')","title":"Status"},"description":"Slot status (e.g. 'free', 'busy')"},{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Start date YYYY-MM-DD (filters slots on or after this date)","title":"Date"},"description":"Start date YYYY-MM-DD (filters slots on or after this date)"},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Number of days forward from date (default 7)","default":7,"title":"Days"},"description":"Number of days forward from date (default 7)"},{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Provider name (partial match, e.g. 'Woloski')","title":"Provider"},"description":"Provider name (partial match, e.g. 'Woloski')"},{"name":"specialty","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Specialty (partial match, e.g. 'Psychiatry')","title":"Specialty"},"description":"Specialty (partial match, e.g. 'Psychiatry')"},{"name":"service_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Visit/service type name (partial match, e.g. 'Follow-up')","title":"Service Type"},"description":"Visit/service type name (partial match, e.g. 'Follow-up')"},{"name":"facility_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Facility ID","title":"Facility Id"},"description":"Facility ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirSlotListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/fhir/views/organizations":{"get":{"tags":["FHIR"],"summary":"List organizations","description":"Frontend-ready organization list with name, phone, domain, industry, address. Optionally scoped to a data source.","operationId":"fhir-organizations-view","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by name","title":"Q"},"description":"Search by name"},{"name":"data_source_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Scope to data source","title":"Data Source Id"},"description":"Scope to data source"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirOrganizationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/fhir/patients":{"get":{"tags":["FHIR"],"summary":"Search patients","description":"Search patient entities by name, MRN, or phone.","operationId":"fhir-patient-search","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by name, MRN, phone, or entity ID","title":"Q"},"description":"Search by name, MRN, phone, or entity ID"},{"name":"mrn","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by MRN","title":"Mrn"},"description":"Search by MRN"},{"name":"phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by phone","title":"Phone"},"description":"Search by phone"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Sort field with +/- prefix (e.g. -last_event_at)","title":"Sort By"},"description":"Sort field with +/- prefix (e.g. -last_event_at)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatientSearchResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/fhir/patients/{patient_id}/timeline":{"get":{"tags":["FHIR"],"summary":"Patient timeline","description":"Get the full event timeline for a patient entity.","operationId":"fhir-patient-timeline","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","title":"Patient Id"}},{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatientTimelineResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/fhir/patients/{patient_id}/summary":{"get":{"tags":["FHIR"],"summary":"Patient summary","description":"Get the agent-maintained world model state for a patient.","operationId":"fhir-patient-summary","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","title":"Patient Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatientSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/fhir/resources/{resource_type}":{"get":{"tags":["FHIR"],"summary":"Search FHIR resources","description":"Search FHIR resources by type with standard search parameters.","operationId":"fhir-search-resources","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"resource_type","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Resource Type"}},{"name":"_count","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":" Count"}},{"name":"_offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":" Offset"}},{"name":"name","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name"}},{"name":"identifier","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Identifier"}},{"name":"birthdate","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Birthdate"}},{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Date"}},{"name":"patient","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Patient"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Status"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"General search text","title":"Q"},"description":"General search text"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirSearchResponse"}}}},"400":{"description":"Invalid resource type."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["FHIR"],"summary":"Create a FHIR resource","description":"Create a new FHIR resource. Automatically creates patient entities.","operationId":"fhir-create-resource","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"resource_type","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Resource Type"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirWriteRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirResourceResponse"}}}},"400":{"description":"Invalid resource type or payload."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/fhir/resources/{resource_type}/{resource_id}/history":{"get":{"tags":["FHIR"],"summary":"Get FHIR resource history","description":"Fetch the version history and changed-field provenance for a FHIR resource.","operationId":"fhir-get-resource-history","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"resource_type","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Resource Type"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","maxLength":128,"title":"Resource Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirResourceHistoryResponse"}}}},"400":{"description":"Invalid resource type."},"404":{"description":"Resource not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/fhir/resources/{resource_type}/{resource_id}":{"get":{"tags":["FHIR"],"summary":"Get a FHIR resource","description":"Fetch a single FHIR resource by type and ID.","operationId":"fhir-get-resource","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"resource_type","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Resource Type"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","maxLength":128,"title":"Resource Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirResourceResponse"}}}},"400":{"description":"Invalid resource type."},"404":{"description":"Resource not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["FHIR"],"summary":"Update a FHIR resource","description":"Update a FHIR resource. Creates a new event that supersedes the old one.","operationId":"fhir-update-resource","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"resource_type","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Resource Type"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","maxLength":128,"title":"Resource Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirWriteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirResourceResponse"}}}},"400":{"description":"Invalid resource type or payload."},"404":{"description":"Resource not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/data-sources":{"post":{"tags":["Data Sources"],"summary":"Create a data source","description":"Register a new external data source in the workspace.","operationId":"create-data-source","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDataSourceRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceResponse"}}}},"401":{"description":"Missing or invalid API key."},"403":{"description":"Insufficient permissions."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Data Sources"],"summary":"List data sources","description":"List data sources for a workspace with optional filtering.","operationId":"list-data-sources","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},{"name":"source_type","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by source type (repeatable)","title":"Source Type"},"description":"Filter by source type (repeatable)"},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by name, ID, type, or sync status","title":"Search"},"description":"Search by name, ID, type, or sync status"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_DataSourceResponse_"}}}},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/data-sources/{data_source_id}":{"get":{"tags":["Data Sources"],"summary":"Get a data source","description":"Retrieve a data source by ID.","operationId":"get-data-source","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Data Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceResponse"}}}},"404":{"description":"Data source not found."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Data Sources"],"summary":"Update a data source","description":"Update a data source's configuration.","operationId":"update-data-source","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Data Source Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDataSourceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceResponse"}}}},"404":{"description":"Data source not found."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Data Sources"],"summary":"Delete a data source","description":"Delete a data source.","operationId":"delete-data-source","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Data Source Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Data source not found."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/data-sources/{data_source_id}/status":{"get":{"tags":["Data Sources"],"summary":"Get data source status","description":"Get event counts, sync status, and health for a data source.","operationId":"data-source-status","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Data Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceStatusResponse"}}}},"404":{"description":"Data source not found."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/data-sources/{data_source_id}/sync-history":{"get":{"tags":["Data Sources"],"summary":"Get data source sync history","description":"Daily event timeline + recent sync failures for a data source.","operationId":"data-source-sync-history","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Data Source Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceSyncHistoryResponse"}}}},"404":{"description":"Data source not found."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/data-sources/{data_source_id}/sync":{"post":{"tags":["Data Sources"],"summary":"Trigger a manual sync for a data source","description":"Queues a one-off poll of the data source on connector-runner. Bypasses the business-hours gate and per-resource cadence counter. Returns 202 once the request is queued; the poll itself runs asynchronously. Returns 409 if the source is already mid-sync, 503 if connector-runner is unreachable. The 409 is best-effort: the status check and trigger are separate calls, so a scheduled poll can grab the lease between them — clients should treat 409 as a UX hint, not a hard guarantee.","operationId":"trigger-data-source-sync","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Data Source Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerSyncResponse"}}}},"400":{"description":"Invalid data source ID format."},"404":{"description":"Data source not found."},"409":{"description":"Data source is already syncing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerSyncConflictResponse"}}}},"429":{"description":"Rate limit exceeded."},"503":{"description":"Connector-runner is unreachable."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/calls":{"get":{"tags":["Calls"],"summary":"List calls with filters","description":"Query call entities with date range, status, and duration filters. Enriched with quality_score and final_state from call_intelligence.","operationId":"list-calls","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Start date (inclusive)","title":"Date From"},"description":"Start date (inclusive)"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"End date (inclusive)","title":"Date To"},"description":"End date (inclusive)"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by call status","title":"Status"},"description":"Filter by call status"},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by direction (inbound, outbound, playground, simulated)","title":"Direction"},"description":"Filter by direction (inbound, outbound, playground, simulated)"},{"name":"min_duration","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Minimum duration in seconds","title":"Min Duration"},"description":"Minimum duration in seconds"},{"name":"max_duration","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Maximum duration in seconds","title":"Max Duration"},"description":"Maximum duration in seconds"},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by service ID","title":"Service Id"},"description":"Filter by service ID"},{"name":"include_simulated","in":"query","required":false,"schema":{"type":"boolean","description":"Include simulated sessions","default":false,"title":"Include Simulated"},"description":"Include simulated sessions"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"continuation_token","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Alias for offset (pagination cursor)","title":"Continuation Token"},"description":"Alias for offset (pagination cursor)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/calls/active/intelligence":{"get":{"tags":["Calls"],"summary":"Active calls with live intelligence","description":"Real-time active call list enriched with per-turn emotion, risk, and quality data from Valkey. Proxied from voice-agent.","operationId":"list-active-calls-intelligence","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List-Active-Calls-Intelligence"}}}},"503":{"description":"Voice agent not configured"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/calls/phone-volume":{"get":{"tags":["Calls"],"summary":"Call volume per phone number","description":"Aggregated call counts and durations grouped by phone number.","operationId":"get-phone-call-volume","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PhoneNumberCallVolume"},"title":"Response Get-Phone-Call-Volume"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/calls/benchmarks":{"get":{"tags":["Calls"],"summary":"Workspace call quality benchmarks","description":"Aggregate quality benchmarks for the workspace. Used by call detail to show 'vs workspace average' and by call list for quality context.","operationId":"get-call-benchmarks","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Lookback period in days","default":30,"title":"Days"},"description":"Lookback period in days"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceBenchmarks"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/calls/{call_id}/intelligence":{"get":{"tags":["Calls"],"summary":"Call intelligence profile (Layer 4 narrative)","description":"Aggregated intelligence for a completed call: quality breakdown, key moments, and summaries. Per-turn visualization lives on the unified timeline (call detail endpoint → timeline.segments).","operationId":"get-call-intelligence","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallIntelligenceDetail"}}}},"404":{"description":"Intelligence data not found for this call"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/calls/traces":{"get":{"tags":["Calls"],"summary":"List trace analyses","description":"Paginated list of trace analyses for the workspace. Use this instead of paginating `/calls` and fetching traces one-by-one (N+1).","operationId":"list-call-traces","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"outcome","in":"query","required":false,"schema":{"anyOf":[{"enum":["succeeded","partially","failed","abandoned"],"type":"string"},{"type":"null"}],"description":"Filter by overall outcome","title":"Outcome"},"description":"Filter by overall outcome"},{"name":"min_computed_at","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only include analyses computed at or after this time","title":"Min Computed At"},"description":"Only include analyses computed at or after this time"},{"name":"max_computed_at","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Only include analyses computed strictly before this time","title":"Max Computed At"},"description":"Only include analyses computed strictly before this time"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"description":"Max rows per page (1-100)","default":20,"title":"Limit"},"description":"Max rows per page (1-100)"},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Offset from the previous page (0 for the first page)","default":0,"title":"Continuation Token"},"description":"Offset from the previous page (0 for the first page)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TraceAnalysisListResponse"}}}},"503":{"description":"Analytics warehouse not configured"},"502":{"description":"Analytics warehouse query failed"},"422":{"description":"Invalid query parameters"}}}},"/v1/{workspace_id}/calls/outbound":{"post":{"tags":["Calls"],"summary":"Create an outbound call","description":"Initiate an outbound voice call from a workspace phone number. Provide either phone_from (direct caller ID) or use_case_id (channel-manager selects the optimal number). Supports idempotency via the idempotency_key field.","operationId":"create-outbound-call","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOutboundCallRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOutboundCallResponse"}}}},"400":{"description":"Invalid phone number format"},"404":{"description":"No phone number available for use case"},"403":{"description":"phone_from does not belong to this workspace"},"503":{"description":"Voice agent, outbound calls, or channel manager not configured"},"429":{"description":"Rate limit exceeded"},"504":{"description":"Channel manager phone selection timed out"},"502":{"description":"Upstream Twilio or voice agent error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/calls/{call_id}/trace-analysis":{"get":{"tags":["Calls"],"summary":"Deep call understanding","description":"Audio-native intelligence for a completed call: emotional arc, key decision moments with causal attribution, counterfactual reasoning, and actionable coaching. Produced by the Amigo intelligence pipeline from the raw call recording.\n\n**Latency**: 500ms-2s (reads from analytics warehouse, not transactional store).\n\n**Status values**: `ready` = analysis complete, `pending` = call completed but analysis queued (retry in 30 minutes), `unavailable` = no recording or analysis transiently unavailable (retry later).","operationId":"get-call-trace-analysis","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"call_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","title":"Call Id"}}],"responses":{"200":{"description":"Analysis ready or status indicating progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TraceAnalysisResponse"}}}},"404":{"description":"Call not found in this workspace"},"503":{"description":"Analytics warehouse not configured"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/calls/{call_id}/metrics":{"get":{"tags":["Calls"],"summary":"Call metric values","description":"Latest per-call realtime metric values for the call detail sidebar.","operationId":"list-call-metric-values","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"call_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","title":"Call Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max metric values to return","default":100,"title":"Limit"},"description":"Max metric values to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/calls/{call_id}/timeline":{"get":{"tags":["Calls"],"summary":"Call playback timeline","description":"Canonical playback timeline for the call detail visualization. This is the same strongly typed timeline model embedded in the call detail response, exposed directly for timeline-only consumers.","operationId":"get-call-timeline","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"call_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaybackTimeline"}}}},"404":{"description":"Call not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/calls/{call_id}":{"get":{"tags":["Calls"],"summary":"Call detail","description":"Full call detail including turns, escalation state, safety state, and recording info. Proxied from voice-agent, with simulation session fallback.","operationId":"get-call-detail","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallDetailResponse"}}}},"404":{"description":"Call not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/sessions/active":{"get":{"tags":["Sessions"],"summary":"List active voice sessions","description":"Real-time list of active voice sessions from Valkey (cross-pod).","operationId":"list_active_sessions_v1__workspace_id__sessions_active_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ActiveSession"},"type":"array","title":"Response List Active Sessions V1  Workspace Id  Sessions Active Get"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/sessions/{call_sid}/inject":{"post":{"tags":["Sessions"],"summary":"Inject event into active session","description":"Inject an external event or guidance message into an active voice session. The agent incorporates it into its next response. Use event_type='guidance' for operator coaching, 'external_event' for system notifications.","operationId":"inject_session_event_v1__workspace_id__sessions__call_sid__inject_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"call_sid","in":"path","required":true,"schema":{"type":"string","title":"Call Sid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InjectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InjectResponse"}}}},"404":{"description":"Session not found."},"503":{"description":"Voice agent service unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/sessions/start":{"post":{"tags":["Sessions"],"summary":"Start a web text conversation session with an entity","description":"Start a web text session with a world model entity. Materializes the conversation and returns conversation_id for subsequent turns via POST /v1/{ws}/conversations/{id}/turns.","operationId":"start_text_session_v1__workspace_id__sessions_start_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSessionRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartSessionResponse"}}}},"404":{"description":"Service or entity not found."},"503":{"description":"Agent service unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/review-queue":{"get":{"tags":["Review Queue"],"summary":"List review queue items","description":"Returns review items with rich filtering and sorting.","operationId":"list_review_items_v1__workspace_id__review_queue_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"}},{"name":"priority","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"}},{"name":"reason","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},{"name":"assigned_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created After"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Before"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string","default":"asc","title":"Sort Order"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_ReviewItemResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/review-queue/stats":{"get":{"tags":["Review Queue"],"summary":"Review queue statistics","operationId":"review_stats_v1__workspace_id__review_queue_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewStatsResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/review-queue/dashboard":{"get":{"tags":["Review Queue"],"summary":"Review queue dashboard composite","description":"Aggregated view for the review queue page: stats, priority breakdown, recent completions.","operationId":"review_dashboard_v1__workspace_id__review_queue_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewDashboardResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/review-queue/trends":{"get":{"tags":["Review Queue"],"summary":"Review queue trends over time","description":"Daily buckets: queue depth, completion rate, avg review time.","operationId":"review_trends_v1__workspace_id__review_queue_trends_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Review Trends V1  Workspace Id  Review Queue Trends Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/review-queue/performance":{"get":{"tags":["Review Queue"],"summary":"Per-reviewer performance stats","description":"Items reviewed, avg time, approval/reject/correct ratio per reviewer.","operationId":"reviewer_performance_v1__workspace_id__review_queue_performance_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reviewer Performance V1  Workspace Id  Review Queue Performance Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/review-queue/history":{"get":{"tags":["Review Queue"],"summary":"Review history / audit trail","description":"Returns completed review items for auditing. Filter by action, reviewer, and date range.","operationId":"review_history_v1__workspace_id__review_queue_history_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"}},{"name":"reviewed_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewed By"}},{"name":"completed_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed After"}},{"name":"completed_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed Before"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_ReviewItemResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/review-queue/my-queue":{"get":{"tags":["Review Queue"],"summary":"Items assigned to current API key","operationId":"my_queue_v1__workspace_id__review_queue_my_queue_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_ReviewItemResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/review-queue/{item_id}":{"get":{"tags":["Review Queue"],"summary":"Get review item with full context","description":"Returns review item with inline event data and entity state — no extra calls needed.","operationId":"get_review_item_v1__workspace_id__review_queue__item_id__get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewItemResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/review-queue/{item_id}/correction-schema":{"get":{"tags":["Review Queue"],"summary":"Get correction form schema hints","description":"Returns expected fields for the FHIR resource type, plus current event data as defaults.","operationId":"get_correction_schema_v1__workspace_id__review_queue__item_id__correction_schema_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorrectionSchemaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/review-queue/{item_id}/diff":{"get":{"tags":["Review Queue"],"summary":"Get event diff for a corrected review item","description":"Shows original event data vs corrected event data side-by-side.","operationId":"get_review_diff_v1__workspace_id__review_queue__item_id__diff_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewDiffResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/review-queue/{item_id}/approve":{"post":{"tags":["Review Queue"],"summary":"Approve review item","description":"Marks the review item approved and lets SDP projections rebuild entity state.","operationId":"approve_review_item_v1__workspace_id__review_queue__item_id__approve_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewItemResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/review-queue/{item_id}/reject":{"post":{"tags":["Review Queue"],"summary":"Reject review item","description":"Marks the review item rejected and lets SDP projections rebuild entity state.","operationId":"reject_review_item_v1__workspace_id__review_queue__item_id__reject_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewItemResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/review-queue/{item_id}/correct":{"post":{"tags":["Review Queue"],"summary":"Submit corrected data","description":"Creates a corrected event and lets SDP projections rebuild entity state.","operationId":"correct_review_item_v1__workspace_id__review_queue__item_id__correct_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorrectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewItemResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/review-queue/{item_id}/claim":{"post":{"tags":["Review Queue"],"summary":"Claim a review item","description":"Assigns the review item to the current API key, preventing concurrent reviews.","operationId":"claim_review_item_v1__workspace_id__review_queue__item_id__claim_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/review-queue/{item_id}/unclaim":{"post":{"tags":["Review Queue"],"summary":"Release a claimed review item","description":"Clears assignment — only the current claimant can unclaim.","operationId":"unclaim_review_item_v1__workspace_id__review_queue__item_id__unclaim_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"item_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Item Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/review-queue/batch-approve":{"post":{"tags":["Review Queue"],"summary":"Batch approve review items","description":"Approves multiple items in one call. Each item is processed independently.","operationId":"batch_approve_v1__workspace_id__review_queue_batch_approve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchApproveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/review-queue/batch-reject":{"post":{"tags":["Review Queue"],"summary":"Batch reject review items","description":"Rejects multiple items in one call. Each item is processed independently.","operationId":"batch_reject_v1__workspace_id__review_queue_batch_reject_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchRejectRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchActionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/operators/dashboard":{"get":{"tags":["Operators"],"summary":"Operator dashboard overview","description":"Live dashboard with operator status counts, active escalation queue, and today's escalation statistics.","operationId":"operator-dashboard","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/operators/performance":{"get":{"tags":["Operators"],"summary":"Operator performance summary","description":"Aggregate performance across all operators with per-operator breakdown.","operationId":"operator-performance-summary","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerformanceSummaryResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/operators/escalations/active":{"get":{"tags":["Operators"],"summary":"List active escalations","description":"List calls with active escalations (status: requested or connected).","operationId":"list-active-escalations","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_ActiveEscalationItem_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/operators/escalations/stats":{"get":{"tags":["Operators"],"summary":"Escalation statistics","description":"Aggregated escalation statistics over a time period.","operationId":"escalation-stats","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"period","in":"query","required":false,"schema":{"enum":["day","week","month"],"type":"string","description":"Time period: day, week, or month.","default":"day","title":"Period"},"description":"Time period: day, week, or month."},{"name":"group_by","in":"query","required":false,"schema":{"enum":["status","trigger","operator"],"type":"string","description":"Grouping dimension: status, trigger, or operator.","default":"status","title":"Group By"},"description":"Grouping dimension: status, trigger, or operator."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscalationStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/operators/escalations":{"get":{"tags":["Operators"],"summary":"List escalation events","description":"List escalation lifecycle events for a workspace.","operationId":"list-escalations","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_EscalationEventResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/operators/audit-log":{"get":{"tags":["Operators"],"summary":"Query audit log","description":"Query audit events (operator actions) for a workspace.","operationId":"list-audit-log","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"operator_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by operator entity UUID.","title":"Operator Id"},"description":"Filter by operator entity UUID."},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"enum":["operator.registered","operator.status_changed","operator.profile_updated","operator.joined_call","operator.mode_changed","operator.mode_switched","operator.left_call","operator.access_token_generated","operator.guidance_sent","operator.wrap_up","operator.viewed_transcript"],"type":"string"},{"type":"null"}],"description":"Filter by exact operator audit event type.","title":"Action"},"description":"Filter by exact operator audit event type."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_AuditEventResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/operators/calls/{call_sid}/transcript":{"get":{"tags":["Operators"],"summary":"Get call transcript","description":"Per-speaker transcript segments from operator takeover sessions.","operationId":"get-call-transcript","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"call_sid","in":"path","required":true,"schema":{"type":"string","title":"Call Sid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallTranscriptResponse"}}}},"404":{"description":"Call not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/operators/queue":{"get":{"tags":["Operators"],"summary":"Priority-ranked operator queue","description":"Active calls ranked by operator priority: risk, wait time, emotion, loops, and safety concerns.","operationId":"get-operator-queue","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriorityQueueResponse"}}}},"429":{"description":"Rate limit exceeded."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/operators/{operator_id}/briefing":{"post":{"tags":["Operators"],"summary":"Generate operator briefing","description":"Structured briefing for an operator about to join a call. Template-rendered from call intelligence and entity context.","operationId":"create-operator-briefing","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Operator Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefingResponse"}}}},"400":{"description":"Invalid operator_id."},"429":{"description":"Rate limit exceeded."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/operators/{operator_id}/join-call":{"post":{"tags":["Operators"],"summary":"Join active call as operator","description":"Add operator to an active call's Twilio Conference.","operationId":"operator-join-call","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Operator Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinCallRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinCallResponse"}}}},"404":{"description":"Operator or active call not found."},"409":{"description":"Operator is already on a call."},"503":{"description":"Voice agent service unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/operators/{operator_id}/leave-call":{"post":{"tags":["Operators"],"summary":"Remove operator from active call","description":"Remove operator from an active call's Twilio Conference.","operationId":"operator-leave-call","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Operator Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaveCallRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeaveCallResponse"}}}},"404":{"description":"Operator or active call not found."},"503":{"description":"Voice agent service unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/operators/{operator_id}/access-token":{"post":{"tags":["Operators"],"summary":"Generate browser audio access token","description":"Generate a Twilio AccessToken with VoiceGrant for browser-based operator audio.","operationId":"operator-access-token","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Operator Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessTokenRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessTokenResponse"}}}},"404":{"description":"Operator or active call not found."},"503":{"description":"Browser audio not configured or voice agent unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/operators/{operator_id}/switch-mode":{"post":{"tags":["Operators"],"summary":"Toggle operator listen/takeover mode","description":"Switch between listen mode and takeover mode.","operationId":"operator-switch-mode","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Operator Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchModeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchModeResponse"}}}},"404":{"description":"Operator not found."},"503":{"description":"Voice agent service unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/operators/{operator_id}/send-guidance":{"post":{"tags":["Operators"],"summary":"Send text guidance to agent during call","description":"Inject operator guidance into an active call. The agent incorporates it into its next response.","operationId":"operator-send-guidance","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Operator Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendGuidanceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendGuidanceResponse"}}}},"404":{"description":"Operator or active call not found."},"503":{"description":"Voice agent service unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/operators/{operator_id}/wrap-up":{"post":{"tags":["Operators"],"summary":"Record operator intervention wrap-up","description":"Persist the outcome and notes from an operator's call intervention.","operationId":"operator-wrap-up","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Operator Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WrapUpRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WrapUpResponse"}}}},"404":{"description":"Operator not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/operators":{"post":{"tags":["Operators"],"summary":"Register an operator","description":"Create an operator entity with profile and initial offline status.","operationId":"create-operator","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOperatorRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorResponse"}}}},"401":{"description":"Missing or invalid API key."},"403":{"description":"Insufficient permissions."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Operators"],"summary":"List operators","description":"List all operator entities for a workspace.","operationId":"list-operators","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_OperatorResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/operators/{operator_id}":{"get":{"tags":["Operators"],"summary":"Get an operator","description":"Get operator entity with computed state (profile, availability, performance).","operationId":"get-operator","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Operator Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorResponse"}}}},"404":{"description":"Operator not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Operators"],"summary":"Update an operator","description":"Update operator profile fields or status. Each change writes a world event.","operationId":"update-operator","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"operator_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Operator Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOperatorRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorResponse"}}}},"404":{"description":"Operator not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/entities/{entity_id}/graph":{"get":{"tags":["Entity Intelligence"],"summary":"Get Entity Graph","description":"Entity relationship graph — one level of edges with neighbor metadata.","operationId":"get-entity-graph","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Entity-Graph"}}}},"404":{"description":"Entity not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/entities/{entity_id}/provenance":{"get":{"tags":["Entity Intelligence"],"summary":"Get Entity Provenance","description":"Data lineage for an entity — sources, confidence history, merge history.","operationId":"get-entity-provenance","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Entity-Provenance"}}}},"404":{"description":"Entity not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/entities/{entity_id}/lineage":{"get":{"tags":["Entity Intelligence"],"summary":"Get Entity Lineage","description":"Full data lineage — provenance + outbound sinks + review history.","operationId":"get-entity-lineage","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Entity-Lineage"}}}},"404":{"description":"Entity not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/entities/duplicates":{"get":{"tags":["Entity Intelligence"],"summary":"Get Entity Duplicates","description":"Suspected duplicate entities — same_as edges sorted by confidence.","operationId":"get-entity-duplicates","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type","title":"Entity Type"},"description":"Filter by entity type"},{"name":"confidence_max","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0.0,"description":"Max confidence threshold","default":1.0,"title":"Confidence Max"},"description":"Max confidence threshold"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max edges to return","default":100,"title":"Limit"},"description":"Max edges to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Page offset","default":0,"title":"Offset"},"description":"Page offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response Get-Entity-Duplicates"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/search":{"get":{"tags":["Entity Intelligence"],"summary":"Search Entities","description":"Enhanced entity search with type, source, and confidence filters.","operationId":"search-world-entities","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"q","in":"query","required":true,"schema":{"type":"string","description":"Search text (matched against display_name)","title":"Q"},"description":"Search text (matched against display_name)"},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type","title":"Entity Type"},"description":"Filter by entity type"},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by event source","title":"Source"},"description":"Filter by event source"},{"name":"confidence_min","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"description":"Min confidence","title":"Confidence Min"},"description":"Min confidence"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Search-World-Entities"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/dashboard":{"get":{"tags":["World"],"summary":"World model dashboard composite","description":"Composite world health dashboard — entity counts by type, event velocity (24h/7d), average confidence, and source breakdown. All computation server-side.","operationId":"world-dashboard","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorldDashboardResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/world/entity-types":{"get":{"tags":["World"],"summary":"List entity types","description":"Returns distinct entity types in the workspace with counts and projection availability. Powers the World Explorer's auto-discovery of new entity types created by agents (L4 self-extending schema).","operationId":"list-entity-types","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityTypeRegistryResponse"}}}},"401":{"description":"Missing or invalid API key."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/world/event-types":{"get":{"tags":["World"],"summary":"List event types","description":"Returns distinct event types in the workspace with counts, domains, and source breakdown. Enables the World Explorer to show what kinds of events flow through the world model.","operationId":"list-event-types","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventTypeRegistryResponse"}}}},"401":{"description":"Missing or invalid API key."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/world/entity-stats":{"get":{"tags":["World"],"summary":"Entity stats with sync breakdown","description":"Aggregate stats for entities including sync status breakdown (pending, synced, failed). Filter by entity_type to get stats for a specific type (e.g. appointment, patient). Generic — works for any entity type in the Liquid World Model.","operationId":"entity-stats","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type","title":"Entity Type"},"description":"Filter by entity type"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityStatsSummary"}}}},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/connectors":{"get":{"tags":["World"],"summary":"Connected data sources overview","description":"All active data sources with entity counts by type, sync status, and health. Powers the EHR/FHIR connector cards in the frontend. Each item includes connector_type (charmhealth, fhir_store) and a breakdown of entities by type (patient, practitioner, etc.).","operationId":"connector-overview","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorOverviewResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/world/connectors/{data_source_id}/entities":{"get":{"tags":["World"],"summary":"List entities from a data source","description":"Paginated entity list from a specific connected data source. Filter by entity_type and search by display name. Uses EXISTS subquery on events.data_source_id for accurate scoping.","operationId":"connector-entities","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Data Source Id"}},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type","title":"Entity Type"},"description":"Filter by entity type"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by display name","title":"Q"},"description":"Search by display name"},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"enum":["+display_name","-display_name","+last_event_at","-last_event_at"],"type":"string"},{"type":"null"}],"description":"Sort order: `+display_name` (default) or `-display_name` for alphabetical, `+last_event_at` for oldest activity first, `-last_event_at` for most recent first. All sort orders use entity id as a final tiebreaker for stable pagination.","title":"Sort By"},"description":"Sort order: `+display_name` (default) or `-display_name` for alphabetical, `+last_event_at` for oldest activity first, `-last_event_at` for most recent first. All sort orders use entity id as a final tiebreaker for stable pagination."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityListResponse"}}}},"400":{"description":"Invalid data source ID format."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/connectors/{data_source_id}/resources":{"get":{"tags":["World"],"summary":"Search FHIR resources from a data source","description":"FHIR resource search scoped to a specific data source. Returns raw FHIR resource data (Condition, MedicationRequest, Coverage, etc.) from the specified connector. Powers the per-connector clinical resource tables (FHIR Store tab, EHR tab).","operationId":"connector-resources","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Data Source Id"}},{"name":"resource_type","in":"query","required":true,"schema":{"type":"string","description":"FHIR resource type (e.g. Patient, Condition, MedicationRequest)","title":"Resource Type"},"description":"FHIR resource type (e.g. Patient, Condition, MedicationRequest)"},{"name":"_count","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":" Count"}},{"name":"_offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":" Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorResourcesResponse"}}}},"400":{"description":"Invalid data source ID or resource type."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/source-breakdown":{"get":{"tags":["World"],"summary":"Entity counts by source system","description":"Breakdown of entity counts by source system (e.g. charmhealth, gcp_fhir, voice_agent). Powers the EHR/FHIR view in the frontend. Filter by entity_type (e.g. person, place) for focused views.","operationId":"source-breakdown","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type","title":"Entity Type"},"description":"Filter by entity type"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceBreakdownResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/sync/by-sink":{"get":{"tags":["World"],"summary":"Outbound sync status per data source","description":"Multi-sink outbound sync progress. Shows total/synced/failed/pending counts per data source for workspaces with multiple outbound sinks.","operationId":"outbound-sync-by-sink","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundSyncBySinkResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/world/entities/{entity_id}/enrichment/{key}":{"put":{"tags":["World"],"summary":"Set an enrichment value on an entity","description":"Writes a single per-key entity.enriched event for the given entity. Validates against the workspace's enrichment_keys registry — unknown key, wrong value type, enum violation, or confidence below the key's floor all return 400. SDP picks winners by confidence class.","operationId":"put-entity-enrichment","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[a-z0-9][a-z0-9_\\-]*$","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichmentWriteBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichmentValueResponse"}}}},"400":{"description":"Registry validation failed."},"404":{"description":"Entity not found."},"403":{"description":"Insufficient permissions."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/entities/{entity_id}/enrichment":{"get":{"tags":["World"],"summary":"List current enrichment values for an entity","description":"Current winners per (entity, key) from world.entity_enrichment_out_synced (Synced-Table-populated view of SDP's entity_enrichment_out). Each row carries value, value_type, confidence, source, effective_at.","operationId":"list-entity-enrichment","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max enrichment rows","default":200,"title":"Limit"},"description":"Max enrichment rows"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Page offset","default":0,"title":"Offset"},"description":"Page offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichmentListResponse"}}}},"404":{"description":"Entity not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/entities/{entity_id}/enrichment/{key}/history":{"get":{"tags":["World"],"summary":"Enrichment supersedes chain for audit","description":"Returns every entity.enriched event for (entity, key), newest first, including superseded entries. Each entry carries the full provenance: source, confidence, effective_at, supersedes pointer, is_current flag.","operationId":"get-entity-enrichment-history","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[a-z0-9][a-z0-9_\\-]*$","title":"Key"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichmentHistoryResponse"}}}},"404":{"description":"Entity not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/enrichment-keys":{"post":{"tags":["World"],"summary":"Register an enrichment key","description":"Registers a new (entity_type, key) in this workspace's enrichment key registry. Future writes against this key will pass validation. value_type governs what values are accepted; enum types require allowed_values.","operationId":"create-enrichment-key","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichmentKeyCreateBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichmentKeyResponse"}}}},"400":{"description":"Invalid request body."},"409":{"description":"Key already exists for (entity_type, key)."},"403":{"description":"Insufficient permissions."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["World"],"summary":"List enrichment keys registered for this workspace","description":"Optionally filter by entity_type.","operationId":"list-enrichment-keys","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type.","title":"Entity Type"},"description":"Filter by entity type."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"description":"Max keys to return","default":200,"title":"Limit"},"description":"Max keys to return"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Page offset","default":0,"title":"Offset"},"description":"Page offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichmentKeyListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/enrichment-keys/{key_id}":{"patch":{"tags":["World"],"summary":"Update a registered enrichment key","description":"Update allowed_values, source_hint, description, min_confidence, or is_pii. key and value_type are immutable.","operationId":"patch-enrichment-key","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichmentKeyPatchBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichmentKeyResponse"}}}},"404":{"description":"Enrichment key not found."},"403":{"description":"Insufficient permissions."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["World"],"summary":"Delete a registered enrichment key","description":"Existing entity.enriched events are not deleted (append-only); only future writes against this key will be rejected.","operationId":"delete-enrichment-key","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Enrichment key not found."},"403":{"description":"Insufficient permissions."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/entities":{"get":{"tags":["World"],"summary":"List entities","description":"List entities filtered by type with optional name search. Works for any entity type — patients, operators, calls, or any type created by T3 agents. Returns full projected state.","operationId":"list-entities","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by entity type (repeatable)","title":"Entity Type"},"description":"Filter by entity type (repeatable)"},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by name, type, canonical ID, phone, or entity ID","title":"Q"},"description":"Search by name, type, canonical ID, phone, or entity ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"description":"Sort order (PostgREST-style, e.g. last_event_at.desc, display_name.asc)","title":"Order"},"description":"Sort order (PostgREST-style, e.g. last_event_at.desc, display_name.asc)"},{"name":"has_projection","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by has_projection flag","title":"Has Projection"},"description":"Filter by has_projection flag"},{"name":"source","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by event source (e.g. voice_agent, connector_runner)","title":"Source"},"description":"Filter by event source (e.g. voice_agent, connector_runner)"},{"name":"source_system","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by source system name (e.g. charmhealth, gcp_fhir)","title":"Source System"},"description":"Filter by source system name (e.g. charmhealth, gcp_fhir)"},{"name":"fhir_resource_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Filter by FHIR resource type (e.g. Patient, Practitioner)","title":"Fhir Resource Type"},"description":"Filter by FHIR resource type (e.g. Patient, Practitioner)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityListResponse"}}}},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/entities/resolve":{"post":{"tags":["World"],"summary":"Resolve entity by identifier","description":"Polymorphic identifier → ranked entity candidates. Accepts any subset of {phone, email, canonical_id, external_id, entity_id} plus a required ``entity_type``. Uses indexed lookups (phone, email, canonical_id) and the external_ids GIN index — sub-10ms for single-identifier queries on warm pods. Returns matches ranked by confidence + number of identifiers matched.","operationId":"resolve-entity","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityResolveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityResolveResponse"}}}},"400":{"description":"No identifier provided or invalid input."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/world/entities/{entity_id}":{"get":{"tags":["World"],"summary":"Get entity","description":"Fetch a single entity with its full projected state. The state is a computed projection from all events — never mutated directly. Enhanced entity types (patient, operator, call) have richer projections.","operationId":"get-entity","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityResponse"}}}},"400":{"description":"Invalid entity ID format."},"404":{"description":"Entity not found."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/entities/{entity_id}/timeline":{"get":{"tags":["World"],"summary":"Entity timeline","description":"Get the event timeline for an entity — all current events ordered by effective date. The entity's state is always a projection of these events. Filter by domain (clinical, operational, audit, etc.).","operationId":"get-entity-timeline","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id"}},{"name":"domain","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by domain","title":"Domain"},"description":"Filter by domain"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityTimelineResponse"}}}},"400":{"description":"Invalid entity ID format."},"404":{"description":"Entity not found."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/entities/{entity_id}/relationships":{"get":{"tags":["World"],"summary":"Entity relationships","description":"Get relationships for an entity — links to other entities in the knowledge graph. Filter by relationship type.","operationId":"get-entity-relationships","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id"}},{"name":"relationship","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by relationship type","title":"Relationship"},"description":"Filter by relationship type"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityRelationshipsResponse"}}}},"400":{"description":"Invalid entity ID format."},"404":{"description":"Entity not found."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/world/entities/{entity_id}/merged":{"get":{"tags":["World"],"summary":"Get merged entities (same_as links)","description":"Returns entities linked via same_as edges — cross-source merges where different data sources refer to the same real-world entity.","operationId":"merged-entities","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergedEntitiesResponse"}}}},"400":{"description":"Invalid entity ID format."},"404":{"description":"Entity not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/query/{schema}/{table}":{"get":{"tags":["Data Query"],"summary":"Query Table","description":"Query a table with PostgREST-style filtering, sorting, and pagination.","operationId":"query_table_v1__workspace_id__query__schema___table__get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"schema","in":"path","required":true,"schema":{"type":"string","title":"Schema"}},{"name":"table","in":"path","required":true,"schema":{"type":"string","title":"Table"}},{"name":"select","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Select"}},{"name":"order","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"semantic","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Semantic search query (uses pgvector cosine similarity)","title":"Semantic"},"description":"Semantic search query (uses pgvector cosine similarity)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataQueryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/pipeline/status":{"get":{"tags":["Pipeline"],"summary":"Pipeline status","description":"Composite pipeline dashboard: connector-runner state + Lakebase counts.","operationId":"get-pipeline-status","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PipelineStatusResponse"}}}},"429":{"description":"Rate limit exceeded"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/pipeline/sources":{"get":{"tags":["Pipeline"],"summary":"List pipeline sources","description":"Data sources with live health from Valkey cr:last_poll keys.","operationId":"list-pipeline-sources","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search by name, ID, type, or health status","title":"Search"},"description":"Search by name, ID, type, or health status"},{"name":"source_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by source type","title":"Source Type"},"description":"Filter by source type"},{"name":"health_status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by health status","title":"Health Status"},"description":"Filter by health status"},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"Filter by active state","title":"Is Active"},"description":"Filter by active state"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SourceListItem"},"title":"Response List-Pipeline-Sources"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/pipeline/sources/{source_id}/overview":{"get":{"tags":["Pipeline"],"summary":"Source overview","description":"Consolidated source detail: metadata, health, recent failures, last poll, outbound summary.","operationId":"get-source-overview","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceOverviewResponse"}}}},"404":{"description":"Data source not found"},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/pipeline/sources/{source_id}/history":{"get":{"tags":["Pipeline"],"summary":"Source sync history","description":"Event counts bucketed by time window for a specific source.","operationId":"get-source-history","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Source Id"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date To"}},{"name":"interval","in":"query","required":false,"schema":{"enum":["1h","1d"],"type":"string","default":"1h","title":"Interval"}},{"name":"hours","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":720,"minimum":1},{"type":"null"}],"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SourceHistoryItem"},"title":"Response Get-Source-History"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/pipeline/sources/{source_id}/events":{"get":{"tags":["Pipeline"],"summary":"Source events","description":"Paginated events for a specific data source.","operationId":"list-source-events","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Source Id"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by event type","title":"Event Type"},"description":"Filter by event type"},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type","title":"Entity Type"},"description":"Filter by entity type"},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter events ingested on or after this time","title":"Date From"},"description":"Filter events ingested on or after this time"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter events ingested on or before this time","title":"Date To"},"description":"Filter events ingested on or before this time"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_SourceEventItem_"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/pipeline/outbound":{"get":{"tags":["Pipeline"],"summary":"Outbound sync summary","description":"Per-sink outbound sync aggregation: synced/failed/pending counts.","operationId":"get-outbound-summary","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/OutboundSinkSummary"},"type":"array","title":"Response Get-Outbound-Summary"}}}},"429":{"description":"Rate limit exceeded"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/pipeline/outbound/{data_source_id}/log":{"get":{"tags":["Pipeline"],"summary":"Outbound sync log","description":"Paginated outbound sync log for a specific sink.","operationId":"list-outbound-log","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"data_source_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Data Source Id"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["pending","synced","failed"],"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_OutboundLogItem_"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/pipeline/entity-resolution":{"get":{"tags":["Pipeline"],"summary":"Entity resolution metrics","description":"Same-as merge counts and entity resolution loop status.","operationId":"get-entity-resolution","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityResolutionMetrics"}}}},"429":{"description":"Rate limit exceeded"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/pipeline/review":{"get":{"tags":["Pipeline"],"summary":"Review pipeline metrics","description":"Review queue depth, approval rate, and average review time.","operationId":"get-review-metrics","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewMetrics"}}}},"429":{"description":"Rate limit exceeded"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/pipeline/throughput":{"get":{"tags":["Pipeline"],"summary":"Event throughput","description":"Event throughput time series across all sources.","operationId":"get-throughput","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date To"}},{"name":"interval","in":"query","required":false,"schema":{"enum":["1h","1d"],"type":"string","default":"1d","title":"Interval"}},{"name":"hours","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":720,"minimum":1},{"type":"null"}],"title":"Hours"}},{"name":"bucket_minutes","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1440,"minimum":1},{"type":"null"}],"title":"Bucket Minutes"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ThroughputBucket"},"title":"Response Get-Throughput"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/usage":{"get":{"tags":["Analytics"],"summary":"Usage Summary","description":"Usage summary grouped by event type and date.","operationId":"usage_summary_v1__workspace_id__analytics_usage_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/calls":{"get":{"tags":["Analytics"],"summary":"Call Stats","description":"Call volume and duration statistics.","operationId":"call_stats_v1__workspace_id__analytics_calls_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/events":{"get":{"tags":["Analytics"],"summary":"Event Breakdown","description":"Event volume breakdown by type and source.","operationId":"event_breakdown_v1__workspace_id__analytics_events_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventBreakdownResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/data-quality":{"get":{"tags":["Analytics"],"summary":"Data Quality Analytics","description":"Data quality metrics: confidence distribution, review pipeline stats, daily trends.","operationId":"data_quality_analytics_v1__workspace_id__analytics_data_quality_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataQualityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/dashboard":{"get":{"tags":["Analytics"],"summary":"Analytics Dashboard","description":"Composite analytics dashboard — top KPIs with period-over-period deltas.","operationId":"get-analytics-dashboard","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"description":"Period length in days","default":7,"title":"Days"},"description":"Period length in days"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Analytics-Dashboard"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/calls/advanced":{"get":{"tags":["Analytics"],"summary":"Advanced Call Stats","description":"Percentile-based call metrics: p50/p95/p99 for duration, quality, latency.","operationId":"get-advanced-call-stats","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"interval","in":"query","required":false,"schema":{"enum":["1h","1d","1w"],"type":"string","default":"1d","title":"Interval"}},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Service Id"}},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"enum":["inbound","outbound"],"type":"string"},{"type":"null"}],"description":"Filter by call direction: inbound or outbound","title":"Direction"},"description":"Filter by call direction: inbound or outbound"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Advanced-Call-Stats"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/calls/comparison":{"get":{"tags":["Analytics"],"summary":"Call Comparison","description":"Period-over-period comparison of key call metrics.","operationId":"get-call-comparison","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"current_from","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Start of current period","title":"Current From"},"description":"Start of current period"},{"name":"current_to","in":"query","required":true,"schema":{"type":"string","format":"date","description":"End of current period","title":"Current To"},"description":"End of current period"},{"name":"previous_from","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Start of previous period","title":"Previous From"},"description":"Start of previous period"},{"name":"previous_to","in":"query","required":true,"schema":{"type":"string","format":"date","description":"End of previous period","title":"Previous To"},"description":"End of previous period"},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Service Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Call-Comparison"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/call-quality":{"get":{"tags":["Analytics"],"summary":"Call Quality Analytics","description":"Call quality score trends, distribution, and summary statistics.","operationId":"get-call-quality-analytics","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"interval","in":"query","required":false,"schema":{"enum":["1h","1d","1w"],"type":"string","default":"1d","title":"Interval"}},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Service Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Call-Quality-Analytics"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/emotion-trends":{"get":{"tags":["Analytics"],"summary":"Emotion Trends","description":"Emotion distribution and valence/arousal trends.","operationId":"get-emotion-trends","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"interval","in":"query","required":false,"schema":{"enum":["1h","1d","1w"],"type":"string","default":"1d","title":"Interval"}},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Service Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Emotion-Trends"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/latency":{"get":{"tags":["Analytics"],"summary":"Latency Analytics","description":"Voice latency metrics — p50/p95/p99 by component with trends.","operationId":"get-latency-analytics","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"interval","in":"query","required":false,"schema":{"enum":["1h","1d","1w"],"type":"string","default":"1d","title":"Interval"}},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Service Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Latency-Analytics"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/tool-performance":{"get":{"tags":["Analytics"],"summary":"Tool Performance Analytics","description":"Tool execution analytics — success rates, failure trends.","operationId":"get-tool-performance","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"interval","in":"query","required":false,"schema":{"enum":["1h","1d","1w"],"type":"string","default":"1d","title":"Interval"}},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Service Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Tool-Performance"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/operator-performance":{"get":{"tags":["Analytics"],"summary":"Operator Performance Analytics","description":"Operator escalation stats and quality comparison.","operationId":"get-operator-performance","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"interval","in":"query","required":false,"schema":{"enum":["1h","1d","1w"],"type":"string","default":"1d","title":"Interval"}},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Service Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorPerformanceResponse"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/agents":{"get":{"tags":["Analytics"],"summary":"Get Agent Analytics","description":"Per-agent (service) call volume, completion rate, and avg duration.","operationId":"get-agent-analytics","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"period","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentAnalyticsResponse"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/surfaces/completion-rates":{"get":{"tags":["Analytics"],"summary":"Surface Completion Rates","description":"Surface completion rates: overall, by source, time-bucketed trend.","operationId":"get-surface-completion-rates","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"interval","in":"query","required":false,"schema":{"enum":["1h","1d","1w"],"type":"string","default":"1d","title":"Interval"}},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity ID","title":"Entity Id"},"description":"Filter by entity ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Surface-Completion-Rates"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/surfaces/channel-effectiveness":{"get":{"tags":["Analytics"],"summary":"Surface Channel Effectiveness","description":"Per-channel completion rate and average time to complete.","operationId":"get-surface-channel-effectiveness","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Surface-Channel-Effectiveness"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/surfaces/field-abandonment":{"get":{"tags":["Analytics"],"summary":"Surface Field Abandonment","description":"Field-level drop-off analysis for abandoned surfaces.","operationId":"get-surface-field-abandonment","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Surface-Field-Abandonment"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/surfaces/entity/{entity_id}":{"get":{"tags":["Analytics"],"summary":"Entity Surface History","description":"Per-entity surface history with preferred channel and completion stats.","operationId":"get-entity-surface-history","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Entity-Surface-History"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/patient-topology":{"get":{"tags":["M42"],"summary":"List Patient Topology","description":"Patient-level UMAP coordinates + predicted risk for the Self-Image scatter. Hand-seeded demo data (no ML training). Paginated.","operationId":"list_patient_topology_v1__workspace_id__m42_patient_topology_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"cluster","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}],"title":"Cluster"}},{"name":"risk_tier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":4,"minimum":0},{"type":"null"}],"title":"Risk Tier"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50000,"minimum":1,"default":10000,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatientTopologyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/district-metrics":{"get":{"tags":["M42"],"summary":"List District Metrics","description":"Per-district t2d observed vs predicted incidence, capacity gap, and unmet-demand score. Hand-seeded demo data.","operationId":"list_district_metrics_v1__workspace_id__m42_district_metrics_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DistrictMetricsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/anomaly-alerts":{"get":{"tags":["M42"],"summary":"List Anomaly Alerts","description":"Emerging health anomalies with inline causal decomposition, recommended actions, and unacted projection. Hand-seeded demo data.","operationId":"list_anomaly_alerts_v1__workspace_id__m42_anomaly_alerts_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"severity","in":"query","required":false,"schema":{"anyOf":[{"enum":["high","medium","low"],"type":"string"},{"type":"null"}],"title":"Severity"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnomalyAlertResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/forecast-fan":{"get":{"tags":["M42"],"summary":"List Forecast Fan","description":"Forecast fan points (t, median, lower/upper 95% CI) for a named run + scenario. Used by the Sensorium observational fan and the Sims dual-envelope overlay.","operationId":"list_forecast_fan_v1__workspace_id__m42_forecast_fan_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}],"title":"Run Id"}},{"name":"scenario","in":"query","required":false,"schema":{"anyOf":[{"enum":["baseline","with_policy","observational"],"type":"string"},{"type":"null"}],"title":"Scenario"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"minimum":1,"default":1000,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastFanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/positive-signals":{"get":{"tags":["M42"],"summary":"List Positive Signals","description":"Small set of positive-trend headline metrics for the Sensorium hero strip. Hand-seeded demo data.","operationId":"list_positive_signals_v1__workspace_id__m42_positive_signals_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PositiveSignalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/anomalies/ranked":{"get":{"tags":["M42"],"summary":"List Anomalies Ranked","description":"Ranked anomalies for a single indicator (default ``t2d_risk``). Includes inline decomposition + district centroids for the map. Schema-probes the alerts table so it works pre- and post-multi-indicator pipeline expansion.","operationId":"list_anomalies_ranked_v1__workspace_id__m42_anomalies_ranked_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"indicator","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}],"title":"Indicator"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RankedAnomalyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/clusters/summary":{"get":{"tags":["M42"],"summary":"List Cluster Summary","description":"Per-cluster cohort stats — size, mean age/BMI/HbA1c, prediabetes / T2D %, predicted-risk mean. Powers the Patient Profile cluster strip.","operationId":"list_cluster_summary_v1__workspace_id__m42_clusters_summary_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/clusters/forecast":{"get":{"tags":["M42"],"summary":"List Cluster Forecast","description":"Per-cluster forecast fan points for the Patient Profile multi-line chart. ``focus_area`` defaults to T2D for backward compat.","operationId":"list_cluster_forecast_v1__workspace_id__m42_clusters_forecast_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"focus_area","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":32},{"type":"null"}],"title":"Focus Area"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"minimum":1,"default":1000,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClusterForecastResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/forecast-fan/draws":{"get":{"tags":["M42"],"summary":"List Forecast Draws","description":"Sampled subset of raw Poisson bootstrap draws (faint spaghetti curves behind the forecast fan).","operationId":"list_forecast_draws_v1__workspace_id__m42_forecast_fan_draws_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"run_id","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":128,"default":"observational-territory-t2d","title":"Run Id"}},{"name":"scenario","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":32,"default":"baseline","title":"Scenario"}},{"name":"sample","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Sample"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastDrawsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/model-registry":{"get":{"tags":["M42"],"summary":"List Model Registry","description":"Fitted GLM coefficients, training-set size, AUROC for each focus-area model. Inline JSON kept as strings — clients parse.","operationId":"list_model_registry_v1__workspace_id__m42_model_registry_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelRegistryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/stratified-fits":{"get":{"tags":["M42"],"summary":"List Stratified Fits","description":"Per-cohort x region GLM fits with pooled fallback. Drives the dashboard's outcome-by-segment comparison view.","operationId":"list_stratified_fits_v1__workspace_id__m42_stratified_fits_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"outcome_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}],"title":"Outcome Key"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StratifiedFitsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/patients/{patient_id}/labs":{"get":{"tags":["M42"],"summary":"List Patient Labs","description":"Patient-level bronze lab rows ordered by observation_date. Drives the mini-trajectory charts in the Patient Profile drawer.","operationId":"list_patient_labs_v1__workspace_id__m42_patients__patient_id__labs_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"title":"Patient Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":1,"default":500,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatientLabsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/patients/{patient_id}/note":{"get":{"tags":["M42"],"summary":"Get Patient Note","description":"Patient's synthetic clinical note + LLM-extracted structured fields. NLP sample is 500 patients — returns 404 outside that set.","operationId":"get_patient_note_v1__workspace_id__m42_patients__patient_id__note_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"patient_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"title":"Patient Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatientNoteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/notes/rollup":{"get":{"tags":["M42"],"summary":"Get Notes Rollup","description":"Cohort-wide (or per-cluster / per-district) rollup of NLP extractions joined onto patient-topology risk. Surfaces which narrative signals correlate with higher predicted T2D risk.","operationId":"get_notes_rollup_v1__workspace_id__m42_notes_rollup_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"cluster","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}],"title":"Cluster"}},{"name":"district","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}],"title":"District"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoteRollupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/catalog":{"get":{"tags":["M42"],"summary":"List Catalog","description":"Per-table layer + description + row count for the Catalog page.","operationId":"list_catalog_v1__workspace_id__m42_catalog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/M42CatalogResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/m42/catalog/{table}/columns":{"get":{"tags":["M42"],"summary":"Describe Table","description":"Column metadata (name, type, comment) for one allowlisted m42 table.","operationId":"describe_table_v1__workspace_id__m42_catalog__table__columns_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"table","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"title":"Table"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ColumnsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/catalog/{table}/sample":{"get":{"tags":["M42"],"summary":"Sample Table","description":"Up to ``limit`` raw rows from one allowlisted m42 table for preview.","operationId":"sample_table_v1__workspace_id__m42_catalog__table__sample_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"table","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"title":"Table"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SampleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/m42/features":{"get":{"tags":["M42"],"summary":"List Features","description":"Allowlist of feature columns (continuous or binary) for the Explore UI.","operationId":"list_features_v1__workspace_id__m42_features_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeaturesResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/m42/features/distribution":{"get":{"tags":["M42"],"summary":"Feature Distribution","description":"Histogram bins for one allowlisted feature, stratified by ``y_t2d_1yr`` outcome. Continuous features get ``bins`` buckets; binary features collapse to 2.","operationId":"feature_distribution_v1__workspace_id__m42_features_distribution_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"feature","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"title":"Feature"}},{"name":"bins","in":"query","required":false,"schema":{"type":"integer","maximum":40,"minimum":2,"default":20,"title":"Bins"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureDistributionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/sensorium/connector-health":{"get":{"tags":["Sensorium"],"summary":"Per-source event health for the workspace (last 24h)","operationId":"get-sensorium-connector-health","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorHealthResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/sensorium/loop-latency":{"get":{"tags":["Sensorium"],"summary":"Sense→act latency distribution for the workspace","operationId":"get-sensorium-loop-latency","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"window_hours","in":"query","required":false,"schema":{"type":"integer","maximum":168,"minimum":1,"description":"Window size in hours (1-168).","default":24,"title":"Window Hours"},"description":"Window size in hours (1-168)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoopLatencyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/command-center":{"get":{"tags":["Command Center"],"summary":"Get Command Center","description":"Single-pane workspace health dashboard combining voice, pipeline, data quality, and identity metrics.","operationId":"get-command-center","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandCenterResponse"}}}},"429":{"description":"Rate limit exceeded"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/audit":{"get":{"tags":["Audit"],"summary":"List Audit Events","description":"List audit events with filters and pagination.\n\nPermissions: admin, owner","operationId":"list-audit-events","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Filter by service name","title":"Service"},"description":"Filter by service name"},{"name":"action","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"description":"Filter by action type","title":"Action"},"description":"Filter by action type"},{"name":"actor_entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by actor entity","title":"Actor Entity Id"},"description":"Filter by actor entity"},{"name":"resource_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Filter by resource type","title":"Resource Type"},"description":"Filter by resource type"},{"name":"resource_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by specific resource","title":"Resource Id"},"description":"Filter by specific resource"},{"name":"phi_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only PHI access events","default":false,"title":"Phi Only"},"description":"Only PHI access events"},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start of date range","title":"Date From"},"description":"Start of date range"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of date range","title":"Date To"},"description":"End of date range"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Limit"},"description":"Page size"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Page offset","default":0,"title":"Offset"},"description":"Page offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventsListResponse"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/audit/phi-access":{"get":{"tags":["Audit"],"summary":"Get Phi Access Report","description":"PHI access report — who accessed what patient data, when, from where.\n\nRequired for HIPAA breach investigation (§164.312(b)).\n\nPermissions: admin, owner","operationId":"get-phi-access-report","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by patient entity","title":"Entity Id"},"description":"Filter by patient entity"},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start of date range","title":"Date From"},"description":"Start of date range"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of date range","title":"Date To"},"description":"End of date range"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Limit"},"description":"Page size"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Page offset","default":0,"title":"Offset"},"description":"Page offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventsListResponse"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/audit/entity/{entity_id}/access-log":{"get":{"tags":["Audit"],"summary":"Get Entity Access Log","description":"Per-entity access history — all audit events for a specific resource.\n\nPermissions: admin, owner","operationId":"get-entity-access-log","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start of date range","title":"Date From"},"description":"Start of date range"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of date range","title":"Date To"},"description":"End of date range"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Limit"},"description":"Page size"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Page offset","default":0,"title":"Offset"},"description":"Page offset"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventsListResponse"}}}},"404":{"description":"Entity not found"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/audit/summary":{"get":{"tags":["Audit"],"summary":"Get Audit Summary","description":"Audit summary statistics for compliance dashboard.\n\nPermissions: admin, owner","operationId":"get-audit-summary","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Start of date range","title":"Date From"},"description":"Start of date range"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"End of date range","title":"Date To"},"description":"End of date range"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditSummaryResponse"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/audit/export":{"post":{"tags":["Audit"],"summary":"Create Audit Export","description":"Export audit events to S3 as NDJSON. Returns a presigned download URL.\n\nPermissions: admin, owner","operationId":"create-audit-export","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditExportRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditExportResponse"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/audit/exports":{"get":{"tags":["Audit"],"summary":"List Audit Exports","description":"List past audit exports with presigned download URLs.\n\nPermissions: admin, owner","operationId":"list-audit-exports","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max exports to return","default":50,"title":"Limit"},"description":"Max exports to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditExportListResponse"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/functions":{"get":{"tags":["Functions"],"summary":"List every platform function registered in the workspace","description":"List every platform function registered in the workspace.\n\nPermissions: ``Workspace.view`` (read role and above).","operationId":"list-functions","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisteredFunctionListResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/functions/{function_name}":{"get":{"tags":["Functions"],"summary":"Get a registered platform function by name","description":"Resolve a function by name.\n\nPermissions: ``Workspace.view`` (read role and above).","operationId":"get-function","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"function_name","in":"path","required":true,"schema":{"type":"string","title":"Function Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisteredFunctionResponse"}}}},"404":{"description":"Function not found"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Functions"],"summary":"Deploy (validate + upsert) a platform function","description":"Validate + upsert a platform function row.\n\nAtomic: validation + (python/udtf only) UC UDF materialization +\nupsert into ``platform.functions`` happen as one logical operation.\nRepeat deploys against the same ``(workspace, name)`` replace the\nrow in place and clear stale ``last_test_*`` telemetry.\n\nThe function name comes from the URL path; the request body's\n``name`` field must match or a 400 is raised. The URL is the\nauthoritative source.\n\nPermissions: admin, owner.","operationId":"deploy-function","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"function_name","in":"path","required":true,"schema":{"type":"string","title":"Function Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisteredFunction"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisteredFunctionResponse"}}}},"400":{"description":"URL function_name does not match body name"},"422":{"description":"Validation failure (read-only / bind / parity)"},"429":{"description":"Rate limited"}}},"delete":{"tags":["Functions"],"summary":"Remove a registered platform function","description":"Remove a registered function row.\n\nPermissions: admin, owner.","operationId":"delete-function","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"function_name","in":"path","required":true,"schema":{"type":"string","title":"Function Name"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Function not found"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/functions/{function_name}/invoke":{"post":{"tags":["Functions"],"summary":"Execute a registered platform function","description":"Execute a registered function and return its rows.\n\nBound parameters are validated against the stored schema; ``ws_id``\nis auto-injected from the request context. Returns the executor's\nshaped response (``rows`` for ``returns=table``, scalar value for\n``returns=scalar``).\n\nPermissions: ``Workspace.view`` (read role and above). Read-only\nkeys are intentionally allowed — invocation runs a stored,\npre-validated SELECT against catalogs the workspace SP already has\nSELECT on; the gate on what can run is the deploy-time validator\n(read-only invariant), not the per-call permission.","operationId":"invoke-function","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"function_name","in":"path","required":true,"schema":{"type":"string","title":"Function Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvokeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvokeResponse"}}}},"404":{"description":"Function not found"},"422":{"description":"Bind validation failure"},"429":{"description":"Rate limited"}}}},"/v1/{workspace_id}/functions/{function_name}/test":{"post":{"tags":["Functions"],"summary":"Test invoke + persist last_test_* telemetry on the row","description":"Test invoke — same as invoke + persists last_test_* on the row.\n\nReturns 200 with ``status=\"fail\"`` + populated ``error`` on\nexecution failure (instead of a 5xx) so the DC has a single\nhappy-path rendering.\n\nPermissions: admin, owner.","operationId":"test-function","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"function_name","in":"path","required":true,"schema":{"type":"string","title":"Function Name"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvokeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestInvokeResponse"}}}},"404":{"description":"Function not found"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/settings/retention":{"get":{"tags":["Settings"],"summary":"Get retention policy","description":"Get the workspace retention policy.\n\nReturns HIPAA-compliant defaults (2190 days / 6 years) for any field\nnot explicitly configured. Advisory in v1 — no automated deletion.\n\nPermissions: authenticated (any role).","operationId":"get-retention-policy","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionPolicyResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"put":{"tags":["Settings"],"summary":"Update retention policy","description":"Update the workspace retention policy.\n\nPartial updates supported — only provided fields are changed.\nAdvisory in v1: policy is stored and displayed but no automated\ndeletion is performed. Legal hold overrides all retention.\n\nPermissions: admin, owner.","operationId":"update-retention-policy","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionPolicyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetentionPolicyResponse"}}}},"404":{"description":"Workspace not found"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/settings/gap-scanner":{"get":{"tags":["Settings"],"summary":"Get gap scanner settings","description":"Get the workspace gap scanner settings.\n\nReturns defaults when not configured. Gap scanner is disabled by default.\n\nPermissions: authenticated (any role).","operationId":"get-gap-scanner-settings","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GapScannerSettingsResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"put":{"tags":["Settings"],"summary":"Update gap scanner settings","description":"Update the workspace gap scanner settings.\n\nPartial updates supported — only provided fields are changed.\nRequirements list is replaced entirely when provided (not merged).\n\nPermissions: admin, owner.","operationId":"update-gap-scanner-settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GapScannerSettingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GapScannerSettingsResponse"}}}},"404":{"description":"Workspace not found"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/settings/gap-scanner/preview":{"post":{"tags":["Settings"],"summary":"Preview gap detection (dry run)","description":"Dry-run gap detection — returns entities with missing fields without creating surfaces.\n\nProxies to connector-runner /internal/gap-scanner/preview.\n\nPermissions: admin, owner.","operationId":"gap-scanner-preview","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/GapScannerPreviewRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Gap-Scanner-Preview"}}}},"429":{"description":"Rate limited"},"503":{"description":"Connector runner unavailable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/settings/gap-scanner/scan":{"post":{"tags":["Settings"],"summary":"Trigger one scan tick","description":"Trigger one scan tick immediately — creates surfaces for detected gaps.\n\nProxies to connector-runner /internal/gap-scanner/scan.\n\nPermissions: admin, owner.","operationId":"gap-scanner-scan","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Gap-Scanner-Scan"}}}},"429":{"description":"Rate limited"},"503":{"description":"Connector runner unavailable"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/settings/memory":{"get":{"tags":["Settings"],"summary":"Get memory dimension settings","description":"Get the workspace memory dimension settings.\n\nReturns built-in defaults when not configured.\n\nPermissions: authenticated (any role).","operationId":"get-memory-settings","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemorySettingsResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"put":{"tags":["Settings"],"summary":"Update memory dimension settings","description":"Update the workspace memory dimension settings.\n\nPartial updates supported — only provided fields are changed.\nThe dimensions list is replaced entirely when provided.\n\nPermissions: admin, owner.","operationId":"update-memory-settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemorySettingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemorySettingsResponse"}}}},"404":{"description":"Workspace not found"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/settings/metrics":{"get":{"tags":["Settings"],"summary":"Get metric definitions","description":"Get the workspace metric definitions.\n\nReturns built-in defaults when not configured.\n\nPermissions: authenticated (any role).","operationId":"get-metric-settings","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricSettingsResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"put":{"tags":["Settings"],"summary":"Update metric definitions","description":"Update the workspace metric definitions.\n\nPartial updates supported — only provided fields are changed.\nThe definitions list is replaced entirely when provided.\n\nPermissions: admin, owner.","operationId":"update-metric-settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricSettingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricSettingsResponse"}}}},"404":{"description":"Workspace not found"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/metrics":{"get":{"tags":["Metrics"],"summary":"List latest metric values","description":"List the latest value for each metric in the workspace.\n\nPermissions: authenticated (any role).","operationId":"list-metrics","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"source","in":"query","required":false,"schema":{"enum":["production","simulation","all"],"type":"string","default":"production","title":"Source"}},{"name":"scope","in":"query","required":false,"schema":{"enum":["aggregate","entity","all"],"type":"string","default":"aggregate","title":"Scope"}},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Entity Type"}},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Entity Id"}},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Service Id"}},{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Run Id"}},{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Session Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricListResponse"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/metrics/catalog":{"get":{"tags":["Metrics"],"summary":"List available metrics (builtin + custom)","description":"List all available metrics (builtin + custom defined on workspace).\n\nPermissions: authenticated (any role).","operationId":"get-metric-catalog","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricCatalogResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/metrics/{metric_key}":{"get":{"tags":["Metrics"],"summary":"Get values for a specific metric","description":"Get values for a specific metric with optional time range.\n\nPermissions: authenticated (any role).","operationId":"get-metric-values","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"metric_key","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_]*$","description":"Metric key (lowercase alphanumeric + underscores)","title":"Metric Key"},"description":"Metric key (lowercase alphanumeric + underscores)"},{"name":"source","in":"query","required":false,"schema":{"enum":["production","simulation","all"],"type":"string","default":"production","title":"Source"}},{"name":"scope","in":"query","required":false,"schema":{"enum":["aggregate","entity","all"],"type":"string","default":"aggregate","title":"Scope"}},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Entity Type"}},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Entity Id"}},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Service Id"}},{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Run Id"}},{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Session Id"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date To"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":90,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricListResponse"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/metrics/{metric_key}/trend":{"get":{"tags":["Metrics"],"summary":"Get time-series trend for a metric","description":"Get time-series trend for a specific metric.\n\nPermissions: authenticated (any role).","operationId":"get-metric-trend","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"metric_key","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-z][a-z0-9_]*$","description":"Metric key (lowercase alphanumeric + underscores)","title":"Metric Key"},"description":"Metric key (lowercase alphanumeric + underscores)"},{"name":"source","in":"query","required":false,"schema":{"enum":["production","simulation","all"],"type":"string","default":"production","title":"Source"}},{"name":"scope","in":"query","required":false,"schema":{"enum":["aggregate","entity","all"],"type":"string","default":"aggregate","title":"Scope"}},{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Entity Type"}},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Entity Id"}},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Service Id"}},{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Run Id"}},{"name":"session_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Session Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricListResponse"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/memory/analytics":{"get":{"tags":["Memory"],"summary":"Get workspace-level memory analytics","description":"Get workspace-level memory analytics.\n\nReturns aggregate stats about the memory extraction pipeline:\nper-dimension fact counts, coverage rates, source intelligence,\nand recent activity. Cached in Valkey (60s TTL). Reads only Lakebase\nmemory projections on cache miss.\n\nPermissions: authenticated (any role).","operationId":"get-memory-analytics","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryAnalyticsResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/memory/{entity_id}/dimensions":{"get":{"tags":["Memory"],"summary":"Get memory dimension scores for an entity","description":"Get dimension completeness scores for an entity.\n\nReads pre-computed aggregates from ``memory.patient_dimensions``.\nAll 6 built-in dimensions are always returned (0 facts for empty ones).\n\nPermissions: authenticated (any role).","operationId":"get-entity-dimension-scores","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id","description":"Entity UUID"},"description":"Entity UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DimensionScoresResponse"}}}},"422":{"description":"Invalid entity_id"},"429":{"description":"Rate limited"}}}},"/v1/{workspace_id}/memory/{entity_id}/facts":{"get":{"tags":["Memory"],"summary":"Get memory facts for an entity","description":"Get extracted facts for an entity, optionally filtered by dimension.\n\nReads pre-computed facts from ``memory.patient_memory``. Each row\nincludes the pre-extracted ``extracted_text`` — no inline JSONB\nextraction at query time.\n\nPermissions: authenticated (any role).","operationId":"get-entity-memory-facts","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id","description":"Entity UUID"},"description":"Entity UUID"},{"name":"dimension","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by dimension key (clinical, behavioral, etc.)","title":"Dimension"},"description":"Filter by dimension key (clinical, behavioral, etc.)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max facts to return","default":50,"title":"Limit"},"description":"Max facts to return"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryFactsResponse"}}}},"422":{"description":"Invalid entity_id or dimension key"},"429":{"description":"Rate limited"}}}},"/v1/{workspace_id}/settings/outreach":{"get":{"tags":["Settings"],"summary":"Get outreach settings","description":"Get the workspace outreach settings.\n\nReturns empty rules and templates when not configured.\n\nPermissions: authenticated (any role).","operationId":"get-outreach-settings","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachSettingsResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"put":{"tags":["Settings"],"summary":"Update outreach settings","description":"Update the workspace outreach settings.\n\nPartial updates supported — only provided fields are changed.\nRules and data_templates lists are replaced entirely when provided.\n\nValidates that data_template_id references in rules point to\ntemplates that exist in the same payload or current settings.\n\nPermissions: admin, owner.","operationId":"update-outreach-settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachSettingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutreachSettingsResponse"}}}},"404":{"description":"Workspace not found"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/settings/form-templates":{"get":{"tags":["Form Templates"],"summary":"List Form Templates","description":"List all form templates for a workspace.","operationId":"list-form-templates","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"enum":["intake","update","consent","screening","survey","custom"],"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"patient_type","in":"query","required":false,"schema":{"anyOf":[{"enum":["new","returning","any"],"type":"string"},{"type":"null"}],"title":"Patient Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormTemplateListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Form Templates"],"summary":"Update Form Templates","description":"Replace all form templates for a workspace.","operationId":"update-form-templates","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormTemplateUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormTemplateListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/settings/form-templates/{template_id}":{"get":{"tags":["Form Templates"],"summary":"Get Form Template","description":"Get a single form template by ID.","operationId":"get-form-template","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FormTemplate-Output"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/settings/form-templates/{template_id}/resolve":{"post":{"tags":["Form Templates"],"summary":"Resolve Form Template","description":"Resolve a form template with prefill values from entity state.\n\nReturns a hydrated SurfaceSpec ready to be passed to create_surface.\nFields with matching data in entity state get prefill_value set.\nFor returning patient templates, completed optional fields are stripped.","operationId":"resolve-form-template","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"template_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveTemplateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveTemplateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/settings/branding":{"get":{"tags":["Settings"],"summary":"Get workspace branding","description":"Get the workspace default branding for surfaces.\n\nReturns empty branding when not configured.\n\nPermissions: authenticated (any role).","operationId":"get-branding-settings","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingSettingsResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"put":{"tags":["Settings"],"summary":"Update workspace branding","description":"Update the workspace default branding for surfaces.\n\nSurface-level branding takes precedence over workspace-level branding.\n\nPermissions: admin, owner.","operationId":"update-branding-settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingSettingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandingSettingsResponse"}}}},"404":{"description":"Workspace not found"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/settings/environments":{"get":{"tags":["Settings"],"summary":"Get environment overrides","description":"Get per-environment config overrides.\n\nReturns empty environments when not configured.\n\nPermissions: authenticated (any role).","operationId":"get-environment-settings","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentSettingsResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"put":{"tags":["Settings"],"summary":"Update environment overrides","description":"Update per-environment config overrides.\n\nPermissions: admin, owner.","operationId":"update-environment-settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentSettingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentSettingsResponse"}}}},"404":{"description":"Workspace not found"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/scheduling-rule-sets":{"get":{"tags":["Scheduling Rules"],"summary":"List scheduling rule sets","description":"List all scheduling rule sets for the workspace. Optional filters: `agent_kind` (tms / ketamine / general), `is_active`. Used by the agent-engine rules engine and by operators inspecting config.","operationId":"list-scheduling-rule-sets","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"agent_kind","in":"query","required":false,"schema":{"anyOf":[{"enum":["tms","ketamine","general"],"type":"string"},{"type":"null"}],"title":"Agent Kind"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_SchedulingRuleSetResponse_"}}}},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"429":{"description":"Rate limited."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Scheduling Rules"],"summary":"Create a scheduling rule set","description":"Create one rule set for `(agent_kind, rule_kind)`. Returns 409 if a row already exists for that key — use PATCH on the existing row or DELETE first.","operationId":"create-scheduling-rule-set","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSchedulingRuleSetRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchedulingRuleSetResponse"}}}},"409":{"description":"Rule set already exists for this (agent_kind, rule_kind)."},"422":{"description":"Invalid request body or rule_kind discriminator."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"429":{"description":"Rate limited."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/scheduling-rule-sets/{rule_set_id}":{"get":{"tags":["Scheduling Rules"],"summary":"Get one scheduling rule set","description":"Fetch one rule set by id. Returns 404 when the row doesn't exist\nin this workspace (the RLS policy means cross-workspace lookups\nsurface as 404, never as a row from the wrong workspace).\n\nPermissions: ``Workspace.view``.","operationId":"get-scheduling-rule-set","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"rule_set_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Set Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchedulingRuleSetResponse"}}}},"404":{"description":"Rule set not found in this workspace."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"429":{"description":"Rate limited."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Scheduling Rules"],"summary":"Partially update a scheduling rule set","description":"Update `params` and/or `is_active` on an existing rule set. `agent_kind` and `rule_kind` are immutable — to change either, create a new rule set and delete the old one.","operationId":"update-scheduling-rule-set","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"rule_set_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Set Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSchedulingRuleSetRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchedulingRuleSetResponse"}}}},"404":{"description":"Rule set not found in this workspace."},"422":{"description":"Submitted params discriminator does not match the existing rule's rule_kind."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"429":{"description":"Rate limited."}}},"delete":{"tags":["Scheduling Rules"],"summary":"Delete a scheduling rule set","description":"Hard-delete. The audit log retains the deletion record.","operationId":"delete-scheduling-rule-set","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"rule_set_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Set Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Rule set not found in this workspace."},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid API key."},"429":{"description":"Rate limited."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/settings/voice":{"get":{"tags":["Settings"],"summary":"Get voice settings","description":"Get the voice experience settings for a workspace.\n\nReturns voice identity, domain vocabulary, and post-call intelligence\nconfiguration. These settings shape how the AI agent sounds and what\ndomain-specific terms it recognizes accurately.\n\n#### Permissions\n* Requires authenticated API key (any role).","operationId":"get-voice-settings","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSettingsResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"put":{"tags":["Settings"],"summary":"Update voice settings","description":"Update the voice experience settings for a workspace.\n\nOnly provided fields are updated; omitted fields retain their current\nvalues. Set a field to ``null`` to reset it to default.\n\n**Voice Identity & Style**\n- **voice_id**: Voice identity UUID — determines the agent's voice persona\n- **tone**: Emotional baseline (``calm``, ``sympathetic``,\n  ``enthusiastic``, ``content``, ``curious``, ``cheerful``,\n  ``serious``, ``friendly``). The system also adapts tone dynamically\n  based on real-time caller emotion analysis; this setting provides\n  the baseline when no strong emotional signal is detected.\n- **speed**: Speech rate multiplier (0.5-2.0)\n- **volume**: Volume multiplier (0.0-1.0)\n- **language**: BCP-47 language tag (default ``en``)\n\n**Speech Recognition Boost**\n- **keyterms**: Exact words the speech recognition engine should\n  prioritize. Use for specific names, drug names, and org jargon.\n  Example: ``[\"Dr. Ramirez\", \"metformin\", \"HIPAA\"]``\n\n**Audio Correction Hints**\n- **correction_categories**: Broad categories of things callers\n  commonly say that speech-to-text gets wrong. Not exact words —\n  just what *kinds* of things to watch for. Example:\n  ``[\"medication names\", \"insurance carriers\", \"doctor last names\"]``\n\n**Post-Call Intelligence**\n- **post_call_analysis_enabled**: Run automated quality scoring after\n  each call ends (default ``true``)\n- **transcript_correction_enabled**: Re-verify transcripts with a\n  high-accuracy batch model after call ends (default ``true``)\n\n#### Permissions\n* Requires admin or owner role.","operationId":"update-voice-settings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSettingsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSettingsResponse"}}}},"404":{"description":"Workspace not found"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/network/egress-ips":{"get":{"tags":["Network"],"summary":"Get egress IP addresses","description":"Get platform egress IP addresses for firewall allowlisting.\n\nReturns the static IP addresses used by all outbound traffic from the\nplatform. Customers should add these to their firewall allowlists to\nenable data source connectivity (EHR, FHIR stores, etc.).\n\nPermissions: authenticated (any role).","operationId":"get-egress-ips","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EgressIpsResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/compliance/dashboard":{"get":{"tags":["Compliance"],"summary":"Compliance dashboard composite","description":"Composite compliance dashboard — HIPAA status, retention, credentials summary.\n\nAggregates compliance signals into a single dashboard view.\n\nPermissions: admin, owner.","operationId":"get-compliance-dashboard","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceDashboardResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/compliance/hipaa":{"get":{"tags":["Compliance"],"summary":"HIPAA compliance evidence report","description":"HIPAA compliance evidence report.\n\nAggregates audit statistics, retention policy, encryption status,\nand API key summary for the specified period. Identity-specific\nfields (MFA, SSO, lockout) return null pending integration.\n\nPermissions: admin, owner.","operationId":"get-hipaa-report","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"report_period_days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"description":"Report period in days","default":90,"title":"Report Period Days"},"description":"Report period in days"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HipaaReportResponse"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/compliance/access-review":{"get":{"tags":["Compliance"],"summary":"Access review export","description":"Access review export for SOC2 attestation.\n\nLists all API key credentials with role, status, and activity dates.\nDownload, review, and upload signed attestation for SOC2 compliance.\n\nPermissions: admin, owner.","operationId":"get-access-review","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessReviewResponse"}}}},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/simulations/runs":{"post":{"tags":["Simulations"],"summary":"Create Simulation Run","description":"Create a simulation coverage run with an optional Lakebase branch.","operationId":"create-simulation-run","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRunRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create-Simulation-Run"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Simulations"],"summary":"List Simulation Runs","operationId":"list-simulation-runs","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List-Simulation-Runs"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/suites":{"get":{"tags":["Simulations"],"summary":"List Simulation Suites","description":"List first-class simulation suites.","operationId":"list-simulation-suites","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSimulationSuitesResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"post":{"tags":["Simulations"],"summary":"Create Simulation Suite","description":"Create a reusable suite definition for saved simulation cases.","operationId":"create-simulation-suite","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSimulationSuiteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationSuiteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/simulations/suites/{suite_id}":{"get":{"tags":["Simulations"],"summary":"Get Simulation Suite","operationId":"get-simulation-suite","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"suite_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Suite Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationSuiteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Simulations"],"summary":"Update Simulation Suite","operationId":"update-simulation-suite","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"suite_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Suite Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSimulationSuiteRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationSuiteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Simulations"],"summary":"Delete Simulation Suite","operationId":"delete-simulation-suite","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"suite_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Suite Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/suites/{suite_id}/runs":{"get":{"tags":["Simulations"],"summary":"List Simulation Suite Runs","description":"List durable suite-run groups for a first-class suite.","operationId":"list-simulation-suite-runs","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"suite_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Suite Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListSimulationSuiteRunsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/cases":{"get":{"tags":["Simulations"],"summary":"List Simulation Cases","description":"List durable simulation cases for case-library inspection.","operationId":"list-simulation-cases","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"}},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string","maxLength":128},"maxItems":20},{"type":"null"}],"title":"Tags"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_SimulationCaseResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Simulations"],"summary":"Create Simulation Cases","description":"Create durable simulation cases for an internal benchmark suite.","operationId":"create-simulation-cases","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSimulationCasesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSimulationCasesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/simulations/cases/{case_id}":{"get":{"tags":["Simulations"],"summary":"Get Simulation Case","description":"Fetch one durable simulation case for case-library inspection.","operationId":"get-simulation-case","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationCaseResponse"}}}},"404":{"description":"Simulation case not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Simulations"],"summary":"Update Simulation Case","description":"Update editable fields on one durable simulation case.","operationId":"update-simulation-case","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Case Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSimulationCaseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationCaseResponse"}}}},"404":{"description":"Simulation case not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Simulations"],"summary":"Delete Simulation Case","description":"Delete one durable simulation case.","operationId":"delete-simulation-case","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Case Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Simulation case not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/runs/{run_id}":{"get":{"tags":["Simulations"],"summary":"Get Simulation Run","description":"Fetch a single run including objective / bridge_request / scenarios.\n\nUse the bridge_request payload to re-POST /bridge and replay the run.","operationId":"get-simulation-run","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/runs/{run_id}/complete":{"post":{"tags":["Simulations"],"summary":"Complete Simulation Run","operationId":"complete-simulation-run","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Complete-Simulation-Run"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/runs/{run_id}/sessions":{"post":{"tags":["Simulations"],"summary":"Create Simulation Session","description":"Create a simulation session within a run. Proxies to agent-engine.\n\nentity_id ownership: agent-engine's _resolve_caller queries the entity\nwith workspace_id scoping — a workspace-A entity_id resolves to None in\nworkspace-B, so no cross-tenant data is exposed.","operationId":"create-simulation-session","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/sessions/{session_id}/step":{"post":{"tags":["Simulations"],"summary":"Simulation Step","description":"Step a simulation session and auto-store the turn observation.","operationId":"simulation-step","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StepRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationStepResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/sessions/{session_id}/fork":{"post":{"tags":["Simulations"],"summary":"Simulation Fork","description":"Fork a session into N branches — clone + step each alternative atomically.","operationId":"simulation-fork","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Simulation-Fork"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/sessions/{session_id}/score":{"post":{"tags":["Simulations"],"summary":"Score Simulation Session","description":"ASI assigns a score to a completed simulation session.","operationId":"score-simulation-session","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScoreSessionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Score-Simulation-Session"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/sessions":{"post":{"tags":["Simulations"],"summary":"Create Test Conversation","description":"Create a test conversation session (no coverage run required).","operationId":"create-test-conversation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationSessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/simulations/sessions/step":{"post":{"tags":["Simulations"],"summary":"Test Conversation Step","description":"Step a test conversation (no coverage auto-store).","operationId":"test-conversation-step","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StepRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationStepResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/simulations/sessions/recommend":{"post":{"tags":["Simulations"],"summary":"Simulation Recommend","operationId":"simulation-recommend","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecommendRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecommendResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/simulations/sessions/{session_id}":{"get":{"tags":["Simulations"],"summary":"Simulation Observe","operationId":"simulation-observe","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationSnapshotResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Simulations"],"summary":"Simulation Destroy","operationId":"simulation-destroy","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestroySessionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/sessions/{session_id}/intelligence":{"get":{"tags":["Simulations"],"summary":"Simulation Intelligence","operationId":"simulation-intelligence","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationIntelligenceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/services/{service_id}/graph":{"get":{"tags":["Simulations"],"summary":"Get Simulation Coverage Graph","description":"Get the B&B knowledge graph for a service — topology + observations merged.","operationId":"get-simulation-coverage-graph","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id"}},{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}},{"name":"include_turns","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Turns"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Simulation-Coverage-Graph"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Simulations"],"summary":"Delete Simulation Coverage Graph","operationId":"delete-simulation-coverage-graph","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete-Simulation-Coverage-Graph"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/services/{service_id}/graph/paths":{"get":{"tags":["Simulations"],"summary":"Get Simulation Coverage Paths","description":"Get distinct trajectories from simulation sessions.","operationId":"get-simulation-coverage-paths","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id"}},{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Simulation-Coverage-Paths"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/services/{service_id}/sessions":{"get":{"tags":["Simulations"],"summary":"List Simulation Sessions","operationId":"list-simulation-sessions","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id"}},{"name":"run_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List-Simulation-Sessions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/sessions/{session_id}/turns":{"get":{"tags":["Simulations"],"summary":"Get Simulation Session Turns","operationId":"get-simulation-session-turns","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","title":"Session Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Simulation-Session-Turns"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/services/{service_id}/turns":{"get":{"tags":["Simulations"],"summary":"Query Simulation Turns","operationId":"query-simulation-turns","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"from_state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From State"}},{"name":"to_state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To State"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Query-Simulation-Turns"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/config-to-policy":{"post":{"tags":["Simulations"],"summary":"Config To Turn Policy","operationId":"config-to-turn-policy","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigToPolicyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Config-To-Turn-Policy"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/simulations/bridge":{"post":{"tags":["Simulations"],"summary":"Simulation Bridge","description":"NL objective to N autonomous scenarios against the tracked simulation primitives.\n\nReturns immediately with run_id + generated scenarios. Scenarios run in\nthe background via BridgeExecutor (lifecycle-managed, shutdown-drained).\nCompletion events are emitted to Delta via world_emitter for SDP\nobservability.","operationId":"simulation-bridge","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/simulations/benchmarks/run":{"post":{"tags":["Simulations"],"summary":"Run Simulation Benchmark","description":"Run a suite or tag-selected benchmark batch as one saved-case run per case.","operationId":"run-simulation-benchmark","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSimulationBenchmarkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationBenchmarkRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/simulations/suites/{suite_id}/run":{"post":{"tags":["Simulations"],"summary":"Run Simulation Suite","description":"Run a first-class suite definition.","operationId":"run-simulation-suite","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"suite_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Suite Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSimulationBenchmarkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationBenchmarkRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/benchmarks/results":{"post":{"tags":["Simulations"],"summary":"Get Simulation Benchmark Results","description":"Aggregate benchmark results over the run ids returned by benchmark start.","operationId":"get-simulation-benchmark-results","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSimulationBenchmarkResultsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationBenchmarkResultsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/simulations/suite-runs/{suite_run_id}":{"get":{"tags":["Simulations"],"summary":"Get Simulation Suite Run Results","description":"Fetch aggregate results for a durable suite run.","operationId":"get-simulation-suite-run-results","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"suite_run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Suite Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationSuiteRunResultsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/cases/{case_id}/run":{"post":{"tags":["Simulations"],"summary":"Run Simulation Case","description":"Run the current saved simulation case through the bridge executor.","operationId":"run-simulation-case","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"case_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Case Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSimulationCaseRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/simulations/bridge/plan":{"post":{"tags":["Simulations"],"summary":"Simulation Bridge Plan","description":"Infer a TargetSpec from an NL objective — preview before running /bridge.\n\nUX: user types \"test scheduling failures in 20 different ways\", we return\na structured target_spec + rationale. The frontend shows both, lets the\nuser edit (add/remove states, tighten pathways), then POSTs the final\nspec to /bridge. Same LLM, same Vertex cost structure as /bridge, but\nno run is created — pure inference.","operationId":"simulation-bridge-plan","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgePlanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BridgePlanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/insights/sql":{"post":{"tags":["Insights"],"summary":"Execute Sql","description":"Execute a read-only SQL query against Databricks.","operationId":"execute_sql_v1__workspace_id__insights_sql_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SqlQueryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SqlQueryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/insights/schema":{"get":{"tags":["Insights"],"summary":"Describe Schema","description":"List available tables, columns, and functions.","operationId":"describe_schema_v1__workspace_id__insights_schema_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchemaResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/insights/suggestions":{"get":{"tags":["Insights"],"summary":"Get Suggestions","description":"Get contextual starter questions for the insights agent.","operationId":"get_suggestions_v1__workspace_id__insights_suggestions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestionsResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/insights/digest":{"get":{"tags":["Insights"],"summary":"Get Digest","description":"Proactive workspace health digest. Cached 5 minutes.","operationId":"get_digest_v1__workspace_id__insights_digest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Digest V1  Workspace Id  Insights Digest Get"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/insights/sessions":{"post":{"tags":["Insights"],"summary":"Create Session","description":"Create a new insights chat session.","operationId":"create_session_v1__workspace_id__insights_sessions_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/insights/sessions/{session_id}/chat":{"post":{"tags":["Insights"],"summary":"Chat","description":"Chat with the insights agent. Returns SSE stream of visual blocks.","operationId":"chat_v1__workspace_id__insights_sessions__session_id__chat_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Session ID","title":"Session Id"},"description":"Session ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/insights/sessions/{session_id}":{"get":{"tags":["Insights"],"summary":"Get Session","description":"Get insights session history.","operationId":"get_session_v1__workspace_id__insights_sessions__session_id__get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"session_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Session ID","title":"Session Id"},"description":"Session ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Session V1  Workspace Id  Insights Sessions  Session Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/files":{"post":{"tags":["Intake"],"summary":"Receive Intake File","operationId":"receive_intake_file_v1__workspace_id__intake_files_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"x-amigo-intake-sha256","in":"header","required":true,"schema":{"type":"string","maxLength":64,"title":"X-Amigo-Intake-Sha256"}},{"name":"x-amigo-intake-timestamp","in":"header","required":true,"schema":{"type":"string","maxLength":20,"title":"X-Amigo-Intake-Timestamp"}},{"name":"x-amigo-intake-signature","in":"header","required":true,"schema":{"type":"string","maxLength":512,"title":"X-Amigo-Intake-Signature"}},{"name":"x-amigo-intake-customer-slug","in":"header","required":true,"schema":{"type":"string","maxLength":63,"title":"X-Amigo-Intake-Customer-Slug"}},{"name":"x-amigo-intake-filename","in":"header","required":true,"schema":{"type":"string","maxLength":256,"title":"X-Amigo-Intake-Filename"}},{"name":"x-amigo-intake-content-type","in":"header","required":false,"schema":{"type":"string","maxLength":128,"default":"application/octet-stream","title":"X-Amigo-Intake-Content-Type"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntakeFileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/links":{"post":{"tags":["Intake"],"summary":"Generate upload link","description":"Create a shareable upload link for a customer.","operationId":"create-intake-link","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLinkRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntakeLinkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Intake"],"summary":"List upload links","operationId":"list-intake-links","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"include_expired","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Expired"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IntakeLinkResponse"},"title":"Response List-Intake-Links"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/links/{link_id}":{"delete":{"tags":["Intake"],"summary":"Revoke upload link","operationId":"revoke-intake-link","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"link_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Link Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/links/{link_id}/uploads":{"get":{"tags":["Intake"],"summary":"List uploads for a link","operationId":"list-intake-link-uploads","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"link_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Link Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":200,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IntakeUploadResponse"},"title":"Response List-Intake-Link-Uploads"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/links/{link_id}/uploads/{upload_id}/download":{"get":{"tags":["Intake"],"summary":"Download an uploaded file","description":"Proxy the raw file bytes from the UC Volume back to the caller.","operationId":"download-intake-upload","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"link_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Link Id"}},{"name":"upload_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Upload Id"}}],"responses":{"200":{"description":"File bytes with Content-Disposition: attachment","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Link, upload, or file not found"},"502":{"description":"UC Volume storage backend unavailable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/upload/{link_token}/info":{"get":{"tags":["Intake Upload"],"summary":"Get Link Info","operationId":"get-intake-link-info","parameters":[{"name":"link_token","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Link Token"}}],"responses":{"200":{"description":"Link metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkInfoResponse"}}}},"400":{"description":"Invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkErrorResponse"}}}},"404":{"description":"Link not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkErrorResponse"}}}},"410":{"description":"Link expired or exhausted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkErrorResponse"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/upload/{link_token}/files":{"post":{"tags":["Intake Upload"],"summary":"Receive Upload","operationId":"upload-intake-file-via-link","parameters":[{"name":"link_token","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Link Token"}},{"name":"x-amigo-intake-filename","in":"header","required":true,"schema":{"type":"string","maxLength":256,"title":"X-Amigo-Intake-Filename"}},{"name":"x-amigo-intake-content-type","in":"header","required":true,"schema":{"type":"string","maxLength":128,"title":"X-Amigo-Intake-Content-Type"}}],"responses":{"201":{"description":"File uploaded successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadFileResponse"}}}},"404":{"description":"Link not found"},"410":{"description":"Link expired"},"413":{"description":"File too large"},"422":{"description":"Invalid filename or content type"},"429":{"description":"Rate limited or upload limit reached"}}}},"/v1/{workspace_id}/surfaces":{"post":{"tags":["Surfaces"],"summary":"Create Surface","description":"Create a new data collection surface.\n\nStores the surface spec as a world.event with domain=\"surface\".\nThe entity_id is stored inside event data (not on the event row)\nto avoid entity state recomputation.\n\nReturns a signed patient-facing token and URL if SURFACE_TOKEN_SECRET is configured.\n\nPermissions: member, admin, owner (surfaces:write)","operationId":"create-surface","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSurfaceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSurfaceResponse"}}}},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Surfaces"],"summary":"List Surfaces","description":"List surfaces with pagination and optional filters.\n\nPermissions: viewer, member, admin, owner (surfaces:read)","operationId":"list-surfaces","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by entity ID","title":"Entity Id"},"description":"Filter by entity ID"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by status","title":"Status"},"description":"Filter by status"},{"name":"channel","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by channel","title":"Channel"},"description":"Filter by channel"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_SurfaceResponse_"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/surfaces/review":{"get":{"tags":["Surfaces"],"summary":"List surfaces pending review","description":"List surfaces pending review.\n\nField engineers use this to approve or reject surfaces before delivery.\n\nPermissions: operator, member, admin, owner (ReviewQueue:View)","operationId":"list-surface-review-queue","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_SurfaceResponse_"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/surfaces/{surface_id}":{"get":{"tags":["Surfaces"],"summary":"Get Surface","description":"Get a surface by ID.\n\nReturns the surface spec and current lifecycle status.\n\nPermissions: viewer, member, admin, owner (surfaces:read)","operationId":"get-surface","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"surface_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Surface Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceResponse"}}}},"404":{"description":"Surface not found"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Surfaces"],"summary":"Update a surface spec","description":"Update an existing surface spec.\n\nOnly allowed while status is CREATED or DELIVERED. Writes a\nsurface.updated event preserving the full audit trail.\n\nPermissions: member, admin, owner (Surface:Create)","operationId":"update-surface","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"surface_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Surface Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSurfaceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceResponse"}}}},"404":{"description":"Surface not found"},"409":{"description":"Cannot update in current status"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}}},"delete":{"tags":["Surfaces"],"summary":"Archive (soft-delete) a surface","description":"Archive (soft-delete) a surface.\n\nWorks for any non-terminal surface. Terminal surfaces (completed,\nexpired, already archived) cannot be archived.\n\nPermissions: member, admin, owner (Surface:Create)","operationId":"archive-surface","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"surface_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Surface Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveResponse"}}}},"404":{"description":"Surface not found"},"409":{"description":"Cannot archive terminal surface"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/surfaces/{surface_id}/approve":{"post":{"tags":["Surfaces"],"summary":"Approve a surface pending review","description":"Approve a surface pending review.\n\nThe surface returns to CREATED status and can then be delivered.\n\nPermissions: operator, member, admin, owner (ReviewQueue:Review)","operationId":"approve-surface","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"surface_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Surface Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewActionResponse"}}}},"404":{"description":"Surface not found"},"409":{"description":"Surface is not pending review"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/surfaces/{surface_id}/reject":{"post":{"tags":["Surfaces"],"summary":"Reject a surface pending review","description":"Reject a surface pending review.\n\nThe surface is marked as expired and will not be delivered.\n\nPermissions: operator, member, admin, owner (ReviewQueue:Review)","operationId":"reject-surface","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"surface_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Surface Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectSurfaceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewActionResponse"}}}},"404":{"description":"Surface not found"},"409":{"description":"Surface is not pending review"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/surfaces/{surface_id}/progress":{"get":{"tags":["Surfaces"],"summary":"Get field-level completion status","description":"Get field-level completion status for a surface.\n\nReturns which fields are filled vs empty, useful for abandonment\nintelligence and targeted re-engagement.\n\nPermissions: viewer, member, admin, owner (surfaces:read)","operationId":"get-surface-progress","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"surface_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Surface Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceProgressResponse"}}}},"404":{"description":"Surface not found"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/surfaces/{surface_id}/reshape":{"post":{"tags":["Surfaces"],"summary":"Create new surface with only unfilled fields","description":"Create a new surface with only the unfilled fields from the original.\n\nUsed for re-engaging patients who abandoned a form. The new surface\ncontains only the fields they haven't completed yet, reducing friction.\n\nPermissions: member, admin, owner (surfaces:write)","operationId":"reshape-surface","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"surface_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Surface Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSurfaceResponse"}}}},"404":{"description":"Surface not found"},"409":{"description":"All fields already filled"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/surfaces/{surface_id}/deliver":{"post":{"tags":["Surfaces"],"summary":"Deliver Surface","description":"Record a real delivery handoff for a surface.\n\nEmail targets are delivered through channel-manager's\n``POST /v1/email/send`` (CM owns SES sender identity, IP pool, DKIM,\nsuppression — keyed on the surface row's ``use_case_id``). Phone-shaped\naddresses return 422 — SMS surface delivery was removed in PR #2783.\nOther targets record an external handoff that was completed outside\nplatform-api.\n\nPermissions: member, admin, owner (surfaces:write)","operationId":"deliver-surface","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"surface_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Surface Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverSurfaceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliverSurfaceResponse"}}}},"404":{"description":"Surface not found"},"409":{"description":"Surface already delivered/completed/expired"},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}}}},"/v1/{workspace_id}/events/stream":{"get":{"tags":["Events"],"summary":"Event Stream","description":"Server-Sent Events stream for real-time workspace updates.","operationId":"get-event-stream","responses":{"200":{"description":"SSE stream","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceSSEEvent"}},"text/event-stream":{"schema":{"$ref":"#/components/schemas/WorkspaceSSEEvent"}}}},"429":{"description":"Rate limit exceeded"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/entities/{entity_id}/brief":{"post":{"tags":["Self-Image"],"summary":"Generate Brief","description":"Generate a Self-Image brief for the target entity (patient, cohort, territory, emirate, or district).","operationId":"generate_brief_v1__workspace_id__entities__entity_id__brief_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id","description":"Target entity UUID"},"description":"Target entity UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Self-Image"],"summary":"Get Latest Brief","description":"Return the latest Self-Image brief for the target entity (null shape if none).","operationId":"get_latest_brief_v1__workspace_id__entities__entity_id__brief_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Entity Id","description":"Target entity UUID"},"description":"Target entity UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/brief":{"get":{"tags":["Self-Image"],"summary":"Get Latest Workspace Brief","description":"Return the latest workspace-level Self-Image brief (null shape if none).","operationId":"get_latest_workspace_brief_v1__workspace_id__brief_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"post":{"tags":["Self-Image"],"summary":"Generate Workspace Brief","description":"Generate a workspace-level Self-Image brief (Opus 4.7).","operationId":"generate_workspace_brief_v1__workspace_id__brief_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BriefResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/s/f/{surface_id}":{"get":{"tags":["Surface Patient"],"summary":"Redirect To Surface","description":"Short-URL redirect: ``/s/f/{surface_id}`` → ``/s/{token}``.\n\nGenerates a fresh HMAC token and issues a 302 redirect so that SMS\nmessages can contain a short, clickable link instead of the long\nbase64-encoded token URL.","operationId":"redirect-to-surface","parameters":[{"name":"surface_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Surface Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"302":{"description":"Redirect to full surface URL"},"404":{"description":"Surface not found"},"410":{"description":"Surface expired"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/s/{token}/lookup/{lookup_type}":{"get":{"tags":["Surface Patient"],"summary":"Lookup Field","description":"Search healthcare reference data for form field autocompletion.\n\nSupports: medication (RxNorm), allergy (RxNorm), pharmacy (NPPES NPI),\ninsurance (static carrier list). Token-authenticated, no Bearer auth.","operationId":"lookup-surface-field","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"lookup_type","in":"path","required":true,"schema":{"type":"string","title":"Lookup Type"}},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":200,"title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookupResponse"}}}},"401":{"description":"Invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"422":{"description":"Invalid lookup type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"429":{"description":"Rate limited"}}}},"/s/{token}/ocr":{"post":{"tags":["Surface Patient"],"summary":"Ocr Extract","description":"Extract structured data from an image (e.g. insurance card) using Gemini Vision.\n\nReturns extracted field key-value pairs and a confidence score.\nToken-authenticated, no Bearer auth.","operationId":"ocr-surface-extract","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OcrRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OcrResponse"}}}},"401":{"description":"Invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/s/{token}":{"get":{"tags":["Surface Patient"],"summary":"Render Surface","description":"Render a patient-facing surface as HTML.\n\nToken-authenticated — no Bearer auth required.\nRecords a surface.opened lifecycle event on first view.","operationId":"render-surface","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Invalid token"},"410":{"description":"Token expired"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/s/{token}/spec":{"get":{"tags":["Surface Patient"],"summary":"Get Surface Spec","description":"Return surface spec as JSON for the forms app.\n\nThe forms app (Next.js) calls this on SSR to fetch the spec,\nsaved field values, and merged branding. Records surface.opened\nevent on first access.","operationId":"get-surface-spec","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceSpecResponse"}}}},"401":{"description":"Invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"404":{"description":"Surface not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"409":{"description":"Already submitted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"410":{"description":"Token expired or surface archived","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/s/{token}/availability":{"get":{"tags":["Surface Patient"],"summary":"Get Availability","description":"Return available appointment slots for the surface's workspace.\n\nQueries FHIR Slot resources from world.entities that are free and\nwithin the requested date range. Token-authenticated, no Bearer auth.","operationId":"get-surface-availability","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date (YYYY-MM-DD) to start search","title":"Date"},"description":"ISO date (YYYY-MM-DD) to start search"},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":1,"description":"Number of days to search forward","default":7,"title":"Days"},"description":"Number of days to search forward"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityResponse"}}}},"401":{"description":"Invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"410":{"description":"Token expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"422":{"description":"Invalid date format","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"429":{"description":"Rate limited"}}}},"/s/{token}/book":{"post":{"tags":["Surface Patient"],"summary":"Book Appointment","description":"Submit a booking request for a specific slot.\n\nWrites a booking.requested world event tied to the surface's entity.\nToken-authenticated, no Bearer auth.","operationId":"book-surface-appointment","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingResponse"}}}},"401":{"description":"Invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"404":{"description":"Slot not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"409":{"description":"Slot unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"410":{"description":"Token expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"429":{"description":"Rate limited"}}}},"/s/{token}/heal":{"post":{"tags":["Surface Patient"],"summary":"Heal Field","description":"Auto-heal a form field value using Claude Haiku.\n\nBest-effort LLM correction — returns original value with confidence 0\nif the service is unavailable or inference fails.\nToken-authenticated, no Bearer auth.","operationId":"heal-surface-field","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealFieldRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealFieldResponse"}}}},"401":{"description":"Invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/s/{token}/submit":{"post":{"tags":["Surface Patient"],"summary":"Submit Surface","description":"Submit a patient-facing surface form.\n\nAccepts standard HTML form POST. Writes surface.submitted event\nwith confidence 0.5 (self-reported data).","operationId":"submit-surface","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Invalid token"},"409":{"description":"Already submitted"},"410":{"description":"Token expired"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/s/{token}/fields/{key}":{"put":{"tags":["Surface Patient"],"summary":"Save Field","description":"Auto-save a single field value.\n\nCalled by client-side JavaScript on field blur.\nWrites surface.field_saved event with confidence 0.5.","operationId":"save-surface-field","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FieldSaveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveFieldResponse"}}}},"401":{"description":"Invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"429":{"description":"Rate limited"},"500":{"description":"Save failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/recordings/{call_sid}/urls":{"get":{"tags":["Recordings"],"summary":"Get recording download paths","description":"Generate download paths for call recording playback. Returns separate paths for inbound (caller) and outbound (agent) audio channels, plus the recording metadata file.","operationId":"get-recording-urls","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"call_sid","in":"path","required":true,"schema":{"type":"string","title":"Call Sid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingUrlsResponse"}}}},"404":{"description":"Recording not found"},"503":{"description":"Call recording not configured"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/recordings/{call_sid}/metadata":{"get":{"tags":["Recordings"],"summary":"Get recording metadata","description":"Fetch metadata for a call recording including duration, audio formats, sample rates, and file sizes.","operationId":"get-recording-metadata","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"call_sid","in":"path","required":true,"schema":{"type":"string","title":"Call Sid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordingMetadataResponse"}}}},"404":{"description":"Recording not found"},"503":{"description":"Call recording not configured"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/recordings/{call_sid}/download/{filename}":{"get":{"tags":["Recordings"],"summary":"Download recording file","description":"Proxy download a recording file (inbound audio, outbound audio, or metadata) from UC Volume.","operationId":"download-recording-file","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"call_sid","in":"path","required":true,"schema":{"type":"string","title":"Call Sid"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string","title":"Filename"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid filename"},"404":{"description":"Recording file not found"},"503":{"description":"Call recording not configured"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/tools/execute":{"post":{"tags":["Tool Testing"],"summary":"Execute a tool in test mode","description":"Run an HSM tool outside a live session for testing.","operationId":"execute-tool-test","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolExecuteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolExecuteResponse"}}}},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid credentials."},"503":{"description":"Voice agent service unavailable."},"422":{"description":"Invalid request body."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/services/{service_id}/tools/resolve":{"get":{"tags":["Tool Testing"],"summary":"Resolve tools for a service","description":"List all tools available for a service's HSM with metadata.","operationId":"resolve-service-tools","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolResolveResponse"}}}},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid credentials."},"503":{"description":"Voice agent service unavailable."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/triggers":{"post":{"tags":["Triggers"],"summary":"Create a trigger","operationId":"create-trigger","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTriggerRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerResponse"}}}},"422":{"description":"Validation error"},"429":{"description":"Rate limited"}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Triggers"],"summary":"List triggers","operationId":"list-triggers","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_TriggerResponse_"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/triggers/{trigger_id}":{"get":{"tags":["Triggers"],"summary":"Get a trigger","operationId":"get-trigger","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Trigger Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerResponse"}}}},"429":{"description":"Rate limited"},"404":{"description":"Trigger not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Triggers"],"summary":"Update a trigger","operationId":"update-trigger","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Trigger Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTriggerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerResponse"}}}},"422":{"description":"Validation error"},"429":{"description":"Rate limited"},"404":{"description":"Trigger not found"}}},"delete":{"tags":["Triggers"],"summary":"Delete a trigger","operationId":"delete-trigger","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Trigger Id"}}],"responses":{"204":{"description":"Successful Response"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/triggers/{trigger_id}/pause":{"post":{"tags":["Triggers"],"summary":"Pause a trigger","operationId":"pause-trigger","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Trigger Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerResponse"}}}},"422":{"description":"Validation error"},"429":{"description":"Rate limited"},"404":{"description":"Trigger not found"}}}},"/v1/{workspace_id}/triggers/{trigger_id}/resume":{"post":{"tags":["Triggers"],"summary":"Resume a trigger","operationId":"resume-trigger","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Trigger Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerResponse"}}}},"422":{"description":"Validation error"},"429":{"description":"Rate limited"},"404":{"description":"Trigger not found"}}}},"/v1/{workspace_id}/triggers/{trigger_id}/fire":{"post":{"tags":["Triggers"],"summary":"Manually fire a trigger now","operationId":"fire-trigger","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Trigger Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/FireTriggerRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerFireResponse"}}}},"422":{"description":"Validation error"},"429":{"description":"Rate limited"},"404":{"description":"Trigger not found"},"503":{"description":"Trigger scheduler not initialized"}}}},"/v1/{workspace_id}/triggers/{trigger_id}/runs":{"get":{"tags":["Triggers"],"summary":"List trigger execution history","description":"Execution history from the Lakebase entity-event timeline read model.","operationId":"list-trigger-runs","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"trigger_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Trigger Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_TriggerRunResponse_"}}}},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/dashboards":{"post":{"tags":["Dashboards"],"summary":"Create Dashboard","operationId":"create_dashboard_v1__workspace_id__dashboards_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDashboardRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"get":{"tags":["Dashboards"],"summary":"List Dashboards","operationId":"list_dashboards_v1__workspace_id__dashboards_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"page_context","in":"query","required":false,"schema":{"anyOf":[{"enum":["home","patients","calls","data","analytics","pipeline","operators","surfaces","compliance","custom"],"type":"string"},{"type":"null"}],"title":"Page Context"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_DashboardDefinitionResponse_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/dashboards/{dashboard_id}":{"get":{"tags":["Dashboards"],"summary":"Get Dashboard","operationId":"get_dashboard_v1__workspace_id__dashboards__dashboard_id__get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"dashboard_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dashboard Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Dashboards"],"summary":"Update Dashboard","operationId":"update_dashboard_v1__workspace_id__dashboards__dashboard_id__put","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"dashboard_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dashboard Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDashboardRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Dashboards"],"summary":"Delete Dashboard","operationId":"delete_dashboard_v1__workspace_id__dashboards__dashboard_id__delete","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"dashboard_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dashboard Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/dashboards/by-slug/{slug}":{"get":{"tags":["Dashboards"],"summary":"Get Dashboard By Slug","operationId":"get_dashboard_by_slug_v1__workspace_id__dashboards_by_slug__slug__get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardDefinitionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/dashboards/{dashboard_id}/execute":{"post":{"tags":["Dashboards"],"summary":"Execute Dashboard","description":"Execute all panel queries and return results for rendering.\n\nSQL injection is mitigated by ResearchQueryService.execute_sql, which calls\n_validate_read_only_sql to block DROP/TRUNCATE/ALTER/CREATE/GRANT/REVOKE/\nDELETE/UPDATE/INSERT statements. Catalog-level access is further restricted\nby the service principal's Databricks grants (read-only on analytics catalog).\n\nEvery panel query MUST reference the ``:ws_id`` parameter so that\nResearchQueryService binds it to the requesting workspace. Queries\nwithout this binding are rejected to prevent cross-tenant data access.","operationId":"execute_dashboard_v1__workspace_id__dashboards__dashboard_id__execute_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"dashboard_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Dashboard Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ExecutePanelRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardExecuteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/billing/dashboard":{"get":{"tags":["Billing"],"summary":"Get Billing Dashboard","description":"Composite billing dashboard — KPIs, period comparison, top meters, invoice summary.\n\nAll computation is server-side. Frontend is a pure renderer.","operationId":"get-billing-dashboard","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingDashboardResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/billing/usage":{"get":{"tags":["Billing"],"summary":"Get Workspace Usage","description":"Aggregated billing summary — meters grouped by key, period range, totals.\n\nAll computation is server-side. Frontend is a pure renderer.","operationId":"get-billing-usage","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get-Billing-Usage"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/billing/usage/trends":{"get":{"tags":["Billing"],"summary":"Get Workspace Usage Trends","description":"Usage time-series per meter for trend charts.\n\nReturns one entry per (period, meter_key) within the date range.\nDefault: last 30 days. Use date_from/date_to for custom ranges.","operationId":"get-billing-usage-trends","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Date To"}},{"name":"meter_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Meter Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UsageTrendPoint"},"title":"Response Get-Billing-Usage-Trends"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/billing/invoices":{"get":{"tags":["Billing"],"summary":"List Workspace Invoices","description":"Paginated invoice list for this workspace's billing customer.\n\nSupports status filter and date range.","operationId":"list-billing-invoices","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["draft","sent","paid","void"],"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter invoices with period_start on or after this date","title":"Date From"},"description":"Filter invoices with period_start on or after this date"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter invoices with period_end on or before this date","title":"Date To"},"description":"Filter invoices with period_end on or before this date"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_InvoiceItem_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/billing/invoices/{invoice_id}":{"get":{"tags":["Billing"],"summary":"Get Workspace Invoice","description":"Get invoice detail — scoped to workspace's billing customer.","operationId":"get-billing-invoice","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Billing-Invoice"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/billing/invoices/{invoice_id}/pdf":{"get":{"tags":["Billing"],"summary":"Get Invoice Pdf","description":"Get presigned S3 URL for invoice PDF download — scoped to workspace's billing customer.","operationId":"get-billing-invoice-pdf","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Billing-Invoice-Pdf"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/customers":{"get":{"tags":["Billing"],"summary":"List Customers","description":"Paginated customer list with optional status filter and search.","operationId":"list-billing-customers","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["active","archived"],"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"Search by name or slug","title":"Search"},"description":"Search by name or slug"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_CustomerItem_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Billing"],"summary":"Create Customer","description":"Create a billing customer.","operationId":"create-billing-customer","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomerRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create-Billing-Customer"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/customers/{customer_id}":{"get":{"tags":["Billing"],"summary":"Get Customer","description":"Get customer detail with workspace mappings.","operationId":"get-billing-customer","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Billing-Customer"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Billing"],"summary":"Update Customer","description":"Update a billing customer.","operationId":"update-billing-customer","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update-Billing-Customer"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/customers/{customer_id}/workspaces":{"post":{"tags":["Billing"],"summary":"Attach Workspace","description":"Attach a workspace to a billing customer.","operationId":"attach-billing-workspace","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachWorkspaceRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Attach-Billing-Workspace"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/customers/{customer_id}/workspaces/{workspace_id}":{"delete":{"tags":["Billing"],"summary":"Detach Workspace","description":"Detach a workspace from a billing customer.","operationId":"detach-billing-workspace","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/customers/{customer_id}/config":{"get":{"tags":["Billing"],"summary":"Get Config","description":"Get billing configuration for a customer.","operationId":"get-billing-config","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get-Billing-Config"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Billing"],"summary":"Update Config","description":"Update billing config and price rules.","operationId":"update-billing-config","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateConfigRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update-Billing-Config"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/customers/{customer_id}/usage":{"get":{"tags":["Billing"],"summary":"Get Customer Usage","description":"Paginated meter values for a customer with date range and meter filter.","operationId":"get-customer-usage","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter meter values with period_start on or after","title":"Date From"},"description":"Filter meter values with period_start on or after"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter meter values with period_end on or before","title":"Date To"},"description":"Filter meter values with period_end on or before"},{"name":"meter_key","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Filter by meter key","title":"Meter Key"},"description":"Filter by meter key"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_MeterValueItem_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/customers/{customer_id}/invoices":{"get":{"tags":["Billing"],"summary":"List Customer Invoices","description":"Paginated invoice list for a customer with status and date filters.","operationId":"list-customer-invoices","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["draft","sent","paid","void"],"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter invoices with period_start on or after","title":"Date From"},"description":"Filter invoices with period_start on or after"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Filter invoices with period_end on or before","title":"Date To"},"description":"Filter invoices with period_end on or before"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"default":10,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_InvoiceItem_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/customers/{customer_id}/generate-invoice":{"post":{"tags":["Billing"],"summary":"Generate Invoice","description":"Generate invoice for the most recently closed billing period.\n\nReads meter_values (populated by Databricks SDP pipeline), applies\nprice rules, computes line items, creates invoice. Idempotent.","operationId":"generate-billing-invoice","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Generate-Billing-Invoice"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/customers/{customer_id}/invoices/{invoice_id}/send":{"post":{"tags":["Billing"],"summary":"Send Invoice","description":"Mark invoice as sent.","operationId":"send-billing-invoice","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Send-Billing-Invoice"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/customers/{customer_id}/invoices/{invoice_id}/paid":{"post":{"tags":["Billing"],"summary":"Mark Paid","description":"Mark invoice as paid.","operationId":"mark-billing-invoice-paid","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Mark-Billing-Invoice-Paid"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/billing/customers/{customer_id}/invoices/{invoice_id}/void":{"post":{"tags":["Billing"],"summary":"Void Invoice","description":"Void an invoice.","operationId":"void-billing-invoice","parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Customer Id"}},{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Void-Billing-Invoice"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/metering/emit":{"post":{"tags":["Metering"],"summary":"Emit Metering Event","description":"Emit one metering event for the calling workspace.","operationId":"emit-metering-event","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeteringEmitRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeteringEmitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/v1/{workspace_id}/prompt-logs":{"get":{"tags":["Prompt Logs"],"summary":"List prompt logs for a workspace","description":"Lists ``prompt_log`` events emitted by agent-engine — full system prompt, conversation history, tool catalog, LLM model, and response — for auditing and debugging. Reads the Delta ``world_events`` ledger via Databricks SQL; typical latency is 1-5s with a 15s ceiling on cold-start.\n\n**Conversation filter**: pass ``conversation_id`` for the canonical mental model. Text conversations resolve from ``world.conversations``; voice/call IDs resolve through the projected conversation entity. ``call_sid`` is the legacy direct-SID filter (Twilio CA-SID for voice, session_id UUID otherwise) and is mutually exclusive with ``conversation_id``.\n\n**Other filters**: ``prompt_type``, ``state_name``, ``from_ts``, ``to_ts``. When no selectivity-bearing filter (conversation_id / call_sid / time range) is supplied, the query is auto-capped to the last 7 days; the applied window is reported in ``applied_time_window_days``.\n\n**Pagination**: peek-ahead — ``has_more`` is true when more rows exist; use ``next_offset`` to fetch the next page.\n\n**Auth**: admin or owner role required. Reads are audit-logged (``prompt_logs.queried``); responses can include PHI from prompt history.","operationId":"list-prompt-logs","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"conversation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Conversation entity UUID (canonical identifier across all modalities — voice, text/web, sms, sim). Resolves text conversations through the durable ``world.conversations`` row, then falls back to the voice/call entity projection. Mutually exclusive with the ``call_sid`` query parameter.","title":"Conversation Id"},"description":"Conversation entity UUID (canonical identifier across all modalities — voice, text/web, sms, sim). Resolves text conversations through the durable ``world.conversations`` row, then falls back to the voice/call entity projection. Mutually exclusive with the ``call_sid`` query parameter."},{"name":"call_sid","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Direct conversation identifier as stored on the prompt-log event: Twilio CA-SID for voice calls, session_id UUID for text/sim sessions. Most callers should use ``conversation_id`` instead — this is kept for legacy callers and external systems that hold the SID directly. Mutually exclusive with ``conversation_id``.","title":"Call Sid"},"description":"Direct conversation identifier as stored on the prompt-log event: Twilio CA-SID for voice calls, session_id UUID for text/sim sessions. Most callers should use ``conversation_id`` instead — this is kept for legacy callers and external systems that hold the SID directly. Mutually exclusive with ``conversation_id``."},{"name":"prompt_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"description":"Filter by prompt_type (e.g. engage_user, navigation, tool)","title":"Prompt Type"},"description":"Filter by prompt_type (e.g. engage_user, navigation, tool)"},{"name":"state_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"description":"Filter by HSM state_name at render time","title":"State Name"},"description":"Filter by HSM state_name at render time"},{"name":"from_ts","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Inclusive lower bound on effective_at","title":"From Ts"},"description":"Inclusive lower bound on effective_at"},{"name":"to_ts","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Exclusive upper bound on effective_at","title":"To Ts"},"description":"Exclusive upper bound on effective_at"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max rows to return (default 20, max 200)","default":20,"title":"Limit"},"description":"Max rows to return (default 20, max 200)"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","maximum":10000,"minimum":0,"description":"Offset for pagination (max 10000)","default":0,"title":"Offset"},"description":"Offset for pagination (max 10000)"}],"responses":{"200":{"description":"Prompt log entries (newest first)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromptLogListResponse"}}}},"400":{"description":"Mutually exclusive filters supplied"},"403":{"description":"Caller is not admin/owner"},"404":{"description":"conversation_id does not match any conversation in this workspace"},"503":{"description":"Raw world event reads disabled or warehouse unavailable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/auth/me":{"get":{"tags":["Auth"],"summary":"Get auth info","description":"Return information about the currently authenticated API key, including expiration.","operationId":"get-auth-info","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthInfoResponse"}}}},"401":{"description":"Missing or invalid API key."}}}}},"components":{"schemas":{"AccessReviewResponse":{"properties":{"generated_at":{"type":"string","title":"Generated At"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"credentials":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Credentials"},"total_credentials":{"type":"integer","title":"Total Credentials"},"jwt_credentials_note":{"type":"string","title":"Jwt Credentials Note"}},"type":"object","required":["generated_at","workspace_id","credentials","total_credentials","jwt_credentials_note"],"title":"AccessReviewResponse"},"AccessTokenRequest":{"properties":{"call_sid":{"type":"string","maxLength":64,"minLength":1,"title":"Call Sid"}},"type":"object","required":["call_sid"],"title":"AccessTokenRequest","description":"Request to generate a Twilio AccessToken for browser-based audio."},"AccessTokenResponse":{"properties":{"token":{"type":"string","title":"Token"},"identity":{"type":"string","title":"Identity"},"conference_sid":{"type":"string","title":"Conference Sid"},"connect_params":{"additionalProperties":{"type":"string"},"type":"object","title":"Connect Params","default":{}}},"type":"object","required":["token","identity","conference_sid"],"title":"AccessTokenResponse"},"Action":{"properties":{"description":{"type":"string","title":"Description"},"filler_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filler Hint"}},"type":"object","required":["description"],"title":"Action","description":"A single action the agent can take within a state."},"ActionState-Input":{"properties":{"type":{"type":"string","const":"action","title":"Type"},"name":{"type":"string","title":"Name"},"objective":{"type":"string","title":"Objective"},"actions":{"items":{"$ref":"#/components/schemas/Action"},"type":"array","title":"Actions"},"intra_state_navigation_guidelines":{"items":{"type":"string"},"type":"array","title":"Intra State Navigation Guidelines"},"action_guidelines":{"items":{"type":"string"},"type":"array","title":"Action Guidelines"},"boundary_constraints":{"items":{"type":"string"},"type":"array","title":"Boundary Constraints"},"exit_conditions":{"items":{"$ref":"#/components/schemas/ExitCondition"},"type":"array","title":"Exit Conditions"},"action_tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Action Tool Call Specs","default":[]},"exit_condition_tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Exit Condition Tool Call Specs","default":[]},"escalation_config":{"anyOf":[{"$ref":"#/components/schemas/StateRiskOverride"},{"type":"null"}]},"wait_for":{"anyOf":[{"type":"string","enum":["surface_submission","human_approval"]},{"type":"null"}],"title":"Wait For"},"guardrails":{"items":{"$ref":"#/components/schemas/Guardrail"},"type":"array","title":"Guardrails","default":[]},"channel_overrides":{"additionalProperties":{"$ref":"#/components/schemas/ChannelOverride"},"type":"object","title":"Channel Overrides"},"surface_spec_template":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Surface Spec Template"},"turn_policy":{"anyOf":[{"$ref":"#/components/schemas/TurnPolicy"},{"type":"null"}]},"preload":{"items":{"$ref":"#/components/schemas/PreloadSpec"},"type":"array","maxItems":20,"title":"Preload"}},"type":"object","required":["type","name","objective","actions","intra_state_navigation_guidelines","action_guidelines","boundary_constraints","exit_conditions"],"title":"ActionState","description":"User-facing engagement state with actions and exit conditions."},"ActionState-Output":{"properties":{"type":{"type":"string","const":"action","title":"Type"},"name":{"type":"string","title":"Name"},"objective":{"type":"string","title":"Objective"},"actions":{"items":{"$ref":"#/components/schemas/Action"},"type":"array","title":"Actions"},"intra_state_navigation_guidelines":{"items":{"type":"string"},"type":"array","title":"Intra State Navigation Guidelines"},"action_guidelines":{"items":{"type":"string"},"type":"array","title":"Action Guidelines"},"boundary_constraints":{"items":{"type":"string"},"type":"array","title":"Boundary Constraints"},"exit_conditions":{"items":{"$ref":"#/components/schemas/ExitCondition"},"type":"array","title":"Exit Conditions"},"action_tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Action Tool Call Specs","default":[]},"exit_condition_tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Exit Condition Tool Call Specs","default":[]},"escalation_config":{"anyOf":[{"$ref":"#/components/schemas/StateRiskOverride"},{"type":"null"}]},"wait_for":{"anyOf":[{"type":"string","enum":["surface_submission","human_approval"]},{"type":"null"}],"title":"Wait For"},"guardrails":{"items":{"$ref":"#/components/schemas/Guardrail"},"type":"array","title":"Guardrails","default":[]},"channel_overrides":{"additionalProperties":{"$ref":"#/components/schemas/ChannelOverride"},"type":"object","title":"Channel Overrides"},"surface_spec_template":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Surface Spec Template"},"turn_policy":{"anyOf":[{"$ref":"#/components/schemas/TurnPolicy"},{"type":"null"}]},"preload":{"items":{"$ref":"#/components/schemas/PreloadSpec"},"type":"array","maxItems":20,"title":"Preload"}},"type":"object","required":["type","name","objective","actions","intra_state_navigation_guidelines","action_guidelines","boundary_constraints","exit_conditions"],"title":"ActionState","description":"User-facing engagement state with actions and exit conditions."},"ActiveEscalationItem":{"properties":{"call_entity_id":{"type":"string","format":"uuid","title":"Call Entity Id"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid","description":"Twilio call SID"},"escalation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Escalation Id","description":"Escalation event ID"},"status":{"type":"string","maxLength":64,"title":"Status","description":"Current escalation state"},"trigger":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger","description":"What triggered the escalation"},"trigger_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Source","description":"Source system of the trigger"},"concept":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Concept","description":"Clinical concept that triggered escalation"},"operator_type":{"anyOf":[{"type":"string","enum":["clinical","administrative","crisis_counselor"]},{"type":"null"}],"title":"Operator Type","description":"Required operator specialization"},"regulatory_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Regulatory Basis","description":"Regulatory reason for escalation"},"immediate":{"type":"boolean","title":"Immediate","description":"Whether the escalation requires immediate attention"},"risk_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Risk Score","description":"Risk score 0.0 to 1.0"},"requested_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requested At","description":"ISO-8601 timestamp when escalation was requested"},"connected_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connected At","description":"ISO-8601 timestamp when operator connected"},"wait_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Wait Seconds","description":"Seconds the caller waited for an operator"},"operator_entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Operator Entity Id","description":"Entity ID of the connected operator"},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Id","description":"Caller phone number"},"direction":{"anyOf":[{"type":"string","enum":["inbound","outbound","playground","simulated","test"]},{"type":"null"}],"title":"Direction","description":"Call direction"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Service phone number"},"started_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Started At","description":"ISO-8601 timestamp when the call started"}},"type":"object","required":["call_entity_id","status","immediate"],"title":"ActiveEscalationItem","description":"A call with an active escalation, enriched from projected state."},"ActiveSession":{"properties":{"call_sid":{"type":"string","title":"Call Sid"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"},"caller_id":{"type":"string","title":"Caller Id"},"direction":{"type":"string","title":"Direction"},"duration_seconds":{"type":"number","title":"Duration Seconds"},"current_state":{"type":"string","title":"Current State","default":""},"scenario":{"type":"string","title":"Scenario","default":""}},"type":"object","required":["call_sid","caller_id","direction","duration_seconds"],"title":"ActiveSession"},"AddColumnAction":{"properties":{"op":{"type":"string","const":"add_column","title":"Op"},"column":{"$ref":"#/components/schemas/Column-Input"}},"type":"object","required":["op","column"],"title":"AddColumnAction"},"AddIndexAction":{"properties":{"op":{"type":"string","const":"add_index","title":"Op"},"index_name":{"$ref":"#/components/schemas/IdentifierString"},"columns":{"items":{"$ref":"#/components/schemas/IdentifierString"},"type":"array","maxItems":32,"minItems":1,"title":"Columns"}},"type":"object","required":["op","index_name","columns"],"title":"AddIndexAction"},"AddUniqueAction":{"properties":{"op":{"type":"string","const":"add_unique","title":"Op"},"columns":{"items":{"$ref":"#/components/schemas/IdentifierString"},"type":"array","maxItems":32,"minItems":1,"title":"Columns"},"constraint_name":{"anyOf":[{"$ref":"#/components/schemas/IdentifierString"},{"type":"null"}]}},"type":"object","required":["op","columns"],"title":"AddUniqueAction"},"AgentAnalyticsEntry":{"properties":{"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"agent_name":{"type":"string","title":"Agent Name"},"total_calls":{"type":"integer","title":"Total Calls"},"completed_calls":{"type":"integer","title":"Completed Calls"},"avg_duration_seconds":{"type":"number","title":"Avg Duration Seconds"},"completion_rate":{"type":"number","title":"Completion Rate"}},"type":"object","required":["agent_id","agent_name","total_calls","completed_calls","avg_duration_seconds","completion_rate"],"title":"AgentAnalyticsEntry"},"AgentAnalyticsResponse":{"properties":{"agents":{"items":{"$ref":"#/components/schemas/AgentAnalyticsEntry"},"type":"array","title":"Agents"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"}},"type":"object","required":["agents"],"title":"AgentAnalyticsResponse"},"AgentResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"latest_version":{"type":"integer","title":"Latest Version","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","workspace_id","name","description","created_at","updated_at"],"title":"AgentResponse"},"AgentVersion":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"version":{"type":"integer","title":"Version"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"initials":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initials"},"identity":{"$ref":"#/components/schemas/Identity"},"background":{"type":"string","title":"Background"},"behaviors":{"items":{"type":"string"},"type":"array","title":"Behaviors"},"communication_patterns":{"items":{"type":"string"},"type":"array","title":"Communication Patterns"},"voice_config":{"anyOf":[{"$ref":"#/components/schemas/VoiceConfig"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","agent_id","version","identity","background","behaviors","communication_patterns"],"title":"AgentVersion","description":"A version of an Agent document."},"AgentVersionResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"version":{"type":"integer","title":"Version"},"name":{"type":"string","title":"Name"},"initials":{"type":"string","title":"Initials"},"identity":{"$ref":"#/components/schemas/Identity"},"voice_config":{"anyOf":[{"$ref":"#/components/schemas/VoiceConfig"},{"type":"null"}]},"background":{"type":"string","title":"Background"},"behaviors":{"items":{"type":"string"},"type":"array","title":"Behaviors"},"communication_patterns":{"items":{"type":"string"},"type":"array","title":"Communication Patterns"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","workspace_id","agent_id","version","name","initials","identity","voice_config","background","behaviors","communication_patterns","created_at","updated_at"],"title":"AgentVersionResponse"},"AlterAction":{"anyOf":[{"$ref":"#/components/schemas/AddColumnAction"},{"$ref":"#/components/schemas/DropColumnAction"},{"$ref":"#/components/schemas/RenameColumnAction"},{"$ref":"#/components/schemas/ChangeColumnTypeAction"},{"$ref":"#/components/schemas/SetColumnNullableAction"},{"$ref":"#/components/schemas/SetColumnDefaultAction"},{"$ref":"#/components/schemas/DropColumnDefaultAction"},{"$ref":"#/components/schemas/AddUniqueAction"},{"$ref":"#/components/schemas/DropConstraintAction"},{"$ref":"#/components/schemas/AddIndexAction"},{"$ref":"#/components/schemas/DropIndexAction"}]},"AnnotationState":{"properties":{"type":{"type":"string","const":"annotation","title":"Type"},"name":{"type":"string","title":"Name"},"inner_thought":{"type":"string","title":"Inner Thought"},"next_state":{"type":"string","title":"Next State"}},"type":"object","required":["type","name","inner_thought","next_state"],"title":"AnnotationState","description":"Injects a hardcoded inner thought (no LLM call)."},"AnomalyAlertResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/AnomalyAlertRow"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"AnomalyAlertResponse"},"AnomalyAlertRow":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"alert_id":{"type":"string","title":"Alert Id"},"slice_label":{"type":"string","title":"Slice Label"},"mechanism":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mechanism"},"severity":{"anyOf":[{"type":"string","enum":["high","medium","low"]},{"type":"null"}],"title":"Severity"},"priority_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Priority Score"},"detected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Detected At"},"narrative":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Narrative"},"stats_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stats Json"},"decomposition_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decomposition Json"},"actions_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actions Json"},"projection_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Projection Json"}},"type":"object","required":["workspace_id","alert_id","slice_label"],"title":"AnomalyAlertRow"},"ApiKeyResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"created_by_entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By Entity Id"},"created_by_credential_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By Credential Id"},"key_id":{"type":"string","title":"Key Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"role":{"type":"string","title":"Role"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","workspace_id","created_by_entity_id","created_by_credential_id","key_id","name","role","permissions","expires_at","last_used_at","created_at","updated_at"],"title":"ApiKeyResponse"},"ApproveRequest":{"properties":{"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","title":"ApproveRequest","description":"Approve events — promotes confidence to 0.95."},"ArchiveResponse":{"properties":{"surface_id":{"type":"string","format":"uuid","title":"Surface Id"},"status":{"type":"string","const":"archived","title":"Status"}},"type":"object","required":["surface_id","status"],"title":"ArchiveResponse"},"ArchiveWorkspaceRequest":{"properties":{"slug":{"$ref":"#/components/schemas/SlugString"}},"type":"object","required":["slug"],"title":"ArchiveWorkspaceRequest"},"AttachWorkspaceRequest":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"environment":{"type":"string","enum":["production","staging","development"],"title":"Environment","default":"production"},"billable":{"type":"boolean","title":"Billable","default":true}},"type":"object","required":["workspace_id"],"title":"AttachWorkspaceRequest"},"AuditEventsListResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/src__routes__audit__AuditEventResponse"},"type":"array","title":"Events"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["events","total","limit","offset","has_more"],"title":"AuditEventsListResponse"},"AuditExportListItem":{"properties":{"key":{"type":"string","title":"Key"},"size":{"type":"integer","title":"Size"},"last_modified":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Modified"},"download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Download Url"}},"type":"object","required":["key","size"],"title":"AuditExportListItem"},"AuditExportListResponse":{"properties":{"exports":{"items":{"$ref":"#/components/schemas/AuditExportListItem"},"type":"array","title":"Exports"}},"type":"object","required":["exports"],"title":"AuditExportListResponse"},"AuditExportRequest":{"properties":{"date_from":{"type":"string","format":"date-time","title":"Date From"},"date_to":{"type":"string","format":"date-time","title":"Date To"},"service":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Service","description":"Filter by service name."},"action":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Action","description":"Filter by action type."},"phi_only":{"type":"boolean","title":"Phi Only","default":false}},"type":"object","required":["date_from","date_to"],"title":"AuditExportRequest"},"AuditExportResponse":{"properties":{"export_id":{"type":"string","title":"Export Id"},"s3_key":{"type":"string","title":"S3 Key"},"row_count":{"type":"integer","title":"Row Count"},"download_url":{"type":"string","title":"Download Url"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["export_id","s3_key","row_count","download_url","created_at"],"title":"AuditExportResponse"},"AuditSummary":{"properties":{"event_count":{"type":"integer","title":"Event Count","default":0},"latest_event":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Latest Event"}},"type":"object","title":"AuditSummary"},"AuditSummaryResponse":{"properties":{"total_events":{"type":"integer","title":"Total Events"},"phi_access_events":{"type":"integer","title":"Phi Access Events"},"unique_actors":{"type":"integer","title":"Unique Actors"},"services_with_events":{"type":"integer","title":"Services With Events"}},"type":"object","required":["total_events","phi_access_events","unique_actors","services_with_events"],"title":"AuditSummaryResponse"},"AuthInfoResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"key_id":{"type":"string","title":"Key Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds"}},"type":"object","required":["workspace_id","key_id","name","expires_at","expires_in_seconds"],"title":"AuthInfoResponse"},"AvailabilityDate":{"properties":{"date":{"type":"string","maxLength":16,"title":"Date"},"slots":{"items":{"$ref":"#/components/schemas/AvailabilitySlot"},"type":"array","maxItems":200,"title":"Slots"}},"type":"object","required":["date"],"title":"AvailabilityDate"},"AvailabilityResponse":{"properties":{"dates":{"items":{"$ref":"#/components/schemas/AvailabilityDate"},"type":"array","maxItems":64,"title":"Dates"}},"type":"object","title":"AvailabilityResponse","description":"Available appointment slots grouped by date."},"AvailabilitySlot":{"properties":{"id":{"type":"string","maxLength":128,"title":"Id"},"start":{"type":"string","maxLength":16,"title":"Start"},"end":{"type":"string","maxLength":16,"title":"End"},"provider":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Provider"}},"type":"object","required":["id","start","end"],"title":"AvailabilitySlot"},"BackgroundString":{"type":"string","maxLength":10000},"BargeInEvent":{"properties":{"type":{"const":"barge_in","default":"barge_in","title":"Type","type":"string"},"interrupted_text":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Interrupted Text","x-phi":true},"discarded_texts":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"title":"Discarded Texts","x-phi":true},"interrupted_speaker_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Interrupted Speaker Id"},"interrupting_speaker_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Interrupting Speaker Id"},"total_barge_ins":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total Barge Ins"}},"title":"BargeInEvent","type":"object"},"BatchActionResponse":{"properties":{"succeeded":{"items":{"type":"string"},"type":"array","title":"Succeeded"},"failed":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Failed"}},"type":"object","required":["succeeded","failed"],"title":"BatchActionResponse","description":"Result of a batch operation."},"BatchApproveRequest":{"properties":{"item_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":100,"minItems":1,"title":"Item Ids"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","required":["item_ids"],"title":"BatchApproveRequest","description":"Batch approve multiple review items."},"BatchRejectRequest":{"properties":{"item_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":100,"minItems":1,"title":"Item Ids"},"reason":{"type":"string","maxLength":2000,"minLength":1,"title":"Reason"}},"type":"object","required":["item_ids","reason"],"title":"BatchRejectRequest","description":"Batch reject multiple review items."},"BillingDashboardResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id","description":"Workspace ID"},"current_period_total":{"type":"number","title":"Current Period Total","description":"Total billing for the current period"},"previous_period_total":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Previous Period Total","description":"Total billing for the previous period"},"delta_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Delta Pct","description":"Percentage change from previous period"},"top_meters":{"items":{"$ref":"#/components/schemas/MeterSummary"},"type":"array","title":"Top Meters","description":"Top meters by value"},"invoice_status_summary":{"additionalProperties":{"type":"integer"},"type":"object","title":"Invoice Status Summary","description":"Invoice counts by status"},"period_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Start","description":"Current period start date (ISO-8601)"},"period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period End","description":"Current period end date (ISO-8601)"}},"type":"object","required":["workspace_id","current_period_total","previous_period_total","delta_pct","top_meters","invoice_status_summary","period_start","period_end"],"title":"BillingDashboardResponse"},"Body_voice-turn":{"properties":{"audio":{"type":"string","contentMediaType":"application/octet-stream","title":"Audio"},"phone_number":{"type":"string","maxLength":16,"pattern":"^\\+[1-9]\\d{1,14}$","title":"Phone Number"}},"type":"object","required":["audio","phone_number"],"title":"Body_voice-turn"},"BookingRequest":{"properties":{"slot_id":{"type":"string","maxLength":256,"minLength":1,"title":"Slot Id","description":"The FHIR Slot ID to book"}},"type":"object","required":["slot_id"],"title":"BookingRequest"},"BookingResponse":{"properties":{"status":{"type":"string","const":"pending","title":"Status","description":"Booking lifecycle status."},"message":{"type":"string","maxLength":512,"title":"Message"},"slot_id":{"type":"string","maxLength":256,"title":"Slot Id"}},"type":"object","required":["status","message","slot_id"],"title":"BookingResponse","description":"Acknowledgement returned when a booking request is accepted."},"BooleanMetricValueResponse":{"properties":{"metric_key":{"type":"string","title":"Metric Key"},"source":{"type":"string","title":"Source","default":"production"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"service_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Id"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"event_count":{"type":"integer","title":"Event Count"},"avg_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Confidence"},"unit":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Unit"},"computed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Computed At"},"metric_type":{"type":"string","const":"boolean","title":"Metric Type"},"value":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Value"}},"type":"object","required":["metric_key","period_start","period_end","event_count","metric_type","value"],"title":"BooleanMetricValueResponse"},"BrandingConfig":{"properties":{"logo_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Logo Url"},"primary_color":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Primary Color"},"background_color":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Background Color"},"font_family":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Font Family"}},"type":"object","title":"BrandingConfig","description":"Visual branding for patient-facing surfaces."},"BrandingSettingsRequest":{"properties":{"branding":{"$ref":"#/components/schemas/BrandingConfig"}},"type":"object","required":["branding"],"title":"BrandingSettingsRequest","description":"Update workspace branding. All fields are optional — only provided\nfields are changed."},"BrandingSettingsResponse":{"properties":{"branding":{"$ref":"#/components/schemas/BrandingConfig"}},"type":"object","required":["branding"],"title":"BrandingSettingsResponse"},"BridgePlanRequest":{"properties":{"service_id":{"type":"string","format":"uuid","title":"Service Id"},"objective":{"type":"string","maxLength":2000,"minLength":1,"title":"Objective"}},"type":"object","required":["service_id","objective"],"title":"BridgePlanRequest"},"BridgePlanResponse":{"properties":{"target_spec":{"$ref":"#/components/schemas/TargetSpec"},"rationale":{"type":"string","maxLength":1000,"title":"Rationale"},"available_states":{"items":{"type":"string","maxLength":128},"type":"array","maxItems":200,"title":"Available States"},"available_tools":{"items":{"type":"string","maxLength":128},"type":"array","maxItems":200,"title":"Available Tools"}},"type":"object","required":["target_spec","rationale"],"title":"BridgePlanResponse"},"BridgeRequest":{"properties":{"service_id":{"type":"string","format":"uuid","title":"Service Id"},"objective":{"type":"string","maxLength":2000,"minLength":1,"title":"Objective"},"num_scenarios":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Num Scenarios","default":5},"max_turns":{"type":"integer","maximum":40.0,"minimum":1.0,"title":"Max Turns","default":20},"concurrency":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"Concurrency","default":3},"branch_name":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Branch Name"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id","description":"Optional world entity UUID to bind caller context for every scenario session created by this bridge run. The value is forwarded to each scenario's session-create call and inherited by any forks; identical precedence rules apply per-session (entity match wins over phone, stale UUID falls back to phone lookup, malformed UUID returns 422). Use this to pin an entire regression suite to a specific test patient."},"tags":{"items":{"type":"string","maxLength":128},"type":"array","maxItems":20,"title":"Tags"},"target_spec":{"anyOf":[{"$ref":"#/components/schemas/TargetSpec"},{"type":"null"}]},"exploration":{"anyOf":[{"$ref":"#/components/schemas/ExplorationConfig"},{"type":"null"}]},"auto_target_spec":{"type":"boolean","title":"Auto Target Spec","default":false},"async_generation":{"type":"boolean","title":"Async Generation","default":false}},"type":"object","required":["service_id","objective"],"title":"BridgeRequest"},"BridgeResponse":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"status":{"type":"string","enum":["running","completed","failed"],"title":"Status"},"scenarios":{"items":{"$ref":"#/components/schemas/Scenario"},"type":"array","title":"Scenarios"},"case_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Case Ids"},"inferred_target_spec":{"anyOf":[{"$ref":"#/components/schemas/TargetSpec"},{"type":"null"}]},"inferred_target_spec_rationale":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Inferred Target Spec Rationale"}},"type":"object","required":["run_id","status","scenarios"],"title":"BridgeResponse"},"BriefResponse":{"properties":{"event_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Event Id"},"target_entity_id":{"type":"string","format":"uuid","title":"Target Entity Id"},"target_entity_type":{"type":"string","enum":["patient","cohort","workspace","territory","emirate","district"],"title":"Target Entity Type"},"content_md":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}],"title":"Content Md"},"content_json":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Content Json"},"version":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Version"},"evidence_event_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":500,"title":"Evidence Event Ids"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"},"event_count":{"type":"integer","minimum":0.0,"title":"Event Count"},"model_name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Model Name"},"truncated":{"type":"boolean","title":"Truncated","default":false},"generated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Generated At"}},"type":"object","required":["event_id","target_entity_id","target_entity_type","content_json","confidence","event_count","generated_at"],"title":"BriefResponse","description":"Wire shape for a Self-Image brief.\n\n``event_id`` is null when no brief has ever been generated for the\nentity. All other fields are nullable in that case so the UI can\nrender a consistent empty state."},"BriefingRequest":{"properties":{"call_sid":{"type":"string","maxLength":64,"minLength":1,"title":"Call Sid"}},"type":"object","required":["call_sid"],"title":"BriefingRequest","description":"Request for operator briefing on a specific call."},"BriefingResponse":{"properties":{"call_sid":{"type":"string","title":"Call Sid"},"operator_id":{"type":"string","format":"uuid","title":"Operator Id"},"sections":{"items":{"$ref":"#/components/schemas/BriefingSection"},"type":"array","title":"Sections"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"}},"type":"object","required":["call_sid","operator_id","sections","generated_at"],"title":"BriefingResponse","description":"Structured operator briefing for a call."},"BriefingSection":{"properties":{"title":{"type":"string","title":"Title"},"content":{"type":"string","title":"Content"}},"type":"object","required":["title","content"],"title":"BriefingSection","description":"A named section of the operator briefing."},"CallDetailResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid"},"workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Id","x-phi":true},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","x-phi":true},"direction":{"anyOf":[{"type":"string","enum":["inbound","outbound","playground","simulated","test"]},{"type":"null"}],"title":"Direction"},"status":{"type":"string","title":"Status","default":"completed"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"call_start_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Call Start Time"},"call_end_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Call End Time"},"call_duration_seconds":{"type":"number","title":"Call Duration Seconds","default":0.0},"media_start_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Media Start Time"},"config":{"anyOf":[{"$ref":"#/components/schemas/ConversationConfig"},{"type":"null"}]},"turns":{"items":{"$ref":"#/components/schemas/Turn"},"type":"array","title":"Turns","default":[]},"states_visited":{"items":{"type":"string"},"type":"array","title":"States Visited","default":[]},"final_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final State"},"triggered_behaviors":{"items":{"type":"string"},"type":"array","title":"Triggered Behaviors","default":[]},"completion_reason":{"anyOf":[{"type":"string","enum":["completed","abandoned","escalated","transferred","timeout","error","voicemail","no_answer","caller_hangup","forwarded","terminal_state","warm_transfer_completed","no_inbound_audio","cancelled"]},{"type":"null"}],"title":"Completion Reason"},"emotional_summary":{"anyOf":[{"$ref":"#/components/schemas/EmotionalSummary"},{"type":"null"}]},"forwarding":{"anyOf":[{"$ref":"#/components/schemas/ForwardingDetails"},{"type":"null"}]},"conference_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conference Sid"},"participants":{"items":{"$ref":"#/components/schemas/Participant"},"type":"array","title":"Participants","default":[]},"barge_in_events":{"items":{"$ref":"#/components/schemas/BargeInEvent"},"type":"array","title":"Barge In Events","default":[]},"recording_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Path"},"twilio_recording_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Twilio Recording Sid"},"twilio_recording_duration":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Twilio Recording Duration"},"has_recording":{"type":"boolean","title":"Has Recording","default":false},"timeline":{"anyOf":[{"$ref":"#/components/schemas/PlaybackTimeline"},{"type":"null"}]},"verified_transcript":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verified Transcript"},"verified_words":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Verified Words"},"transcript_accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Transcript Accuracy"},"per_turn_accuracy":{"anyOf":[{"items":{"anyOf":[{"type":"number"},{"type":"null"}]},"type":"array"},{"type":"null"}],"title":"Per Turn Accuracy"},"call_analysis":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Call Analysis"},"source":{"anyOf":[{"type":"string","enum":["real","simulation","playground"]},{"type":"null"}],"title":"Source"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"score_rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Score Rationale"},"parent_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Session Id"},"fork_turn_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fork Turn Index"},"escalation":{"anyOf":[{"$ref":"#/components/schemas/EscalationState"},{"type":"null"}]},"safety":{"anyOf":[{"$ref":"#/components/schemas/SafetyState"},{"type":"null"}]},"human_segments":{"items":{"$ref":"#/components/schemas/HumanSegment"},"type":"array","title":"Human Segments","default":[]},"audit":{"anyOf":[{"$ref":"#/components/schemas/AuditSummary"},{"type":"null"}]},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score"},"conversation_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Conversation Summary"},"safety_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Safety Summary"}},"type":"object","required":["id"],"title":"CallDetailResponse","description":"Full call detail — the canonical response for GET /calls/{call_id}.\n\nThis is the single source of truth for the call detail shape. The OpenAPI\nspec is generated from this model. The SDK TypeScript types are generated\nfrom the spec. The developer-console consumes SDK types directly."},"CallIntelligenceDetail":{"properties":{"call_id":{"type":"string","title":"Call Id","description":"World entity ID for the call"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid","description":"Twilio call SID"},"direction":{"type":"string","enum":["inbound","outbound","playground","simulated","test"],"title":"Direction","description":"Call direction","default":"inbound"},"duration_seconds":{"type":"number","title":"Duration Seconds","description":"Call duration in seconds","default":0.0},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score","description":"Quality score 0.0 to 1.0"},"quality_breakdown":{"anyOf":[{"$ref":"#/components/schemas/QualityBreakdown"},{"type":"null"}],"description":"Detailed quality breakdown"},"key_moments":{"items":{"$ref":"#/components/schemas/KeyMoment"},"type":"array","title":"Key Moments","description":"Notable call events"},"emotion_summary":{"anyOf":[{"$ref":"#/components/schemas/EmotionSummary"},{"type":"null"}],"description":"Emotional analysis"},"risk_summary":{"anyOf":[{"$ref":"#/components/schemas/RiskSummary"},{"type":"null"}],"description":"Risk assessment"},"latency_summary":{"anyOf":[{"$ref":"#/components/schemas/LatencySummary"},{"type":"null"}],"description":"Audio latency metrics"},"conversation_summary":{"anyOf":[{"$ref":"#/components/schemas/src__routes__calls__ConversationSummary"},{"type":"null"}],"description":"Conversation flow metrics"},"tool_summary":{"anyOf":[{"$ref":"#/components/schemas/ToolSummary"},{"type":"null"}],"description":"Tool usage statistics"},"safety_summary":{"anyOf":[{"$ref":"#/components/schemas/SafetySummary"},{"type":"null"}],"description":"Safety filter results"},"operator_summary":{"anyOf":[{"$ref":"#/components/schemas/OperatorIntelligenceSummary"},{"type":"null"}],"description":"Operator intervention"},"completion_reason":{"anyOf":[{"type":"string","enum":["completed","abandoned","escalated","transferred","timeout","error","voicemail","no_answer","caller_hangup","forwarded","terminal_state","warm_transfer_completed","no_inbound_audio","cancelled"]},{"type":"null"}],"title":"Completion Reason","description":"Why the call ended"},"final_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final State","description":"Final conversation state name"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When intelligence was computed"}},"type":"object","required":["call_id"],"title":"CallIntelligenceDetail","description":"Layer 4 (Narrative) intelligence for a completed call.\n\nAggregated summaries, quality breakdown, and key moments — the\ninterpretive layer. Per-turn visualization data lives on the unified\ntimeline (call detail → PlaybackTimeline.segments), not here."},"CallIntelligenceMetricProjectionRequest":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"call_sid":{"type":"string","maxLength":128,"minLength":1,"title":"Call Sid"},"service_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Service Id"},"direction":{"type":"string","enum":["inbound","outbound","playground","simulated","test"],"title":"Direction"},"duration_seconds":{"type":"number","minimum":0.0,"title":"Duration Seconds"},"quality_score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Quality Score"},"completion_reason":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Completion Reason"},"final_state":{"type":"string","maxLength":256,"title":"Final State","default":""},"source":{"type":"string","enum":["real","simulation","playground"],"title":"Source"},"channel_kind":{"type":"string","maxLength":32,"minLength":1,"title":"Channel Kind","default":"voice"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"call_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Call Id"},"run_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Run Id"},"session_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Session Id"},"emotion_summary":{"additionalProperties":true,"type":"object","title":"Emotion Summary"},"risk_summary":{"additionalProperties":true,"type":"object","title":"Risk Summary"},"latency_summary":{"additionalProperties":true,"type":"object","title":"Latency Summary"},"conversation_summary":{"additionalProperties":true,"type":"object","title":"Conversation Summary"},"tool_summary":{"additionalProperties":true,"type":"object","title":"Tool Summary"},"safety_summary":{"additionalProperties":true,"type":"object","title":"Safety Summary"},"operator_summary":{"additionalProperties":true,"type":"object","title":"Operator Summary"},"simulation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Simulation"}},"additionalProperties":false,"type":"object","required":["workspace_id","call_sid","direction","duration_seconds","quality_score","source","created_at"],"title":"CallIntelligenceMetricProjectionRequest","description":"Internal projection request for the shared terminal artifact."},"CallListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CallSummary"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"}},"type":"object","required":["items","total","has_more"],"title":"CallListResponse"},"CallStatsResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id","description":"Workspace identifier"},"period_start":{"type":"string","format":"date","title":"Period Start","description":"Start of the reporting period"},"period_end":{"type":"string","format":"date","title":"Period End","description":"End of the reporting period"},"total_calls":{"type":"integer","title":"Total Calls","description":"Total number of calls in the period"},"total_duration_seconds":{"type":"number","title":"Total Duration Seconds","description":"Sum of all call durations in seconds"},"avg_duration_seconds":{"type":"number","title":"Avg Duration Seconds","description":"Average call duration in seconds"},"calls_by_date":{"items":{"$ref":"#/components/schemas/DailyCallStat"},"type":"array","title":"Calls By Date","description":"Daily call volume breakdown"}},"type":"object","required":["workspace_id","period_start","period_end","total_calls","total_duration_seconds","avg_duration_seconds","calls_by_date"],"title":"CallStatsResponse"},"CallSummary":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id","description":"World entity ID for this call"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid","description":"Twilio call SID"},"direction":{"anyOf":[{"type":"string","enum":["inbound","outbound","playground","simulated","test"]},{"type":"null"}],"title":"Direction","description":"Call direction"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"Service phone number"},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Id","description":"Caller phone number"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At","description":"When the call started"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds","description":"Call duration in seconds"},"status":{"anyOf":[{"type":"string","enum":["initiated","ringing","in-progress","completed","busy","no-answer","canceled","failed","unknown"]},{"type":"null"}],"title":"Status","description":"Call status"},"escalation_status":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Escalation Status","description":"Escalation state if any"},"turns":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Turns","description":"Number of conversation turns"},"has_recording":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Recording","description":"Whether a recording is available"},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score","description":"Quality score 0.0 to 1.0"},"final_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final State","description":"Final conversation state"},"completion_reason":{"anyOf":[{"type":"string","enum":["completed","abandoned","escalated","transferred","timeout","error","voicemail","no_answer","caller_hangup","forwarded","terminal_state","warm_transfer_completed","no_inbound_audio","cancelled"]},{"type":"null"}],"title":"Completion Reason","description":"Why the call ended"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id","description":"Service ID that handled the call"},"source":{"anyOf":[{"type":"string","enum":["real","simulation","playground"]},{"type":"null"}],"title":"Source","description":"Call source — real, simulation, or playground"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id","description":"Simulation run ID (simulation calls only)"},"parent_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Session Id","description":"Parent session for forked simulations"},"fork_turn_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Fork Turn Index","description":"Turn index where simulation forked"}},"type":"object","required":["entity_id"],"title":"CallSummary"},"CallTranscriptResponse":{"properties":{"call_entity_id":{"type":"string","format":"uuid","title":"Call Entity Id"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid"},"total_segments":{"type":"integer","title":"Total Segments"},"segments":{"items":{"$ref":"#/components/schemas/TranscriptSegment"},"type":"array","title":"Segments"}},"type":"object","required":["call_entity_id","call_sid","total_segments","segments"],"title":"CallTranscriptResponse"},"CanonicalIdLookupString":{"type":"string","maxLength":256,"minLength":1},"CanonicalIdString":{"type":"string","maxLength":256,"minLength":3,"pattern":"^[A-Za-z0-9._-]+:[A-Za-z0-9._-]+:[A-Za-z0-9._-]+$"},"CatalogEntry":{"properties":{"name":{"type":"string","title":"Name"},"layer":{"type":"string","title":"Layer"},"description":{"type":"string","title":"Description"},"row_count":{"type":"integer","title":"Row Count"},"exists":{"type":"boolean","title":"Exists"}},"type":"object","required":["name","layer","description","row_count","exists"],"title":"CatalogEntry"},"CategoricalMetricValueResponse":{"properties":{"metric_key":{"type":"string","title":"Metric Key"},"source":{"type":"string","title":"Source","default":"production"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"service_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Id"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"event_count":{"type":"integer","title":"Event Count"},"avg_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Confidence"},"unit":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Unit"},"computed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Computed At"},"metric_type":{"type":"string","const":"categorical","title":"Metric Type"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"}},"type":"object","required":["metric_key","period_start","period_end","event_count","metric_type","value"],"title":"CategoricalMetricValueResponse"},"ChangeColumnTypeAction":{"properties":{"op":{"type":"string","const":"change_column_type","title":"Op"},"name":{"$ref":"#/components/schemas/IdentifierString"},"new_type":{"$ref":"#/components/schemas/ColumnType"}},"type":"object","required":["op","name","new_type"],"title":"ChangeColumnTypeAction"},"ChannelEventRequest":{"properties":{"channel":{"$ref":"#/components/schemas/ChannelKind"},"event_type":{"type":"string","maxLength":64,"title":"Event Type"},"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"email_id":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Email Id"},"to_address":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"To Address"},"from_address":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"From Address"},"phone_number":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Phone Number"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"},"data":{"additionalProperties":true,"type":"object","title":"Data"}},"type":"object","required":["channel","event_type","use_case_id","occurred_at"],"title":"ChannelEventRequest"},"ChannelEventResponse":{"properties":{"status":{"type":"string","enum":["accepted","skipped"],"title":"Status"},"event_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Event Id"}},"type":"object","required":["status"],"title":"ChannelEventResponse"},"ChannelKind":{"type":"string","enum":["voice","sms","whatsapp","email","web","imessage"],"title":"ChannelKind","description":"HSM execution channel type.\n\nDetermines how the HSM engine communicates with end users.\nEach kind maps to one or more providers."},"ChannelOverride":{"properties":{"objective":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Objective"},"action_guidelines":{"items":{"type":"string"},"type":"array","title":"Action Guidelines","default":[]},"progress":{"anyOf":[{"$ref":"#/components/schemas/ProgressHint"},{"type":"null"}]}},"type":"object","title":"ChannelOverride","description":"Per-channel behavior override for a state."},"ChannelType":{"type":"string","enum":["email","web","sms"],"title":"ChannelType","description":"Delivery channels for surfaces."},"ChatRequest":{"properties":{"message":{"type":"string","maxLength":16000,"minLength":1,"title":"Message","description":"Insights chat user message."}},"type":"object","required":["message"],"title":"ChatRequest"},"ClaimResponse":{"properties":{"id":{"type":"string","title":"Id"},"assigned_to":{"type":"string","title":"Assigned To"},"status":{"type":"string","title":"Status"}},"type":"object","required":["id","assigned_to","status"],"title":"ClaimResponse"},"ClientConfigResponse":{"properties":{"google_maps_api_key":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Google Maps Api Key"}},"type":"object","title":"ClientConfigResponse","description":"Client-safe configuration values.\n\nValues returned here are safe to embed in browser-side code.\nAPI keys are restricted by HTTP referrer or similar origin\ncontrols at the provider level."},"ClinicOpenHoursParams":{"properties":{"rule_kind":{"type":"string","const":"clinic_open_hours","title":"Rule Kind","default":"clinic_open_hours"},"timezone":{"type":"string","maxLength":64,"minLength":1,"title":"Timezone"},"monday":{"anyOf":[{"$ref":"#/components/schemas/_DayHours"},{"type":"null"}]},"tuesday":{"anyOf":[{"$ref":"#/components/schemas/_DayHours"},{"type":"null"}]},"wednesday":{"anyOf":[{"$ref":"#/components/schemas/_DayHours"},{"type":"null"}]},"thursday":{"anyOf":[{"$ref":"#/components/schemas/_DayHours"},{"type":"null"}]},"friday":{"anyOf":[{"$ref":"#/components/schemas/_DayHours"},{"type":"null"}]},"saturday":{"anyOf":[{"$ref":"#/components/schemas/_DayHours"},{"type":"null"}]},"sunday":{"anyOf":[{"$ref":"#/components/schemas/_DayHours"},{"type":"null"}]}},"type":"object","required":["timezone"],"title":"ClinicOpenHoursParams","description":"Workspace clinic open-hours by weekday.\n\nDays not present mean \"closed.\" Used by the rules engine to skip\nslots outside open hours and (combined with ``weekend_skip``) by the\nTMS-mapping release calculator."},"ClusterForecastPointRow":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"cluster_name":{"type":"string","title":"Cluster Name"},"focus_area":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Focus Area"},"t":{"type":"number","title":"T"},"median":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Median"},"lower_95":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lower 95"},"upper_95":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Upper 95"},"observed":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Observed"},"ym":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ym"},"is_historical":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Historical"}},"type":"object","required":["workspace_id","cluster_name","t"],"title":"ClusterForecastPointRow"},"ClusterForecastResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/ClusterForecastPointRow"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"ClusterForecastResponse"},"ClusterSummaryResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/ClusterSummaryRow"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"ClusterSummaryResponse"},"ClusterSummaryRow":{"properties":{"cluster_name":{"type":"string","title":"Cluster Name"},"cohort_size":{"type":"integer","title":"Cohort Size"},"mean_age":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mean Age"},"mean_bmi":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mean Bmi"},"mean_hba1c":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mean Hba1C"},"pct_male":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pct Male"},"pct_prediabetes":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pct Prediabetes"},"pct_t2d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pct T2D"},"mean_y_hat":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mean Y Hat"}},"type":"object","required":["cluster_name","cohort_size"],"title":"ClusterSummaryRow"},"CoachingItem":{"properties":{"moment_timestamp":{"anyOf":[{"type":"number","maximum":86400.0,"minimum":0.0},{"type":"null"}],"title":"Moment Timestamp","description":"Position in the recording this coaching applies to (seconds)"},"observation":{"type":"string","maxLength":2000,"minLength":1,"title":"Observation","description":"What was observed in the audio at this moment"},"recommendation":{"type":"string","maxLength":2000,"minLength":1,"title":"Recommendation","description":"Specific improvement the agent should make"},"expected_impact":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Expected Impact","description":"How this improvement would change the interaction"}},"type":"object","required":["observation","recommendation"],"title":"CoachingItem","description":"A specific, actionable improvement tied to an exact moment in the call."},"CollectionField":{"properties":{"key":{"type":"string","title":"Key"},"type":{"type":"string","title":"Type"},"label":{"type":"string","title":"Label"},"required":{"type":"boolean","title":"Required","default":true},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options"},"validation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Validation"},"ask_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ask Prompt"},"fhir_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fhir Path"}},"type":"object","required":["key","type","label"],"title":"CollectionField","description":"A single field to collect during a data collection state."},"Column-Input":{"properties":{"name":{"$ref":"#/components/schemas/IdentifierString"},"type":{"$ref":"#/components/schemas/ColumnType"},"nullable":{"type":"boolean","title":"Nullable","default":true},"default":{"anyOf":[{"$ref":"#/components/schemas/Default"},{"type":"null"}]}},"type":"object","required":["name","type"],"title":"Column"},"Column-Output":{"properties":{"name":{"type":"string","title":"Name"},"data_type":{"type":"string","title":"Data Type","description":"Postgres-side type as reported by ``information_schema.columns``\n(e.g. ``uuid``, ``text``, ``timestamp with time zone``)."},"is_nullable":{"type":"boolean","title":"Is Nullable"},"default":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default","description":"Postgres-side default expression text, or NULL if no DEFAULT."}},"type":"object","required":["name","data_type","is_nullable","default"],"title":"Column"},"ColumnInfo":{"properties":{"column_name":{"type":"string","title":"Column Name"},"data_type":{"type":"string","title":"Data Type"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","required":["column_name","data_type"],"title":"ColumnInfo"},"ColumnType":{"type":"string","enum":["text","int","bigint","numeric","boolean","uuid","timestamptz","date","time","jsonb","bytea"]},"ColumnsResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/ColumnInfo"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"ColumnsResponse"},"CommandCenterAlert":{"properties":{"level":{"type":"string","enum":["info","warning","critical"],"title":"Level"},"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"},"section":{"type":"string","title":"Section"}},"type":"object","required":["level","code","message","section"],"title":"CommandCenterAlert"},"CommandCenterResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"voice":{"$ref":"#/components/schemas/VoiceMetrics","default":{"active_calls":0,"active_escalated":0,"calls_today":0,"escalation_rate_today":0.0}},"pipeline":{"$ref":"#/components/schemas/PipelineMetrics","default":{"sources_total":0,"sources_healthy":0,"sources_degraded":0,"sources_failing":0,"events_last_hour":0,"outbound_pending":0,"outbound_failed":0,"connector_status":"unavailable"}},"data_quality":{"$ref":"#/components/schemas/DataQualityMetrics","default":{"pending_reviews":0,"entities_total":0,"entities_merged_7d":0}},"identity":{"$ref":"#/components/schemas/IdentityMetrics","default":{"active_api_keys":0}},"alerts":{"items":{"$ref":"#/components/schemas/CommandCenterAlert"},"type":"array","title":"Alerts","default":[]},"degraded_sections":{"items":{"type":"string"},"type":"array","title":"Degraded Sections","default":[]},"generated_at":{"type":"string","title":"Generated At"},"cached":{"type":"boolean","title":"Cached","default":false}},"type":"object","required":["workspace_id","generated_at"],"title":"CommandCenterResponse"},"CompletionCriteria":{"properties":{"state_based":{"items":{"type":"string","maxLength":128},"type":"array","maxItems":50,"title":"State Based"},"tool_based":{"items":{"type":"string","maxLength":128},"type":"array","maxItems":50,"title":"Tool Based"}},"type":"object","title":"CompletionCriteria"},"ComplianceDashboardResponse":{"properties":{"hipaa_status":{"type":"string","title":"Hipaa Status"},"retention_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Retention Days"},"legal_hold":{"type":"boolean","title":"Legal Hold"},"total_credentials":{"type":"integer","title":"Total Credentials"},"active_credentials":{"type":"integer","title":"Active Credentials"},"last_audit_export":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Audit Export"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["hipaa_status","retention_days","legal_hold","total_credentials","active_credentials","last_audit_export","generated_at"],"title":"ComplianceDashboardResponse","description":"Composite compliance health overview."},"ConceptMatch":{"properties":{"concept":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Concept"},"similarity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Similarity"},"agent_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Action"},"agent_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Agent Confidence"},"agent_reasoning":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Reasoning"},"at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"At"}},"type":"object","title":"ConceptMatch"},"ConcurrentStartBlockParams":{"properties":{"rule_kind":{"type":"string","const":"concurrent_start_block","title":"Rule Kind","default":"concurrent_start_block"}},"type":"object","title":"ConcurrentStartBlockParams","description":"Disallow two slots starting at the same time within a TMS scope.\nNo additional params — the discriminator is the whole config."},"ConfidenceBucket":{"properties":{"confidence_range":{"type":"string","title":"Confidence Range","description":"Confidence level bucket label (e.g. 'raw', 'verified', 'authoritative')"},"count":{"type":"integer","title":"Count","description":"Number of events in this confidence bucket"}},"type":"object","required":["confidence_range","count"],"title":"ConfidenceBucket"},"ConfigToPolicyRequest":{"properties":{"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["config"],"title":"ConfigToPolicyRequest"},"ConnectorHealthItem":{"properties":{"source":{"type":"string","maxLength":256,"minLength":1,"title":"Source","description":"Operator-defined source identifier as written to Delta world_events.source (e.g. 'charm', 'careclinic', 'hazel'). Enum-like; never user input."},"events_per_minute":{"type":"number","minimum":0.0,"title":"Events Per Minute","description":"Mean events/min over the last hour (events_last_hour / 60)."},"events_last_hour":{"type":"integer","minimum":0.0,"title":"Events Last Hour"},"events_last_24h":{"type":"integer","minimum":0.0,"title":"Events Last 24H","description":"Events ingested in the last 24 hours (rolling, not calendar-day)."},"last_ingested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Ingested At"},"freshness":{"type":"string","enum":["fresh","stale","quiet","never"],"title":"Freshness","description":"fresh < 5min · stale 5-60min · quiet > 60min · never = no events in 24h"}},"type":"object","required":["source","events_per_minute","events_last_hour","events_last_24h","last_ingested_at","freshness"],"title":"ConnectorHealthItem"},"ConnectorHealthResponse":{"properties":{"sources":{"items":{"$ref":"#/components/schemas/ConnectorHealthItem"},"type":"array","maxItems":500,"title":"Sources"},"as_of":{"type":"string","format":"date-time","title":"As Of","description":"Server clock at query time (UTC)."},"read_model_status":{"type":"string","enum":["ready","empty","unavailable"],"title":"Read Model Status","description":"ready = Lakebase projection returned rows; empty = no summary rows; unavailable = read failed."},"read_model_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Read Model Synced At","description":"Most recent platform.connector_health_summary synced_at value in this response."}},"type":"object","required":["as_of","read_model_status"],"title":"ConnectorHealthResponse"},"ConnectorHeartbeat":{"properties":{"data_source_id":{"type":"string","format":"uuid","title":"Data Source Id"},"name":{"type":"string","title":"Name"},"alive":{"type":"boolean","title":"Alive"},"last_seen":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Seen"}},"type":"object","required":["data_source_id","name","alive"],"title":"ConnectorHeartbeat"},"ConnectorOverviewItem":{"properties":{"data_source_id":{"type":"string","format":"uuid","title":"Data Source Id"},"name":{"type":"string","title":"Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"source_type":{"type":"string","title":"Source Type"},"connector_type":{"type":"string","title":"Connector Type"},"entity_count":{"type":"integer","title":"Entity Count"},"entities_by_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"Entities By Type"},"last_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync At"},"last_sync_status":{"anyOf":[{"type":"string","enum":["success","error"]},{"type":"null"}],"title":"Last Sync Status"},"last_sync_event_count":{"type":"integer","title":"Last Sync Event Count","default":0},"health_status":{"type":"string","enum":["unknown","healthy","degraded"],"title":"Health Status","default":"unknown"},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["data_source_id","name","source_type","connector_type","entity_count"],"title":"ConnectorOverviewItem"},"ConnectorOverviewResponse":{"properties":{"connectors":{"items":{"$ref":"#/components/schemas/ConnectorOverviewItem"},"type":"array","title":"Connectors"},"total_entities":{"type":"integer","title":"Total Entities"}},"type":"object","required":["connectors","total_entities"],"title":"ConnectorOverviewResponse"},"ConnectorResourcesResponse":{"properties":{"resource_type":{"type":"string","maxLength":256,"title":"Resource Type","description":"FHIR resource type (e.g. Patient, Condition, MedicationRequest)"},"data_source_id":{"type":"string","format":"uuid","title":"Data Source Id","description":"UUID of the connected data source"},"total":{"type":"integer","title":"Total","description":"Total number of matching resources"},"entries":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":100,"title":"Entries","description":"Raw FHIR resource JSON objects"}},"type":"object","required":["resource_type","data_source_id","total","entries"],"title":"ConnectorResourcesResponse","description":"FHIR resources from a specific connected data source."},"Constraint":{"properties":{"name":{"type":"string","title":"Name"},"definition":{"type":"string","title":"Definition","description":"``pg_get_constraintdef(oid)`` — the postgres-rendered definition."}},"type":"object","required":["name","definition"],"title":"Constraint"},"ContentPartPayload":{"properties":{"type":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9._-]*$","title":"Type","default":"text"},"text":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"Text"},"url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Url"},"media_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Media Type"},"provider_id":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Provider Id"},"metadata":{"additionalProperties":true,"type":"object","maxProperties":50,"title":"Metadata"}},"type":"object","title":"ContentPartPayload","description":"HTTP/WebSocket shape for a modality-neutral conversation content part."},"ContextGraphResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"latest_version":{"type":"integer","title":"Latest Version","default":0},"state_count":{"type":"integer","title":"State Count","default":0},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","workspace_id","name","description","created_at","updated_at"],"title":"ContextGraphResponse"},"ContextGraphState-Input":{"oneOf":[{"$ref":"#/components/schemas/ActionState-Input"},{"$ref":"#/components/schemas/DecisionState-Input"},{"$ref":"#/components/schemas/AnnotationState"},{"$ref":"#/components/schemas/DataCollectionState-Input"}],"discriminator":{"propertyName":"type","mapping":{"action":"#/components/schemas/ActionState-Input","annotation":"#/components/schemas/AnnotationState","data_collection":"#/components/schemas/DataCollectionState-Input","decision":"#/components/schemas/DecisionState-Input"}}},"ContextGraphState-Output":{"oneOf":[{"$ref":"#/components/schemas/ActionState-Output"},{"$ref":"#/components/schemas/DecisionState-Output"},{"$ref":"#/components/schemas/AnnotationState"},{"$ref":"#/components/schemas/DataCollectionState-Output"}],"discriminator":{"propertyName":"type","mapping":{"action":"#/components/schemas/ActionState-Output","annotation":"#/components/schemas/AnnotationState","data_collection":"#/components/schemas/DataCollectionState-Output","decision":"#/components/schemas/DecisionState-Output"}}},"ContextGraphVersion":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"context_graph_id":{"type":"string","format":"uuid","title":"Context Graph Id"},"version":{"type":"integer","title":"Version"},"description":{"type":"string","title":"Description"},"states":{"items":{"$ref":"#/components/schemas/ContextGraphState-Output"},"type":"array","title":"States"},"new_user_initial_state":{"type":"string","title":"New User Initial State"},"returning_user_initial_state":{"type":"string","title":"Returning User Initial State"},"terminal_state":{"type":"string","title":"Terminal State"},"global_intra_state_navigation_guidelines":{"items":{"type":"string"},"type":"array","title":"Global Intra State Navigation Guidelines","default":[]},"global_action_guidelines":{"items":{"type":"string"},"type":"array","title":"Global Action Guidelines","default":[]},"global_boundary_constraints":{"items":{"type":"string"},"type":"array","title":"Global Boundary Constraints","default":[]},"topology_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Topology Description"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","context_graph_id","version","description","states","new_user_initial_state","returning_user_initial_state","terminal_state"],"title":"ContextGraphVersion","description":"A version of a hierarchical state machine (context graph)."},"ContextGraphVersionResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"context_graph_id":{"type":"string","format":"uuid","title":"Context Graph Id"},"version":{"type":"integer","title":"Version"},"description":{"type":"string","title":"Description"},"states":{"items":{"$ref":"#/components/schemas/ContextGraphState-Output"},"type":"array","title":"States"},"new_user_initial_state":{"type":"string","title":"New User Initial State"},"returning_user_initial_state":{"type":"string","title":"Returning User Initial State"},"terminal_state":{"type":"string","title":"Terminal State"},"global_intra_state_navigation_guidelines":{"items":{"type":"string"},"type":"array","title":"Global Intra State Navigation Guidelines"},"global_action_guidelines":{"items":{"type":"string"},"type":"array","title":"Global Action Guidelines"},"global_boundary_constraints":{"items":{"type":"string"},"type":"array","title":"Global Boundary Constraints"},"topology_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Topology Description"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","workspace_id","context_graph_id","version","description","states","new_user_initial_state","returning_user_initial_state","terminal_state","global_intra_state_navigation_guidelines","global_action_guidelines","global_boundary_constraints","topology_description","created_at","updated_at"],"title":"ContextGraphVersionResponse"},"ConversationConfig":{"properties":{"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"},"agent_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agent Version"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"context_graph_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Context Graph Id"},"context_graph_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Graph Version"},"initial_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Initial State"},"gpt_audio_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gpt Audio Model"},"navigation_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Navigation Model"}},"type":"object","title":"ConversationConfig"},"ConversationDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"channel_kind":{"$ref":"#/components/schemas/ChannelKind"},"status":{"type":"string","enum":["active","closed","completed","in-progress","failed"],"title":"Status"},"lifecycle":{"type":"string","enum":["active","dormant","closed"],"title":"Lifecycle"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"},"turn_count":{"type":"integer","title":"Turn Count","default":0},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid"},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Id"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score"},"has_recording":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Recording"},"completion_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completion Reason"},"escalation_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Escalation Status"},"final_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final State"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"turns":{"items":{"$ref":"#/components/schemas/ConversationTurn"},"type":"array","title":"Turns","default":[]},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"},"voice":{"anyOf":[{"$ref":"#/components/schemas/VoiceDetail"},{"type":"null"}]}},"type":"object","required":["id","channel_kind","status","lifecycle","created_at","updated_at"],"title":"ConversationDetail"},"ConversationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/src__routes__conversations__ConversationSummary"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["items","total","has_more"],"title":"ConversationListResponse"},"ConversationThreadRequest":{"properties":{"channel_kind":{"$ref":"#/components/schemas/ChannelKind"},"provider":{"$ref":"#/components/schemas/ProviderType"},"provider_thread_id":{"type":"string","maxLength":512,"minLength":1,"title":"Provider Thread Id"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"}},"type":"object","required":["channel_kind","provider","provider_thread_id"],"title":"ConversationThreadRequest"},"ConversationThreadResponse":{"properties":{"conversation_id":{"type":"string","format":"uuid","title":"Conversation Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"channel_kind":{"$ref":"#/components/schemas/ChannelKind"},"provider":{"$ref":"#/components/schemas/ProviderType"},"provider_thread_id":{"type":"string","maxLength":512,"minLength":1,"title":"Provider Thread Id"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"status":{"type":"string","const":"active","title":"Status"},"created_at":{"type":"number","title":"Created At"},"created":{"type":"boolean","title":"Created"}},"type":"object","required":["conversation_id","workspace_id","channel_kind","provider","provider_thread_id","status","created_at","created"],"title":"ConversationThreadResponse"},"ConversationToolCallDetail":{"properties":{"tool_name":{"type":"string","title":"Tool Name"},"call_id":{"type":"string","title":"Call Id"},"input":{"additionalProperties":true,"type":"object","title":"Input"},"result":{"type":"string","title":"Result","default":""},"succeeded":{"type":"boolean","title":"Succeeded","default":true},"duration_ms":{"anyOf":[{"type":"number","maximum":3600000.0,"minimum":0.0},{"type":"null"}],"title":"Duration Ms","description":"Wall-clock tool execution time in milliseconds, measured at the engage_step call site. Omitted (null) on legacy turns that did not capture timing."},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message","description":"Failure detail recorded for the tool call when ``succeeded`` is false. Null on successful calls or when no message was captured."}},"type":"object","required":["tool_name","call_id"],"title":"ConversationToolCallDetail"},"ConversationTurn":{"properties":{"role":{"type":"string","enum":["agent","user","system"],"title":"Role"},"text":{"type":"string","title":"Text"},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timestamp"},"content":{"items":{"$ref":"#/components/schemas/ContentPartPayload"},"type":"array","title":"Content","default":[]},"tool_calls":{"items":{"$ref":"#/components/schemas/ConversationToolCallDetail"},"type":"array","title":"Tool Calls","description":"Tool calls executed during this (agent) turn. Populated only when the request opts in via ``include_tool_calls=true``; empty otherwise and on turns that did not invoke tools.","default":[]},"selected_action_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Action Description","description":"Description of the context-graph action selected for this turn. Null means no action was selected or no selected action was recorded."},"state_transition":{"anyOf":[{"$ref":"#/components/schemas/ConversationTurnStateTransition"},{"type":"null"}],"description":"Context-graph state transition that occurred during this turn. Null means no transition took place or no transition was recorded. Deprecated: use state_transitions instead. If multiple transitions were recorded, this field reports the first source state and final destination state.","deprecated":true},"state_transitions":{"items":{"$ref":"#/components/schemas/ConversationTurnStateTransition"},"type":"array","title":"State Transitions","description":"Ordered context-graph state transitions that occurred during this turn.","default":[]},"available_actions":{"items":{"$ref":"#/components/schemas/ConversationTurnAvailableAction"},"type":"array","title":"Available Actions","description":"Action choices available in the turn's resolved context-graph state. Empty when actions cannot be resolved or the resolved state is not an action state.","default":[]}},"type":"object","required":["role","text"],"title":"ConversationTurn"},"ConversationTurnAvailableAction":{"properties":{"description":{"type":"string","title":"Description","description":"Human-readable description of an action available in the turn's state."}},"type":"object","required":["description"],"title":"ConversationTurnAvailableAction"},"ConversationTurnStateTransition":{"properties":{"from":{"type":"string","title":"From","description":"Source context-graph state before the turn's state transition."},"to":{"type":"string","title":"To","description":"Destination context-graph state after the turn's state transition."}},"type":"object","required":["from","to"],"title":"ConversationTurnStateTransition"},"ConvertEnvironmentRequest":{"properties":{"target":{"type":"string","enum":["production","staging"],"title":"Target"},"confirm_slug":{"$ref":"#/components/schemas/SlugString"}},"type":"object","required":["target","confirm_slug"],"title":"ConvertEnvironmentRequest"},"CorrectRequest":{"properties":{"corrected_data":{"additionalProperties":true,"type":"object","title":"Corrected Data"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"}},"type":"object","required":["corrected_data"],"title":"CorrectRequest","description":"Submit corrected data — creates new event at confidence 1.0."},"CorrectionSchemaResponse":{"properties":{"fhir_resource_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fhir Resource Type"},"fields":{"additionalProperties":true,"type":"object","title":"Fields"},"current_values":{"additionalProperties":true,"type":"object","title":"Current Values"}},"type":"object","required":["fhir_resource_type","fields","current_values"],"title":"CorrectionSchemaResponse","description":"Schema hints for building a correction form."},"Counterfactual":{"properties":{"timestamp_seconds":{"anyOf":[{"type":"number","maximum":86400.0,"minimum":0.0},{"type":"null"}],"title":"Timestamp Seconds","description":"When the alternative action was available (seconds)"},"actual":{"type":"string","maxLength":2000,"minLength":1,"title":"Actual","description":"What the agent actually did"},"alternative":{"type":"string","maxLength":2000,"minLength":1,"title":"Alternative","description":"What it could have done instead"},"predicted_impact":{"type":"string","maxLength":2000,"minLength":1,"title":"Predicted Impact","description":"How the call would have gone differently"}},"type":"object","required":["actual","alternative","predicted_impact"],"title":"Counterfactual","description":"An alternative action that would have meaningfully changed the call outcome."},"CreateAgentRequest":{"properties":{"name":{"$ref":"#/components/schemas/NameString"},"description":{"$ref":"#/components/schemas/DescriptionString","default":""}},"type":"object","required":["name"],"title":"CreateAgentRequest"},"CreateAgentVersionRequest":{"properties":{"name":{"$ref":"#/components/schemas/NameString"},"initials":{"type":"string","maxLength":10,"title":"Initials","default":""},"identity":{"$ref":"#/components/schemas/Identity"},"voice_config":{"anyOf":[{"$ref":"#/components/schemas/VoiceConfig"},{"type":"null"}]},"background":{"$ref":"#/components/schemas/BackgroundString","default":""},"behaviors":{"items":{"type":"string","maxLength":2000},"type":"array","maxItems":200,"title":"Behaviors"},"communication_patterns":{"items":{"type":"string","maxLength":2000},"type":"array","maxItems":200,"title":"Communication Patterns"}},"type":"object","required":["name","identity"],"title":"CreateAgentVersionRequest"},"CreateApiKeyRequest":{"properties":{"name":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"duration_days":{"type":"integer","maximum":90.0,"minimum":1.0,"title":"Duration Days"},"role":{"type":"string","maxLength":64,"title":"Role","default":"member"},"permissions":{"items":{"type":"string"},"type":"array","maxItems":128,"title":"Permissions","description":"Permission names. Max 128 entries; each entry up to 128 chars."}},"type":"object","required":["duration_days"],"title":"CreateApiKeyRequest"},"CreateApiKeyResponse":{"properties":{"key_id":{"type":"string","title":"Key Id"},"api_key":{"type":"string","title":"Api Key"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"role":{"type":"string","title":"Role"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"created_by_entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By Entity Id"},"created_by_credential_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By Credential Id"}},"type":"object","required":["key_id","api_key","name","role","permissions","expires_at","created_by_entity_id","created_by_credential_id"],"title":"CreateApiKeyResponse"},"CreateContextGraphRequest":{"properties":{"name":{"$ref":"#/components/schemas/NameString"},"description":{"$ref":"#/components/schemas/DescriptionString","default":""}},"type":"object","required":["name"],"title":"CreateContextGraphRequest"},"CreateContextGraphVersionRequest":{"properties":{"description":{"$ref":"#/components/schemas/DescriptionString","default":""},"states":{"items":{"$ref":"#/components/schemas/ContextGraphState-Input"},"type":"array","title":"States"},"new_user_initial_state":{"type":"string","title":"New User Initial State"},"returning_user_initial_state":{"type":"string","title":"Returning User Initial State"},"terminal_state":{"type":"string","title":"Terminal State"},"global_intra_state_navigation_guidelines":{"items":{"type":"string"},"type":"array","title":"Global Intra State Navigation Guidelines","default":[]},"global_action_guidelines":{"items":{"type":"string"},"type":"array","title":"Global Action Guidelines","default":[]},"global_boundary_constraints":{"items":{"type":"string"},"type":"array","title":"Global Boundary Constraints","default":[]},"topology_description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Topology Description"}},"type":"object","required":["states","new_user_initial_state","returning_user_initial_state","terminal_state"],"title":"CreateContextGraphVersionRequest"},"CreateConversationRequest":{"properties":{"service_id":{"type":"string","format":"uuid","title":"Service Id"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"}},"type":"object","required":["service_id"],"title":"CreateConversationRequest"},"CreateCustomerRequest":{"properties":{"name":{"type":"string","maxLength":256,"minLength":1,"title":"Name"},"slug":{"type":"string","maxLength":63,"minLength":2,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$","title":"Slug"},"billing_email":{"type":"string","format":"email","title":"Billing Email"},"billing_contact":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Billing Contact"},"mercury_memo":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Mercury Memo"},"address":{"additionalProperties":true,"type":"object","title":"Address"}},"type":"object","required":["name","slug","billing_email"],"title":"CreateCustomerRequest"},"CreateDashboardRequest":{"properties":{"slug":{"type":"string","maxLength":128,"minLength":2,"pattern":"^[a-z0-9][a-z0-9\\-]*$","title":"Slug"},"title":{"$ref":"#/components/schemas/NameString"},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"page_context":{"anyOf":[{"type":"string","enum":["home","patients","calls","data","analytics","pipeline","operators","surfaces","compliance","custom"]},{"type":"null"}],"title":"Page Context"},"panels":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":50,"title":"Panels"},"filters":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":20,"title":"Filters"},"refresh_interval":{"type":"integer","maximum":86400.0,"minimum":10.0,"title":"Refresh Interval","default":300}},"type":"object","required":["slug","title"],"title":"CreateDashboardRequest"},"CreateDataSourceRequest":{"properties":{"name":{"$ref":"#/components/schemas/NameString"},"display_name":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"source_type":{"type":"string","enum":["rest_api","webhook","file_drop","fhir_store","ehr","database","custom","smart_fhir","customer_intake","lakebase_schema","crm"],"title":"Source Type"},"connection_config":{"additionalProperties":true,"type":"object","title":"Connection Config"},"entity_types":{"items":{"type":"string","maxLength":64,"minLength":1},"type":"array","maxItems":100,"title":"Entity Types"},"field_mappings":{"additionalProperties":true,"type":"object","title":"Field Mappings"},"sync_strategy":{"type":"string","enum":["manual","scheduled","webhook","continuous"],"title":"Sync Strategy","default":"manual"},"sync_schedule":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Sync Schedule"}},"type":"object","required":["name","source_type"],"title":"CreateDataSourceRequest"},"CreateLinkRequest":{"properties":{"customer_slug":{"$ref":"#/components/schemas/SlugString"},"display_name":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"expires_in_hours":{"type":"integer","maximum":720.0,"minimum":1.0,"title":"Expires In Hours","default":168},"max_uploads":{"type":"integer","maximum":10000.0,"minimum":1.0,"title":"Max Uploads","default":100}},"type":"object","required":["customer_slug"],"title":"CreateLinkRequest"},"CreateOperatorRequest":{"properties":{"name":{"$ref":"#/components/schemas/NameString"},"email":{"type":"string","format":"email","title":"Email"},"type":{"type":"string","enum":["clinical","administrative","crisis_counselor"],"title":"Type","default":"clinical"},"skills":{"items":{"type":"string","maxLength":64,"minLength":1},"type":"array","maxItems":50,"title":"Skills"},"connection_method":{"type":"string","enum":["browser","phone"],"title":"Connection Method","default":"browser"},"phone_number":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}]},"role":{"type":"string","enum":["operator","supervisor","admin"],"title":"Role","default":"operator"}},"type":"object","required":["name","email"],"title":"CreateOperatorRequest"},"CreateOutboundCallRequest":{"properties":{"phone_to":{"$ref":"#/components/schemas/PhoneE164","description":"Destination phone number in E.164 format."},"phone_from":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}],"description":"Caller ID phone number in E.164 format. Must belong to this workspace."},"use_case_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Use Case Id","description":"Channel-manager use case ID. When provided, channel-manager selects the optimal outbound phone number for this use case."},"patient_entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Patient Entity Id","description":"Patient entity UUID in the world model. Must exist in workspace as a person entity. Provide either patient_entity_id or patient_canonical_id."},"patient_canonical_id":{"anyOf":[{"$ref":"#/components/schemas/CanonicalIdString"},{"type":"null"}],"description":"Patient world model canonical_id of the form 'source:resource_type:id' (e.g. 'charmhealth:Patient:67890'). The structural regex on CanonicalIdString rejects spaces, names, DOBs, and similar regulated content so PHI cannot leak into audit events or pipeline projections. The raw value is deliberately not recorded in the outbound.initiated event — correlation back to the source system is via the resolved entity_id joined to world.entities.canonical_id. Resolved against the SDP-projected world.entities table; an entity created moments ago may not yet be visible if the projection is lagging. Provide either patient_entity_id or patient_canonical_id, not both."},"reason":{"$ref":"#/components/schemas/NameString","description":"Why the call is being made (e.g. appointment_reminder, follow_up, lab_results)."},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id","description":"Service ID for the voice agent to use."},"system_prompt":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}],"title":"System Prompt","description":"Optional system prompt override for this call."},"goal":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}],"description":"What the call should accomplish. Injected into agent context."},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":10},{"type":"null"}],"title":"Tags","description":"Classification tags for analytics."},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata","description":"Arbitrary key-value pairs for external system correlation."},"derived_from_call_sid":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Derived From Call Sid","description":"Prior call_sid if this is a callback from a previous call."},"idempotency_key":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Idempotency Key","description":"Client-provided idempotency key. Auto-generated if omitted."},"outbound_task_entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Outbound Task Entity Id","description":"World model outbound_task entity ID for completion feedback."}},"type":"object","required":["phone_to","reason"],"title":"CreateOutboundCallRequest","description":"Request body for creating an outbound call.\n\nExactly one of ``phone_from`` or ``use_case_id`` is required.\nWhen ``use_case_id`` is provided, channel-manager selects the optimal\noutbound phone number for that use case."},"CreateOutboundCallResponse":{"properties":{"call_sid":{"type":"string","title":"Call Sid","description":"Twilio call SID for the outbound call"},"status":{"type":"string","title":"Status","description":"Initial call status (typically 'queued')"},"phone_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone From","description":"Resolved caller ID when use_case_id was used."},"setup_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Setup Id","description":"Channel-manager setup ID when use_case_id was used."},"event_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Event Id","description":"World event ID for the outbound.initiated event."}},"type":"object","required":["call_sid","status"],"title":"CreateOutboundCallResponse","description":"Response from creating an outbound call."},"CreateRunRequest":{"properties":{"service_id":{"type":"string","format":"uuid","title":"Service Id"},"branch_name":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Branch Name"},"tags":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Tags"}},"type":"object","required":["service_id"],"title":"CreateRunRequest"},"CreateSchedulingRuleSetRequest":{"properties":{"agent_kind":{"type":"string","enum":["tms","ketamine","general"],"title":"Agent Kind"},"params":{"oneOf":[{"$ref":"#/components/schemas/ClinicOpenHoursParams"},{"$ref":"#/components/schemas/TMSMappingReleaseParams"},{"$ref":"#/components/schemas/TMSSessionGridParams"},{"$ref":"#/components/schemas/KetamineBlockOverlapParams"},{"$ref":"#/components/schemas/NinetyDayRollingParams"},{"$ref":"#/components/schemas/ConcurrentStartBlockParams"}],"title":"Params","description":"Per-rule-kind typed parameters. The ``rule_kind`` discriminator field selects the params shape; one row per (agent_kind, rule_kind) per workspace.","discriminator":{"propertyName":"rule_kind","mapping":{"clinic_open_hours":"#/components/schemas/ClinicOpenHoursParams","concurrent_start_block":"#/components/schemas/ConcurrentStartBlockParams","ketamine_block_overlap":"#/components/schemas/KetamineBlockOverlapParams","ninety_day_rolling":"#/components/schemas/NinetyDayRollingParams","tms_mapping_release":"#/components/schemas/TMSMappingReleaseParams","tms_session_grid":"#/components/schemas/TMSSessionGridParams"}}},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["agent_kind","params"],"title":"CreateSchedulingRuleSetRequest"},"CreateServiceRequest":{"properties":{"name":{"$ref":"#/components/schemas/NameString"},"description":{"$ref":"#/components/schemas/DescriptionString","default":""},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"context_graph_id":{"type":"string","format":"uuid","title":"Context Graph Id"},"keyterms":{"items":{"type":"string","maxLength":128,"minLength":1},"type":"array","maxItems":500,"title":"Keyterms"},"is_active":{"type":"boolean","title":"Is Active","default":true},"version_sets":{"additionalProperties":{"$ref":"#/components/schemas/VersionSet-Input"},"type":"object","title":"Version Sets","default":{}},"tags":{"items":{"$ref":"#/components/schemas/ServiceTag"},"type":"array","maxItems":50,"title":"Tags"},"tool_capacity":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Tool Capacity","default":3},"safety_filters_enabled":{"type":"boolean","title":"Safety Filters Enabled","default":true},"channel_type":{"type":"string","enum":["voice","text"],"title":"Channel Type","default":"voice"},"environment":{"type":"string","enum":["sandbox","production"],"title":"Environment","default":"production"},"voice_config":{"anyOf":[{"$ref":"#/components/schemas/ServiceVoiceConfig-Input"},{"type":"null"}]},"escalation_policy":{"anyOf":[{"$ref":"#/components/schemas/EscalationPolicy"},{"type":"null"}]}},"type":"object","required":["name","agent_id","context_graph_id"],"title":"CreateServiceRequest"},"CreateSesSetupRequest":{"properties":{"tenant_name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Tenant Name","description":"Logical SES tenant name (reputation + suppression isolation boundary).\nUnique within the AWS account. Alphabet ``[A-Za-z0-9_-]``, 1-64 chars."},"domain_identity":{"type":"string","maxLength":255,"minLength":1,"title":"Domain Identity","description":"Domain to verify for both sending and receiving (e.g.\n``mail.customer.com``). A single SES identity serves both directions."}},"type":"object","required":["tenant_name","domain_identity"],"title":"CreateSesSetupRequest"},"CreateSessionRequest":{"properties":{"service_id":{"type":"string","format":"uuid","title":"Service Id"},"branch_name":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Branch Name"},"tags":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Tags"},"caller_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Caller Id","description":"Simulated caller phone number used to resolve patient context when `entity_id` is not provided (or does not match a row). Omitted/blank values are normalized to the `sim-orchestrator` sentinel, which yields no phone match and an empty caller context — same default the voice test-call WebSocket uses, so patient lookups resolve consistently across modalities."},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id","description":"Optional world entity UUID to bind caller context directly. Precedence rules: (1) when this resolves to a world entity in the workspace, it WINS — `caller_id` is not used for identity resolution, and the resolution provenance is `entity_id_lookup`; (2) when this is a well-formed UUID with no matching entity (stale, deleted, wrong workspace), the session falls back to phone lookup against `caller_id` (provenance `phone_lookup`) — no error is raised, the sim is survivable; (3) malformed UUIDs are rejected with HTTP 422 before the request reaches agent-engine. The supplied `caller_id` is still recorded on the active call and surfaced in the greeting metadata in case (1)."}},"type":"object","required":["service_id"],"title":"CreateSessionRequest"},"CreateSimulationCaseItem":{"properties":{"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"description":{"type":"string","maxLength":2000,"minLength":1,"title":"Description"},"persona":{"additionalProperties":true,"type":"object","title":"Persona"},"scenario":{"$ref":"#/components/schemas/SimulationCaseScenario"},"grounding":{"$ref":"#/components/schemas/SimulationCaseGrounding"},"evals":{"items":{"anyOf":[{"$ref":"#/components/schemas/SimulationCaseMetricEval"},{"$ref":"#/components/schemas/SimulationCaseAssertionEval"}]},"type":"array","maxItems":100,"title":"Evals"},"tags":{"items":{"type":"string","maxLength":128},"type":"array","maxItems":20,"title":"Tags"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"additionalProperties":false,"type":"object","required":["description","scenario"],"title":"CreateSimulationCaseItem","description":"One durable simulation case to create."},"CreateSimulationCasesRequest":{"properties":{"cases":{"items":{"$ref":"#/components/schemas/CreateSimulationCaseItem"},"type":"array","maxItems":100,"minItems":1,"title":"Cases"}},"additionalProperties":false,"type":"object","required":["cases"],"title":"CreateSimulationCasesRequest"},"CreateSimulationCasesResponse":{"properties":{"cases":{"items":{"$ref":"#/components/schemas/SimulationCaseResponse"},"type":"array","title":"Cases"}},"type":"object","required":["cases"],"title":"CreateSimulationCasesResponse"},"CreateSimulationSuiteRequest":{"properties":{"name":{"type":"string","maxLength":128,"minLength":1,"title":"Name"},"description":{"type":"string","maxLength":2000,"title":"Description","default":""},"case_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":500,"title":"Case Ids"},"required_tags":{"items":{"type":"string","maxLength":128},"type":"array","maxItems":20,"title":"Required Tags"},"tags":{"items":{"type":"string","maxLength":128},"type":"array","maxItems":20,"title":"Tags"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"}},"additionalProperties":false,"type":"object","required":["name"],"title":"CreateSimulationSuiteRequest"},"CreateSkillRequest":{"properties":{"slug":{"type":"string","maxLength":63,"minLength":2,"pattern":"^[a-z0-9][a-z0-9_-]*[a-z0-9]$","title":"Slug"},"name":{"$ref":"#/components/schemas/NameString"},"description":{"$ref":"#/components/schemas/DescriptionString"},"system_prompt":{"anyOf":[{"$ref":"#/components/schemas/BackgroundString"},{"type":"null"}]},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema"},"result_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result Schema"},"model":{"type":"string","maxLength":128,"minLength":1,"title":"Model","default":"claude-sonnet-4-6"},"max_tokens":{"type":"integer","maximum":200000.0,"minimum":1.0,"title":"Max Tokens","default":4096},"max_result_chars":{"type":"integer","maximum":200000.0,"minimum":1.0,"title":"Max Result Chars","default":2000},"max_input_tokens":{"anyOf":[{"type":"integer","maximum":2000000.0,"minimum":1.0},{"type":"null"}],"title":"Max Input Tokens"},"timeout_s":{"type":"number","maximum":900.0,"minimum":0.1,"title":"Timeout S","default":60.0},"thinking_effort":{"anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"null"}],"title":"Thinking Effort"},"enable_caching":{"type":"boolean","title":"Enable Caching","default":true},"enable_citations":{"type":"boolean","title":"Enable Citations","default":false},"use_structured_output":{"type":"boolean","title":"Use Structured Output","default":false},"integration_tools":{"items":{"$ref":"#/components/schemas/IntegrationToolRef-Input"},"type":"array","maxItems":50,"title":"Integration Tools"},"static_tools":{"items":{"$ref":"#/components/schemas/StaticToolDef-Input"},"type":"array","maxItems":50,"title":"Static Tools"},"enabled":{"type":"boolean","title":"Enabled","default":true},"max_agent_turns":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Max Agent Turns","default":20},"checkpoint_enabled":{"type":"boolean","title":"Checkpoint Enabled","default":true},"approval_required":{"type":"boolean","title":"Approval Required","default":false}},"type":"object","required":["slug","name","description","input_schema"],"title":"CreateSkillRequest"},"CreateSurfaceRequest":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"title":{"$ref":"#/components/schemas/NameString"},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"fields":{"items":{"$ref":"#/components/schemas/SurfaceField"},"type":"array","maxItems":200,"minItems":1,"title":"Fields"},"channel":{"$ref":"#/components/schemas/ChannelType","default":"web"},"use_case_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Use Case Id"},"expires_in_hours":{"type":"integer","maximum":8760.0,"minimum":1.0,"title":"Expires In Hours","default":168},"context":{"additionalProperties":true,"type":"object","title":"Context","default":{}},"resource_type":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Resource Type"},"branding":{"anyOf":[{"$ref":"#/components/schemas/BrandingConfig"},{"type":"null"}]},"sections":{"anyOf":[{"items":{"$ref":"#/components/schemas/SurfaceSection"},"type":"array"},{"type":"null"}],"title":"Sections"},"completion_title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Completion Title"},"completion_message":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Completion Message"},"completion_action_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Completion Action Url"},"submit_button_text":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Submit Button Text"}},"type":"object","required":["entity_id","title","fields"],"title":"CreateSurfaceRequest","description":"Request to create a new surface.\n\nThe agent generates a SurfaceSpec and sends it here."},"CreateSurfaceResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_id":{"type":"string","format":"uuid","title":"Event Id"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"$ref":"#/components/schemas/SurfaceStatus"},"channel":{"$ref":"#/components/schemas/ChannelType"},"use_case_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Use Case Id"},"fields_count":{"type":"integer","title":"Fields Count"},"expires_at":{"type":"string","title":"Expires At"},"created_at":{"type":"string","title":"Created At"},"token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","required":["id","event_id","entity_id","title","status","channel","fields_count","expires_at","created_at"],"title":"CreateSurfaceResponse"},"CreateTriggerRequest":{"properties":{"name":{"$ref":"#/components/schemas/NameString"},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"event_type":{"$ref":"#/components/schemas/EventTypeString"},"event_filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Event Filter"},"action_id":{"type":"string","format":"uuid","title":"Action Id"},"input_template":{"additionalProperties":true,"type":"object","title":"Input Template"},"schedule":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Schedule"},"timezone":{"type":"string","maxLength":64,"minLength":1,"title":"Timezone","default":"UTC"}},"type":"object","required":["name","event_type","action_id"],"title":"CreateTriggerRequest"},"CreateWorkspaceRequest":{"properties":{"slug":{"$ref":"#/components/schemas/SlugString"},"name":{"$ref":"#/components/schemas/StrippedNonemptyString"},"environment":{"type":"string","enum":["production","staging","development"],"title":"Environment"},"backend_org_id":{"anyOf":[{"$ref":"#/components/schemas/StrippedNonemptyString"},{"type":"null"}]}},"type":"object","required":["slug","name","environment"],"title":"CreateWorkspaceRequest","description":"Request body for ``POST /v1/me/workspaces``.\n\n``region`` is intentionally not exposed here — the workspace is created\nin the region of the platform-api pod that handles the request (each\nregion's CD pipeline serves its own ingress host), and a workspace\ncannot migrate between regions. The handler derives it from\n``app.env.aws_region``.\n\n``environment`` has no default: it is a load-bearing routing field\n(staging vs production downstream), and ``PATCH .../convert_environment``\nis the supported migration path. Callers must commit to a value."},"CustomTokenExchangeAuthDict":{"properties":{"type":{"type":"string","const":"custom_token_exchange","title":"Type"},"exchange_url":{"type":"string","title":"Exchange Url"},"body_encoding":{"type":"string","enum":["json","form"],"title":"Body Encoding"},"static_headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Static Headers"},"static_body_fields":{"additionalProperties":{"type":"string"},"type":"object","title":"Static Body Fields"},"param_headers":{"additionalProperties":{"$ref":"#/components/schemas/ParamValueDict"},"type":"object","title":"Param Headers"},"param_body_fields":{"additionalProperties":{"$ref":"#/components/schemas/ParamValueDict"},"type":"object","title":"Param Body Fields"},"response_token_path":{"type":"string","title":"Response Token Path"}},"type":"object","required":["type","exchange_url","body_encoding","static_headers","static_body_fields","param_headers","param_body_fields","response_token_path"],"title":"CustomTokenExchangeAuthDict","description":"Pre-flight exchange that mints a downstream bearer.\n\nReplaces legacy ``json_token_exchange`` AND ``bearer_token_exchange``.\nDownstream call always receives ``Authorization: Bearer {token}``. No\nin-process caching — every call mints fresh."},"CustomTokenExchangeAuthRequest":{"properties":{"type":{"type":"string","const":"custom_token_exchange","title":"Type","default":"custom_token_exchange"},"exchange_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Exchange Url"},"body_encoding":{"type":"string","enum":["json","form"],"title":"Body Encoding","description":"``json`` (default) sends static_body_fields + param_body_fields as JSON; ``form`` sends as application/x-www-form-urlencoded.","default":"json"},"static_headers":{"patternProperties":{"^[A-Za-z0-9!#$%&'*+\\-.^_`|~]+$":{"type":"string"}},"propertyNames":{"maxLength":256,"minLength":1},"type":"object","title":"Static Headers","description":"Workspace-level headers on the exchange request (keys are RFC 7230 tchar). Values may contain ``{secret}`` placeholder.","default":{}},"static_body_fields":{"additionalProperties":{"type":"string"},"type":"object","title":"Static Body Fields","description":"Workspace-level body fields keyed by RFC 6901 JSON Pointer (e.g. ``/meta/tool_name``\nfor nested fields, or ``/foo`` for a root-level field). Values may contain ``{secret}``\nplaceholder.","default":{}},"param_headers":{"patternProperties":{"^[A-Za-z0-9!#$%&'*+\\-.^_`|~]+$":{"$ref":"#/components/schemas/ParamValueRequest"}},"propertyNames":{"maxLength":256,"minLength":1},"type":"object","title":"Param Headers","description":"Per-request params routed to headers on the exchange request, keyed by wire-name.","default":{}},"param_body_fields":{"additionalProperties":{"$ref":"#/components/schemas/ParamValueRequest"},"type":"object","title":"Param Body Fields","description":"Per-request params routed to body fields on the exchange request, keyed by RFC 6901 JSON Pointer.","default":{}},"response_token_path":{"type":"string","title":"Response Token Path","description":"RFC 6901 JSON Pointer into the exchange response body that extracts the bearer token\n(e.g. ``/access_token`` or ``/data/bearer``). NO default — every config commits explicitly."}},"type":"object","required":["exchange_url","response_token_path"],"title":"CustomTokenExchangeAuthRequest","description":"Pre-flight exchange that mints a downstream bearer.\n\nReplaces legacy ``json_token_exchange`` AND ``bearer_token_exchange``.\nPath-shaped fields (``response_token_path``, ``static_body_fields`` keys,\n``param_body_fields`` keys) MUST be valid RFC 6901 JSON Pointer — one\nsyntax throughout."},"CustomerAddress":{"properties":{"line1":{"type":"string","title":"Line1","description":"Street address line 1","default":""},"line2":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Line2","description":"Street address line 2"},"city":{"type":"string","title":"City","description":"City","default":""},"state":{"type":"string","title":"State","description":"State or province","default":""},"postal_code":{"type":"string","title":"Postal Code","description":"Postal or ZIP code","default":""},"country":{"type":"string","title":"Country","description":"ISO 3166-1 alpha-2 country code","default":"US"}},"type":"object","title":"CustomerAddress","description":"Customer billing address."},"CustomerItem":{"properties":{"id":{"type":"string","title":"Id","description":"Customer ID"},"name":{"type":"string","title":"Name","description":"Customer name"},"slug":{"type":"string","title":"Slug","description":"URL-safe identifier"},"billing_email":{"type":"string","title":"Billing Email","description":"Primary billing email"},"billing_contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Contact","description":"Billing contact name"},"mercury_memo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mercury Memo","description":"Mercury bank memo reference"},"address":{"$ref":"#/components/schemas/CustomerAddress","description":"Billing address"},"status":{"type":"string","enum":["active","archived"],"title":"Status","description":"Customer status"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"When the customer was created (ISO-8601)"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"When the customer was last updated (ISO-8601)"}},"type":"object","required":["id","name","slug","billing_email","billing_contact","mercury_memo","address","status","created_at","updated_at"],"title":"CustomerItem"},"DailyCallStat":{"properties":{"date":{"type":"string","title":"Date","description":"Date string (YYYY-MM-DD)"},"count":{"type":"integer","title":"Count","description":"Number of calls on this date"},"avg_duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Duration Seconds","description":"Average call duration in seconds"}},"type":"object","required":["date","count"],"title":"DailyCallStat","description":"Per-day call volume and duration."},"DailyCallVolume":{"properties":{"date":{"type":"string","title":"Date","description":"ISO-8601 date (YYYY-MM-DD)"},"count":{"type":"integer","title":"Count","description":"Number of calls on this date"}},"type":"object","required":["date","count"],"title":"DailyCallVolume","description":"Call volume for a single date."},"DashboardDefinitionResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id"},"slug":{"type":"string","title":"Slug","description":"URL-safe identifier"},"title":{"type":"string","title":"Title","description":"Dashboard display title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Human-readable description"},"page_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Context","description":"Developer console page where this dashboard renders"},"panels":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Panels","description":"Ordered list of panel definitions"},"filters":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Filters","description":"Dashboard-level filter controls"},"refresh_interval":{"type":"integer","title":"Refresh Interval","description":"Auto-refresh interval in seconds"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the dashboard is active"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By","description":"Creator identifier"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the dashboard was created"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"When the dashboard was last updated"}},"type":"object","required":["id","slug","title","panels","filters","refresh_interval","is_active"],"title":"DashboardDefinitionResponse"},"DashboardExecuteResponse":{"properties":{"dashboard_id":{"type":"string","format":"uuid","title":"Dashboard Id"},"results":{"items":{"$ref":"#/components/schemas/PanelResultResponse"},"type":"array","title":"Results"}},"type":"object","required":["dashboard_id","results"],"title":"DashboardExecuteResponse"},"DashboardResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"operators":{"$ref":"#/components/schemas/OperatorStatusCounts"},"active_escalations":{"type":"integer","title":"Active Escalations"},"escalations_today":{"$ref":"#/components/schemas/EscalationDailyStats"},"recent_escalations":{"items":{"$ref":"#/components/schemas/ActiveEscalationItem"},"type":"array","title":"Recent Escalations"}},"type":"object","required":["workspace_id","operators","active_escalations","escalations_today","recent_escalations"],"title":"DashboardResponse"},"DataCollectionState-Input":{"properties":{"type":{"type":"string","const":"data_collection","title":"Type"},"name":{"type":"string","title":"Name"},"objective":{"type":"string","title":"Objective"},"fields":{"items":{"$ref":"#/components/schemas/CollectionField"},"type":"array","title":"Fields"},"on_complete":{"type":"string","title":"On Complete"},"action_guidelines":{"items":{"type":"string"},"type":"array","title":"Action Guidelines","default":[]},"boundary_constraints":{"items":{"type":"string"},"type":"array","title":"Boundary Constraints","default":[]},"surface_fallback":{"type":"boolean","title":"Surface Fallback","default":false},"surface_fallback_after_turns":{"type":"integer","title":"Surface Fallback After Turns","default":6},"max_turns":{"type":"integer","title":"Max Turns","default":10},"guardrails":{"items":{"$ref":"#/components/schemas/Guardrail"},"type":"array","title":"Guardrails","default":[]},"channel_overrides":{"additionalProperties":{"$ref":"#/components/schemas/ChannelOverride"},"type":"object","title":"Channel Overrides"},"turn_policy":{"anyOf":[{"$ref":"#/components/schemas/TurnPolicy"},{"type":"null"}]},"tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Tool Call Specs","default":[]}},"type":"object","required":["type","name","objective","fields","on_complete"],"title":"DataCollectionState","description":"Structured voice/text data collection with field tracking.\n\nThe engine presents fields conversationally, tracks completion, and\noptionally falls back to a Surface form after N turns. Each collected\nfield produces a world.event with confidence 0.5."},"DataCollectionState-Output":{"properties":{"type":{"type":"string","const":"data_collection","title":"Type"},"name":{"type":"string","title":"Name"},"objective":{"type":"string","title":"Objective"},"fields":{"items":{"$ref":"#/components/schemas/CollectionField"},"type":"array","title":"Fields"},"on_complete":{"type":"string","title":"On Complete"},"action_guidelines":{"items":{"type":"string"},"type":"array","title":"Action Guidelines","default":[]},"boundary_constraints":{"items":{"type":"string"},"type":"array","title":"Boundary Constraints","default":[]},"surface_fallback":{"type":"boolean","title":"Surface Fallback","default":false},"surface_fallback_after_turns":{"type":"integer","title":"Surface Fallback After Turns","default":6},"max_turns":{"type":"integer","title":"Max Turns","default":10},"guardrails":{"items":{"$ref":"#/components/schemas/Guardrail"},"type":"array","title":"Guardrails","default":[]},"channel_overrides":{"additionalProperties":{"$ref":"#/components/schemas/ChannelOverride"},"type":"object","title":"Channel Overrides"},"turn_policy":{"anyOf":[{"$ref":"#/components/schemas/TurnPolicy"},{"type":"null"}]},"tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Tool Call Specs","default":[]}},"type":"object","required":["type","name","objective","fields","on_complete"],"title":"DataCollectionState","description":"Structured voice/text data collection with field tracking.\n\nThe engine presents fields conversationally, tracks completion, and\noptionally falls back to a Surface form after N turns. Each collected\nfield produces a world.event with confidence 0.5."},"DataQualityMetrics":{"properties":{"pending_reviews":{"type":"integer","title":"Pending Reviews","default":0},"approval_rate_7d":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Approval Rate 7D"},"avg_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Confidence"},"entities_total":{"type":"integer","title":"Entities Total","default":0},"entities_merged_7d":{"type":"integer","title":"Entities Merged 7D","default":0}},"type":"object","title":"DataQualityMetrics"},"DataQualityResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id","description":"Workspace identifier"},"period_start":{"type":"string","format":"date","title":"Period Start","description":"Start of the reporting period"},"period_end":{"type":"string","format":"date","title":"Period End","description":"End of the reporting period"},"confidence_distribution":{"items":{"$ref":"#/components/schemas/ConfidenceBucket"},"type":"array","title":"Confidence Distribution","description":"Overall confidence distribution across buckets"},"confidence_by_source":{"additionalProperties":{"items":{"$ref":"#/components/schemas/ConfidenceBucket"},"type":"array"},"type":"object","title":"Confidence By Source","description":"Confidence distribution broken down by event source"},"review_pipeline":{"additionalProperties":true,"type":"object","title":"Review Pipeline","description":"Review pipeline throughput statistics"},"timeseries":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Timeseries","description":"Daily confidence averages and event counts"},"total_events":{"type":"integer","title":"Total Events","description":"Total number of events in the period"}},"type":"object","required":["workspace_id","period_start","period_end","confidence_distribution","confidence_by_source","review_pipeline","timeseries","total_events"],"title":"DataQualityResponse","description":"Data quality metrics — confidence distribution, review pipeline stats."},"DataQueryResponse":{"properties":{"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items"},"count":{"type":"integer","title":"Count"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["items","count","has_more"],"title":"DataQueryResponse"},"DataSourceResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"source_type":{"type":"string","enum":["rest_api","webhook","file_drop","fhir_store","ehr","database","custom","smart_fhir","customer_intake","lakebase_schema","crm"],"title":"Source Type"},"connection_config":{"additionalProperties":true,"type":"object","title":"Connection Config"},"entity_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Entity Types"},"field_mappings":{"additionalProperties":true,"type":"object","title":"Field Mappings"},"sync_strategy":{"type":"string","enum":["manual","scheduled","webhook","continuous"],"title":"Sync Strategy"},"sync_schedule":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sync Schedule"},"last_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync At"},"last_sync_status":{"anyOf":[{"type":"string","enum":["success","error"]},{"type":"null"}],"title":"Last Sync Status"},"last_sync_event_count":{"type":"integer","title":"Last Sync Event Count"},"is_active":{"type":"boolean","title":"Is Active"},"is_stale":{"type":"boolean","title":"Is Stale"},"health_status":{"type":"string","enum":["unknown","healthy","degraded"],"title":"Health Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","workspace_id","name","display_name","source_type","connection_config","entity_types","field_mappings","sync_strategy","sync_schedule","last_sync_at","last_sync_status","last_sync_event_count","is_active","is_stale","health_status","created_at","updated_at"],"title":"DataSourceResponse"},"DataSourceStatusResponse":{"properties":{"data_source_id":{"type":"string","format":"uuid","title":"Data Source Id"},"name":{"type":"string","title":"Name"},"is_active":{"type":"boolean","title":"Is Active"},"health_status":{"type":"string","enum":["unknown","healthy","degraded"],"title":"Health Status"},"last_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync At"},"last_sync_status":{"anyOf":[{"type":"string","enum":["success","error"]},{"type":"null"}],"title":"Last Sync Status"},"last_sync_event_count":{"type":"integer","title":"Last Sync Event Count"},"event_count":{"type":"integer","title":"Event Count"},"synced_count":{"type":"integer","title":"Synced Count"},"failed_count":{"type":"integer","title":"Failed Count"}},"type":"object","required":["data_source_id","name","is_active","health_status","last_sync_at","last_sync_status","last_sync_event_count","event_count","synced_count","failed_count"],"title":"DataSourceStatusResponse"},"DataSourceSyncHistoryResponse":{"properties":{"data_source_id":{"type":"string","format":"uuid","title":"Data Source Id"},"name":{"type":"string","title":"Name"},"timeline":{"items":{"$ref":"#/components/schemas/SyncHistoryEntry"},"type":"array","title":"Timeline"},"recent_failures":{"items":{"$ref":"#/components/schemas/SyncFailureEntry"},"type":"array","title":"Recent Failures"}},"type":"object","required":["data_source_id","name","timeline","recent_failures"],"title":"DataSourceSyncHistoryResponse"},"DataTemplate-Input":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"$ref":"#/components/schemas/NameString"},"fields":{"items":{"$ref":"#/components/schemas/DataTemplateField"},"type":"array","maxItems":50,"minItems":1,"title":"Fields"}},"type":"object","required":["name","fields"],"title":"DataTemplate","description":"Named field template — reusable across multiple outreach rules."},"DataTemplate-Output":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"$ref":"#/components/schemas/NameString"},"fields":{"items":{"$ref":"#/components/schemas/DataTemplateField"},"type":"array","maxItems":50,"minItems":1,"title":"Fields"}},"type":"object","required":["name","fields"],"title":"DataTemplate","description":"Named field template — reusable across multiple outreach rules."},"DataTemplateField":{"properties":{"key":{"type":"string","maxLength":128,"minLength":1,"title":"Key"},"label":{"$ref":"#/components/schemas/NameString"},"field_type":{"$ref":"#/components/schemas/FieldType","default":"text"},"required":{"type":"boolean","title":"Required","default":true},"sensitive":{"type":"boolean","title":"Sensitive","default":false},"path":{"type":"string","maxLength":256,"minLength":1,"title":"Path","description":"Dot-notation path into entity state (e.g. demographics.date_of_birth)"}},"type":"object","required":["key","label","path"],"title":"DataTemplateField","description":"A field in a data template — maps to entity state path for gap detection."},"DecisionFactor":{"properties":{"factor":{"type":"string","maxLength":2000,"minLength":1,"title":"Factor","description":"What specifically drove this decision - exact words heard or tone described"},"source_type":{"type":"string","title":"Source Type","description":"Category of the audio input"}},"type":"object","required":["factor","source_type"],"title":"DecisionFactor","description":"A specific audio input that drove an agent decision.","examples":[{"factor":"Caller said 'yes, Thursday works' with confident, faster speech","source_type":"transcript"}]},"DecisionState-Input":{"properties":{"type":{"type":"string","const":"decision","title":"Type"},"name":{"type":"string","title":"Name"},"objective":{"type":"string","title":"Objective"},"exit_conditions":{"items":{"$ref":"#/components/schemas/ExitCondition"},"type":"array","title":"Exit Conditions"},"decision_guidelines":{"items":{"type":"string"},"type":"array","title":"Decision Guidelines","default":[]},"tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Tool Call Specs","default":[]},"wait_for":{"anyOf":[{"type":"string","enum":["surface_submission","human_approval"]},{"type":"null"}],"title":"Wait For"},"guardrails":{"items":{"$ref":"#/components/schemas/Guardrail"},"type":"array","title":"Guardrails","default":[]},"channel_overrides":{"additionalProperties":{"$ref":"#/components/schemas/ChannelOverride"},"type":"object","title":"Channel Overrides"},"turn_policy":{"anyOf":[{"$ref":"#/components/schemas/TurnPolicy"},{"type":"null"}]}},"type":"object","required":["type","name","objective","exit_conditions"],"title":"DecisionState","description":"Passthrough routing state — Agent picks an exit condition, no user interaction."},"DecisionState-Output":{"properties":{"type":{"type":"string","const":"decision","title":"Type"},"name":{"type":"string","title":"Name"},"objective":{"type":"string","title":"Objective"},"exit_conditions":{"items":{"$ref":"#/components/schemas/ExitCondition"},"type":"array","title":"Exit Conditions"},"decision_guidelines":{"items":{"type":"string"},"type":"array","title":"Decision Guidelines","default":[]},"tool_call_specs":{"items":{"$ref":"#/components/schemas/ToolCallSpec"},"type":"array","title":"Tool Call Specs","default":[]},"wait_for":{"anyOf":[{"type":"string","enum":["surface_submission","human_approval"]},{"type":"null"}],"title":"Wait For"},"guardrails":{"items":{"$ref":"#/components/schemas/Guardrail"},"type":"array","title":"Guardrails","default":[]},"channel_overrides":{"additionalProperties":{"$ref":"#/components/schemas/ChannelOverride"},"type":"object","title":"Channel Overrides"},"turn_policy":{"anyOf":[{"$ref":"#/components/schemas/TurnPolicy"},{"type":"null"}]}},"type":"object","required":["type","name","objective","exit_conditions"],"title":"DecisionState","description":"Passthrough routing state — Agent picks an exit condition, no user interaction."},"DecompositionRow":{"properties":{"feature_name":{"type":"string","title":"Feature Name"},"beta":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Beta"},"delta_x":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Delta X"},"contribution":{"type":"number","title":"Contribution"},"family":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Family"},"ci_lo":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ci Lo"},"ci_hi":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ci Hi"}},"type":"object","required":["feature_name","contribution"],"title":"DecompositionRow"},"Default":{"properties":{"kind":{"type":"string","enum":["literal","uuid_v4","now","current_date"],"title":"Kind"},"value":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Value","description":"Only meaningful for ``kind=\"literal\"``. Other kinds ignore it.\nA ``dict`` value is rendered as a JSONB literal — pair it with a\n``jsonb`` column."}},"type":"object","required":["kind"],"title":"Default"},"DeliverSurfaceRequest":{"properties":{"channel_address":{"type":"string","maxLength":256,"minLength":1,"title":"Channel Address","description":"Delivery address (phone number, email, etc.)"}},"type":"object","required":["channel_address"],"title":"DeliverSurfaceRequest","description":"Request to mark a surface as delivered."},"DeliverSurfaceResponse":{"properties":{"surface_id":{"type":"string","format":"uuid","title":"Surface Id"},"status":{"type":"string","enum":["delivered","pending_review"],"title":"Status"},"channel":{"anyOf":[{"$ref":"#/components/schemas/ChannelType"},{"type":"null"}]},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"channel_address":{"type":"string","title":"Channel Address"},"message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Id"},"from_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Number"},"from_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Address"},"delivery_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Provider"},"delivered_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivered At"}},"type":"object","required":["surface_id","status","channel_address"],"title":"DeliverSurfaceResponse"},"DescriptionString":{"type":"string","maxLength":2000},"DestroySessionResponse":{"properties":{"status":{"type":"string","const":"destroyed","title":"Status","description":"Session destruction status"}},"type":"object","required":["status"],"title":"DestroySessionResponse"},"DimensionAnalytics":{"properties":{"dimension":{"type":"string","title":"Dimension"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"weight":{"type":"number","title":"Weight"},"extraction_mode":{"type":"string","title":"Extraction Mode"},"active":{"type":"boolean","title":"Active"},"builtin":{"type":"boolean","title":"Builtin"},"entity_count":{"type":"integer","title":"Entity Count"},"total_facts":{"type":"integer","title":"Total Facts"},"avg_facts_per_entity":{"type":"number","title":"Avg Facts Per Entity"},"avg_confidence":{"type":"number","title":"Avg Confidence"},"source_breakdown":{"additionalProperties":{"type":"integer"},"type":"object","title":"Source Breakdown"},"latest_fact_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Fact At"},"sample_facts":{"items":{"$ref":"#/components/schemas/SampleFact"},"type":"array","title":"Sample Facts","default":[]}},"type":"object","required":["dimension","name","description","weight","extraction_mode","active","builtin","entity_count","total_facts","avg_facts_per_entity","avg_confidence","source_breakdown","latest_fact_at"],"title":"DimensionAnalytics","description":"Per-dimension aggregate stats across all entities."},"DimensionScore":{"properties":{"dimension":{"type":"string","title":"Dimension"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"weight":{"type":"number","title":"Weight"},"fact_count":{"type":"integer","title":"Fact Count"},"avg_confidence":{"type":"number","title":"Avg Confidence"},"source_count":{"type":"integer","title":"Source Count"},"latest_fact_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Fact At"}},"type":"object","required":["dimension","name","description","weight","fact_count","avg_confidence","source_count","latest_fact_at"],"title":"DimensionScore"},"DimensionScoresResponse":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"dimensions":{"items":{"$ref":"#/components/schemas/DimensionScore"},"type":"array","title":"Dimensions"},"total_facts":{"type":"integer","title":"Total Facts"}},"type":"object","required":["entity_id","dimensions","total_facts"],"title":"DimensionScoresResponse"},"DistrictMetricsResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/DistrictMetricsRow"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"DistrictMetricsResponse"},"DistrictMetricsRow":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"district_name":{"type":"string","title":"District Name"},"t2d_incidence_per_1k":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"T2D Incidence Per 1K"},"t2d_predicted_per_1k":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"T2D Predicted Per 1K"},"residual":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Residual"},"cohort_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cohort Size"},"is_anomaly":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Anomaly"},"anomaly_narrative":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anomaly Narrative"},"pcp_per_1k":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pcp Per 1K"},"capacity_gap_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Capacity Gap Pct"},"access_narrative":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Access Narrative"},"unmet_demand_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Unmet Demand Score"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["workspace_id","district_name"],"title":"DistrictMetricsRow"},"DnsRecordResponse":{"properties":{"address":{"type":"string","title":"Address","description":"Fully-qualified hostname the DNS entry lives under."},"record":{"type":"string","title":"Record","description":"Target value the customer must publish at their DNS provider."},"type":{"type":"string","enum":["CNAME","MX","TXT"],"title":"Type"},"verified":{"type":"boolean","title":"Verified","description":"Whether the live DNS lookup at the time of the GET found the entry."}},"type":"object","required":["address","record","type","verified"],"title":"DnsRecordResponse"},"DropColumnAction":{"properties":{"op":{"type":"string","const":"drop_column","title":"Op"},"name":{"$ref":"#/components/schemas/IdentifierString"}},"type":"object","required":["op","name"],"title":"DropColumnAction"},"DropColumnDefaultAction":{"properties":{"op":{"type":"string","const":"drop_column_default","title":"Op"},"name":{"$ref":"#/components/schemas/IdentifierString"}},"type":"object","required":["op","name"],"title":"DropColumnDefaultAction"},"DropConstraintAction":{"properties":{"op":{"type":"string","const":"drop_constraint","title":"Op"},"name":{"$ref":"#/components/schemas/IdentifierString"}},"type":"object","required":["op","name"],"title":"DropConstraintAction"},"DropIndexAction":{"properties":{"op":{"type":"string","const":"drop_index","title":"Op"},"index_name":{"$ref":"#/components/schemas/IdentifierString"}},"type":"object","required":["op","index_name"],"title":"DropIndexAction"},"EgressIpsResponse":{"properties":{"egress_ips":{"items":{"type":"string"},"type":"array","title":"Egress Ips"},"region":{"type":"string","title":"Region"},"note":{"type":"string","title":"Note"}},"type":"object","required":["egress_ips","region","note"],"title":"EgressIpsResponse"},"EmailUseCaseRequest":{"properties":{"channel":{"type":"string","const":"email","title":"Channel"},"entity_name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Entity Name"},"name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"setup_id":{"type":"string","format":"uuid","title":"Setup Id"},"sender_email_address":{"type":"string","format":"email","title":"Sender Email Address"},"email_type":{"type":"string","enum":["transactional","marketing"],"title":"Email Type"}},"type":"object","required":["channel","entity_name","name","setup_id","sender_email_address","email_type"],"title":"EmailUseCaseRequest"},"EmotionSummary":{"properties":{"dominant_emotion":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Dominant Emotion","description":"Most frequent emotion (e.g. 'neutral', 'happy', 'angry')"},"average_valence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Valence","description":"Average emotional valence -1.0 to 1.0"},"average_arousal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Arousal","description":"Average emotional arousal 0.0 to 1.0"},"peak_negative_valence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Peak Negative Valence","description":"Most negative valence observed"},"barge_in_count":{"type":"integer","title":"Barge In Count","description":"Number of caller interruptions (emotion-tagged)","default":0}},"type":"object","title":"EmotionSummary","description":"Aggregated emotional analysis across the call.\n\nFree-form residual on the raw ``emotion_summary`` JSONB:\n``compound_emotions: list[{name, score}]``. Not exposed via this\ntyped shape — readers wanting it consume the JSONB endpoint."},"EmotionalShift":{"properties":{"timestamp_seconds":{"anyOf":[{"type":"number","maximum":86400.0,"minimum":0.0},{"type":"null"}],"title":"Timestamp Seconds","description":"When the shift occurred (seconds from start)"},"from_state":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"From State","description":"Emotional state before the shift"},"to_state":{"anyOf":[{"type":"string","maxLength":500,"minLength":1},{"type":"null"}],"title":"To State","description":"Emotional state after the shift"},"trigger":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Trigger","description":"What caused the shift - exact words and tone"},"agent_awareness":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Agent Awareness","description":"Whether the agent noticed and responded to this shift"}},"type":"object","title":"EmotionalShift","description":"A critical emotional state change detected in the caller's voice.","examples":[{"agent_awareness":"Agent did not acknowledge the frustration - continued with the standard verification flow","from_state":"neutral","timestamp_seconds":15.2,"to_state":"frustrated","trigger":"Caller's pitch rose and speech rate doubled when saying 'I already told you my date of birth'"}]},"EmotionalSummary":{"properties":{"dominant_emotion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dominant Emotion"},"average_valence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Valence"},"average_arousal":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Arousal"},"peak_negative_valence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Peak Negative Valence"},"peak_negative_emotion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Peak Negative Emotion"},"emotional_shifts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Emotional Shifts"},"final_trend":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Trend"},"segment_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Segment Count"},"barge_in_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Barge In Count"},"compound_emotions":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Compound Emotions"}},"type":"object","title":"EmotionalSummary"},"EndpointResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Endpoint ID — stable, used in subsequent GET/PATCH/DELETE/test URLs."},"name":{"type":"string","title":"Name","description":"Slug-like identifier. Unique per integration; immutable post-create."},"description":{"type":"string","title":"Description","description":"LLM-facing description."},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"],"title":"Method","description":"HTTP method."},"path":{"type":"string","title":"Path","description":"URL path appended to the integration's base_url."},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema","description":"JSON Schema for the tool's input arguments."},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers","description":"Static request headers."},"static_body_fields":{"additionalProperties":{"type":"string"},"type":"object","title":"Static Body Fields","description":"Static body fields merged into every request. Keys are RFC 6901 JSON Pointers\n(e.g. ``/meta/tool_name`` for nested, ``/foo`` for a root-level field)."},"body_format":{"type":"string","enum":["json","form"],"title":"Body Format","description":"Outbound body encoding.","default":"json"},"response_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Template","description":"Jinja template rendered against the parsed JSON response."},"max_response_length":{"type":"integer","title":"Max Response Length","description":"Truncate the final rendered string to this many chars.","default":0},"timeout_seconds":{"type":"number","title":"Timeout Seconds","description":"Per-request timeout.","default":30.0},"max_retries":{"type":"integer","title":"Max Retries","description":"Retry attempts on transient failures.","default":2},"retry_on_status":{"items":{"type":"integer"},"type":"array","uniqueItems":true,"title":"Retry On Status","description":"HTTP status codes that trigger a retry."}},"type":"object","required":["id","name","description","method","path"],"title":"EndpointResponse","description":"Per-endpoint response (V186 flat shape)."},"EnrichmentHistoryEntry":{"properties":{"event_id":{"type":"string","format":"uuid","title":"Event Id"},"value":{"title":"Value"},"value_type":{"type":"string","enum":["string","number","boolean","date","enum","json"],"title":"Value Type"},"confidence":{"type":"number","title":"Confidence"},"source":{"type":"string","title":"Source"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"effective_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective At"},"ingested_at":{"type":"string","format":"date-time","title":"Ingested At"},"supersedes":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Supersedes"},"is_current":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Current"}},"type":"object","required":["event_id","value","value_type","confidence","source","ingested_at","is_current"],"title":"EnrichmentHistoryEntry"},"EnrichmentHistoryResponse":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"key":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z0-9][a-z0-9_\\-]*$","title":"Key"},"history":{"items":{"$ref":"#/components/schemas/EnrichmentHistoryEntry"},"type":"array","title":"History"},"dropped_count":{"type":"integer","title":"Dropped Count","default":0}},"type":"object","required":["entity_id","key","history"],"title":"EnrichmentHistoryResponse"},"EnrichmentKeyCreateBody":{"properties":{"entity_type":{"type":"string","maxLength":64,"minLength":1,"title":"Entity Type"},"key":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z0-9][a-z0-9_\\-]*$","title":"Key"},"value_type":{"type":"string","enum":["string","number","boolean","date","enum","json"],"title":"Value Type"},"allowed_values":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Allowed Values","description":"Required when value_type=enum. Ignored otherwise."},"source_hint":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"min_confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Min Confidence","default":0.0},"is_pii":{"type":"boolean","title":"Is Pii","default":false}},"type":"object","required":["entity_type","key","value_type"],"title":"EnrichmentKeyCreateBody"},"EnrichmentKeyListResponse":{"properties":{"keys":{"items":{"$ref":"#/components/schemas/EnrichmentKeyResponse"},"type":"array","title":"Keys"}},"type":"object","required":["keys"],"title":"EnrichmentKeyListResponse"},"EnrichmentKeyPatchBody":{"properties":{"allowed_values":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Allowed Values"},"source_hint":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"min_confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Min Confidence"},"is_pii":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Pii"}},"type":"object","title":"EnrichmentKeyPatchBody"},"EnrichmentKeyResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"entity_type":{"type":"string","maxLength":64,"minLength":1,"title":"Entity Type"},"key":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z0-9][a-z0-9_\\-]*$","title":"Key"},"value_type":{"type":"string","enum":["string","number","boolean","date","enum","json"],"title":"Value Type"},"allowed_values":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Allowed Values"},"source_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Hint"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"min_confidence":{"type":"number","title":"Min Confidence"},"is_pii":{"type":"boolean","title":"Is Pii"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","workspace_id","entity_type","key","value_type","min_confidence","is_pii","created_at","updated_at"],"title":"EnrichmentKeyResponse"},"EnrichmentListResponse":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"values":{"items":{"$ref":"#/components/schemas/EnrichmentValueResponse"},"type":"array","title":"Values"}},"type":"object","required":["entity_id","values"],"title":"EnrichmentListResponse"},"EnrichmentValueResponse":{"properties":{"key":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z0-9][a-z0-9_\\-]*$","title":"Key"},"value":{"title":"Value"},"value_type":{"type":"string","enum":["string","number","boolean","date","enum","json"],"title":"Value Type"},"confidence":{"type":"number","title":"Confidence"},"source":{"type":"string","title":"Source"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"effective_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective At"},"ingested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ingested At"},"event_id":{"type":"string","format":"uuid","title":"Event Id"}},"type":"object","required":["key","value","value_type","confidence","source","event_id"],"title":"EnrichmentValueResponse"},"EnrichmentWriteBody":{"properties":{"value":{"title":"Value","description":"Scalar or JSON-compatible value to store."},"value_type":{"anyOf":[{"type":"string","enum":["string","number","boolean","date","enum","json"]},{"type":"null"}],"title":"Value Type","description":"Overrides the registry value_type when set. Rarely needed."},"source":{"type":"string","maxLength":64,"minLength":1,"title":"Source","description":"Write source — e.g. manual, forms, auto_enrich.","default":"manual"},"source_system":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Source System","description":"Subsystem / connector identifier."},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"Write confidence. Must be >= registry min_confidence for the key.","default":1.0},"effective_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective At","description":"When the value became true (UTC). Defaults to ingested_at."}},"type":"object","required":["value"],"title":"EnrichmentWriteBody"},"EntityEventResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"domain":{"type":"string","title":"Domain"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"event_type":{"type":"string","title":"Event Type"},"event_subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Subtype"},"fhir_resource_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fhir Resource Type"},"fhir_resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fhir Resource Id"},"data":{"additionalProperties":true,"type":"object","title":"Data"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","default":"manual"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence","default":1.0},"produced_by_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Produced By Agent"},"display_name":{"anyOf":[{"$ref":"#/components/schemas/EventDisplayNameString"},{"type":"null"}]},"status":{"anyOf":[{"$ref":"#/components/schemas/EventStatusString"},{"type":"null"}]},"description":{"anyOf":[{"$ref":"#/components/schemas/EventDescriptionString"},{"type":"null"}]},"outcome":{"anyOf":[{"$ref":"#/components/schemas/EventOutcomeString"},{"type":"null"}]},"channel":{"anyOf":[{"$ref":"#/components/schemas/EventChannelString"},{"type":"null"}]},"call_sid":{"anyOf":[{"$ref":"#/components/schemas/EventCallSidString"},{"type":"null"}]},"direction":{"anyOf":[{"$ref":"#/components/schemas/EventDirectionString"},{"type":"null"}]},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"supersedes":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Supersedes"},"is_current":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Current","default":true},"effective_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective At"},"ingested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ingested At"},"synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Synced At"},"sync_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sync Error"},"sync_status":{"anyOf":[{"type":"string","enum":["pending","synced","failed","processing","not_applicable"]},{"type":"null"}],"title":"Sync Status"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the event was created"}},"type":"object","required":["id","domain","event_type"],"title":"EntityEventResponse"},"EntityListResponse":{"properties":{"entities":{"items":{"$ref":"#/components/schemas/EntityResponse"},"type":"array","title":"Entities"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More"},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["entities","total","has_more"],"title":"EntityListResponse"},"EntityRelationshipResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"source_entity_id":{"type":"string","format":"uuid","title":"Source Entity Id"},"source_entity_type":{"type":"string","title":"Source Entity Type"},"target_entity_id":{"type":"string","format":"uuid","title":"Target Entity Id"},"target_entity_type":{"type":"string","title":"Target Entity Type"},"relationship":{"type":"string","title":"Relationship"},"data":{"additionalProperties":true,"type":"object","title":"Data"},"confidence":{"type":"number","title":"Confidence","default":1.0},"discovered_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discovered By"},"is_current":{"type":"boolean","title":"Is Current","default":true},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the relationship was created"}},"type":"object","required":["id","source_entity_id","source_entity_type","target_entity_id","target_entity_type","relationship"],"title":"EntityRelationshipResponse"},"EntityRelationshipsResponse":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"relationships":{"items":{"$ref":"#/components/schemas/EntityRelationshipResponse"},"type":"array","title":"Relationships"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["entity_id","relationships","total"],"title":"EntityRelationshipsResponse"},"EntityResolutionMetrics":{"properties":{"total_same_as_edges":{"type":"integer","title":"Total Same As Edges"},"recent_merges_24h":{"type":"integer","title":"Recent Merges 24H"},"loop_status":{"type":"string","title":"Loop Status"},"last_tick_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Tick At"},"merges_last_tick":{"type":"integer","title":"Merges Last Tick","default":0}},"type":"object","required":["total_same_as_edges","recent_merges_24h","loop_status"],"title":"EntityResolutionMetrics"},"EntityResolveExternalId":{"properties":{"system":{"$ref":"#/components/schemas/ExternalSystemString","description":"External system label (lowercase, e.g. 'epic')."},"value":{"$ref":"#/components/schemas/ExternalValueString","description":"System-issued identifier."}},"type":"object","required":["system","value"],"title":"EntityResolveExternalId","description":"Reference to an external-system identifier.\n\n``system`` labels which system minted the value (``epic``, ``charm``,\n``charmhealth``, …). The value is matched against any\nnested key in ``world.entities.external_ids`` whose value equals\n``value``. ``system`` is informational for scoring; it doesn't\nconstrain the lookup, since adapters disagree on naming."},"EntityResolveMatch":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"entity_type":{"type":"string","title":"Entity Type"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence","description":"Match confidence (0-1)."},"matched_on":{"items":{"type":"string","enum":["entity_id","phone","email","canonical_id","external_id"]},"type":"array","title":"Matched On","description":"Identifier kinds that actually matched this row."},"summary":{"$ref":"#/components/schemas/EntityResolveSummary"}},"type":"object","required":["entity_id","entity_type","confidence","summary"],"title":"EntityResolveMatch","description":"One candidate match with provenance + confidence."},"EntityResolveRequest":{"properties":{"entity_type":{"$ref":"#/components/schemas/EntityTypeString","description":"Required entity type filter (e.g. 'person'). Narrows the scan to the right index."},"phone":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}],"description":"E.164 phone number."},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email","description":"Primary email (case-insensitive match)."},"canonical_id":{"anyOf":[{"$ref":"#/components/schemas/CanonicalIdLookupString"},{"type":"null"}],"description":"Canonical/MRN identifier ('charm:Patient:42' or raw MRN)."},"external_id":{"anyOf":[{"$ref":"#/components/schemas/EntityResolveExternalId"},{"type":"null"}],"description":"External-system identifier reference."},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id","description":"Direct UUID lookup. Useful for confirming an entity exists / re-fetching summary."},"limit":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Limit","description":"Maximum candidates to return.","default":25}},"type":"object","required":["entity_type"],"title":"EntityResolveRequest","description":"Polymorphic identifier query.\n\nProvide ``entity_type`` plus any subset of identifier fields. Each\nidentifier is OR-ed in SQL; matches are ranked by confidence and\nby the number of identifiers that actually matched the row.\nReturns at most ``limit`` candidates (default 25, max 50).\n\nFor latency-sensitive callers (inbound voice, webhook handlers),\npass exactly one identifier — the indexed lookup is sub-10ms.\nMulti-identifier queries are useful for confirming a row matches\non more than one signal (phone + email + MRN)."},"EntityResolveResponse":{"properties":{"matches":{"items":{"$ref":"#/components/schemas/EntityResolveMatch"},"type":"array","title":"Matches"},"total":{"type":"integer","minimum":0.0,"title":"Total","description":"Number of candidates returned."}},"type":"object","required":["total"],"title":"EntityResolveResponse"},"EntityResolveSummary":{"properties":{"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"birth_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Birth Date"},"mrn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mrn"},"canonical_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Id"},"external_ids":{"additionalProperties":true,"type":"object","title":"External Ids"},"last_event_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Event At"},"event_count":{"type":"integer","title":"Event Count","default":0},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"}},"type":"object","title":"EntityResolveSummary","description":"Compact identity card returned for each match.\n\nExcludes the full ``state`` JSONB and the entity embedding — fetch\nvia ``GET /v1/{ws}/entities/{entity_id}`` if needed. The fields\nhere are the ones a UI / agent needs to confirm \"yes, that's the\nright person\" before paying for the full state read."},"EntityResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"entity_type":{"type":"string","title":"Entity Type"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"canonical_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Id"},"external_ids":{"additionalProperties":true,"type":"object","title":"External Ids"},"state":{"additionalProperties":true,"type":"object","title":"State","description":"Full JSONB state blob. Prefer typed fields below.","deprecated":true},"has_projection":{"type":"boolean","title":"Has Projection","default":false},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Display name (person, organization)"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Primary phone number (E.164)"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Primary email address"},"birth_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Birth Date","description":"Date of birth (YYYY-MM-DD)"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender","description":"Gender"},"mrn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mrn","description":"Medical record number"},"appointment_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appointment Status","description":"Appointment status (booked, confirmed, cancelled)"},"appointment_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Appointment Start","description":"Appointment start time (UTC)"},"appointment_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Appointment End","description":"Appointment end time (UTC)"},"appointment_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appointment Type","description":"Appointment/visit type"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain","description":"Organization domain"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry","description":"Organization industry"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid","description":"Twilio call SID"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction","description":"Call direction (inbound, outbound)"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds","description":"Call duration in seconds"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Entity status"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Primary data source"},"first_seen_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"First Seen At"},"last_event_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Event At"},"event_count":{"type":"integer","title":"Event Count","default":0},"confidence":{"type":"number","title":"Confidence","default":1.0},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the entity was created"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"When the entity was last updated"}},"type":"object","required":["id","workspace_id","entity_type"],"title":"EntityResponse"},"EntityStatsSummary":{"properties":{"total_entities":{"type":"integer","title":"Total Entities"},"total_events":{"type":"integer","title":"Total Events"},"sync_pending":{"type":"integer","title":"Sync Pending"},"sync_synced":{"type":"integer","title":"Sync Synced"},"sync_failed":{"type":"integer","title":"Sync Failed"},"by_event_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Event Type"},"event_type_window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Event Type Window Days","description":"Window applied to by_event_type counts when an entity_type filter is supplied."}},"type":"object","required":["total_entities","total_events","sync_pending","sync_synced","sync_failed"],"title":"EntityStatsSummary"},"EntitySummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"state":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"State"}},"type":"object","required":["id","entity_type","display_name","state"],"title":"EntitySummary","description":"Inline entity state for review context."},"EntityTimelineResponse":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"events":{"items":{"$ref":"#/components/schemas/EntityEventResponse"},"type":"array","title":"Events"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More"},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["entity_id","events","total","has_more"],"title":"EntityTimelineResponse"},"EntityTypeRegistryResponse":{"properties":{"entity_types":{"items":{"$ref":"#/components/schemas/EntityTypeSummary"},"type":"array","title":"Entity Types"},"total_entities":{"type":"integer","title":"Total Entities"}},"type":"object","required":["entity_types","total_entities"],"title":"EntityTypeRegistryResponse"},"EntityTypeString":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z0-9_]+$"},"EntityTypeSummary":{"properties":{"entity_type":{"type":"string","title":"Entity Type"},"count":{"type":"integer","title":"Count"},"last_updated":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Updated"},"has_projection":{"type":"boolean","title":"Has Projection"}},"type":"object","required":["entity_type","count","last_updated","has_projection"],"title":"EntityTypeSummary"},"EnvironmentCheckResponse":{"properties":{"current":{"type":"string","title":"Current"},"target":{"type":"string","title":"Target"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"}},"type":"object","required":["current","target","warnings"],"title":"EnvironmentCheckResponse"},"EnvironmentOverrides":{"properties":{"data_source_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Data Source Id"},"tool_overrides":{"additionalProperties":true,"type":"object","title":"Tool Overrides"},"data_source_overrides":{"additionalProperties":true,"type":"object","title":"Data Source Overrides"}},"type":"object","title":"EnvironmentOverrides","description":"Per-environment config overrides merged at runtime."},"EnvironmentSettingsRequest":{"properties":{"environments":{"additionalProperties":{"$ref":"#/components/schemas/EnvironmentOverrides"},"type":"object","title":"Environments"}},"type":"object","required":["environments"],"title":"EnvironmentSettingsRequest"},"EnvironmentSettingsResponse":{"properties":{"environments":{"additionalProperties":{"$ref":"#/components/schemas/EnvironmentOverrides"},"type":"object","title":"Environments"}},"type":"object","title":"EnvironmentSettingsResponse"},"EscalationDailyStats":{"properties":{"requested":{"type":"integer","title":"Requested","default":0},"connected":{"type":"integer","title":"Connected","default":0},"completed":{"type":"integer","title":"Completed","default":0},"avg_wait_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Wait Seconds"},"avg_handle_time_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Handle Time Seconds"}},"type":"object","title":"EscalationDailyStats"},"EscalationEventResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"event_type":{"type":"string","title":"Event Type","description":"Event type (e.g. escalation.requested, escalation.connected)"},"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Event payload — shape varies by event_type"},"source":{"type":"string","title":"Source","description":"System that emitted the event"},"confidence":{"type":"number","title":"Confidence","description":"Confidence score 0.0 to 1.0"},"ingested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ingested At","description":"When the event was ingested"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the event occurred"}},"type":"object","required":["id","workspace_id","event_type","data","source","confidence"],"title":"EscalationEventResponse"},"EscalationPolicy":{"properties":{"context_window_exhaustion":{"oneOf":[{"$ref":"#/components/schemas/OperatorAction"},{"$ref":"#/components/schemas/ForwardAction"},{"$ref":"#/components/schemas/HangupAction"}],"title":"Context Window Exhaustion","discriminator":{"propertyName":"type","mapping":{"forward":"#/components/schemas/ForwardAction","hangup":"#/components/schemas/HangupAction","operator":"#/components/schemas/OperatorAction"}}},"risk_scorer":{"oneOf":[{"$ref":"#/components/schemas/OperatorAction"},{"$ref":"#/components/schemas/ForwardAction"},{"$ref":"#/components/schemas/HangupAction"}],"title":"Risk Scorer","discriminator":{"propertyName":"type","mapping":{"forward":"#/components/schemas/ForwardAction","hangup":"#/components/schemas/HangupAction","operator":"#/components/schemas/OperatorAction"}}},"conversation_monitor":{"oneOf":[{"$ref":"#/components/schemas/OperatorAction"},{"$ref":"#/components/schemas/ForwardAction"},{"$ref":"#/components/schemas/HangupAction"}],"title":"Conversation Monitor","discriminator":{"propertyName":"type","mapping":{"forward":"#/components/schemas/ForwardAction","hangup":"#/components/schemas/HangupAction","operator":"#/components/schemas/OperatorAction"}}}},"type":"object","title":"EscalationPolicy","description":"Per-service routing for engine-detected escalation triggers.\n\nEach trigger source maps to one EscalationAction. The three enumerated\nfields below are the trigger_sources actually emitted by the agent-engine\ntoday; new triggers can be added as fields without breaking back-compat.\n\nPartial policies are intentional: every field defaults to OperatorAction,\nso a PUT body like ``{\"context_window_exhaustion\": {\"type\": \"forward\"}}``\noverrides only that trigger and leaves the others on the operator default.\nTo opt the entire service back to today's behavior, set\n``Service.escalation_policy = None`` (caveat: the platform-api Service\nupdate path uses ``exclude_none=True`` and currently has no clears-via-null\nbranch, so this requires a direct config edit; see follow-up issue).\n\nResolution lookup is done against ``model_fields``: a trigger_source that\nis not an enumerated field name falls through to OperatorAction, never\na non-Action Pydantic internal."},"EscalationState":{"properties":{"status":{"type":"string","title":"Status","default":"none"},"escalation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Escalation Id"},"requested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Requested At"},"connected_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Connected At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"string"},{"type":"null"}],"title":"Completed At"},"trigger":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger"},"trigger_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trigger Source"},"concept":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Concept"},"similarity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Similarity"},"agent_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Agent Confidence"},"operator_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operator Type"},"regulatory_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Regulatory Basis"},"immediate":{"type":"boolean","title":"Immediate","default":false},"risk_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Risk Score"},"operator_entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operator Entity Id"},"wait_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Wait Seconds"},"handle_time_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Handle Time Seconds"},"human_segment_turn_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Human Segment Turn Count"}},"type":"object","title":"EscalationState"},"EscalationStatsBucket":{"properties":{"key":{"type":"string","title":"Key"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["key","count"],"title":"EscalationStatsBucket"},"EscalationStatsResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"period":{"type":"string","title":"Period"},"group_by":{"type":"string","title":"Group By"},"buckets":{"items":{"$ref":"#/components/schemas/EscalationStatsBucket"},"type":"array","title":"Buckets"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["workspace_id","period","group_by","buckets","total"],"title":"EscalationStatsResponse"},"EventBreakdownItem":{"properties":{"key":{"type":"string","title":"Key","description":"Grouping key (event type or source name)"},"count":{"type":"integer","title":"Count","description":"Number of events for this key"}},"type":"object","required":["key","count"],"title":"EventBreakdownItem","description":"Single row in an event breakdown aggregation."},"EventBreakdownResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id","description":"Workspace identifier"},"period_start":{"type":"string","format":"date","title":"Period Start","description":"Start of the reporting period"},"period_end":{"type":"string","format":"date","title":"Period End","description":"End of the reporting period"},"by_type":{"items":{"$ref":"#/components/schemas/EventBreakdownItem"},"type":"array","title":"By Type","description":"Event counts grouped by event type"},"by_source":{"items":{"$ref":"#/components/schemas/EventBreakdownItem"},"type":"array","title":"By Source","description":"Event counts grouped by source"},"total_events":{"type":"integer","title":"Total Events","description":"Total number of events in the period"}},"type":"object","required":["workspace_id","period_start","period_end","by_type","by_source","total_events"],"title":"EventBreakdownResponse"},"EventCallSidString":{"type":"string","maxLength":128},"EventChannelString":{"type":"string","maxLength":64},"EventDescriptionString":{"type":"string","maxLength":4096},"EventDirectionString":{"type":"string","maxLength":64},"EventDisplayNameString":{"type":"string","maxLength":512},"EventOutcomeString":{"type":"string","maxLength":256},"EventStatusString":{"type":"string","maxLength":128},"EventSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"},"fhir_resource_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fhir Resource Type"},"fhir_resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fhir Resource Id"},"data":{"additionalProperties":true,"type":"object","title":"Data"},"confidence":{"type":"number","title":"Confidence"},"review_status":{"type":"string","enum":["pending","raw","uncertain","verified","approved","human_approved","auto_approved","rejected","corrected","flagged"],"title":"Review Status"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the event was created"}},"type":"object","required":["id","event_type","fhir_resource_type","fhir_resource_id","data","confidence","review_status"],"title":"EventSummary","description":"Inline event data for review context — avoids extra API calls."},"EventTypeRegistryResponse":{"properties":{"event_types":{"items":{"$ref":"#/components/schemas/EventTypeSummary"},"type":"array","title":"Event Types"},"total_events":{"type":"integer","title":"Total Events"}},"type":"object","required":["event_types","total_events"],"title":"EventTypeRegistryResponse"},"EventTypeString":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-zA-Z0-9._\\-:*]+$"},"EventTypeSummary":{"properties":{"event_type":{"type":"string","title":"Event Type"},"count":{"type":"integer","title":"Count"},"domains":{"items":{"type":"string"},"type":"array","title":"Domains"},"sources":{"items":{"type":"string"},"type":"array","title":"Sources"}},"type":"object","required":["event_type","count","domains","sources"],"title":"EventTypeSummary"},"ExecutePanelRequest":{"properties":{"filter_values":{"additionalProperties":true,"type":"object","title":"Filter Values","description":"Filter values to apply to panel queries"}},"type":"object","title":"ExecutePanelRequest"},"ExitCondition":{"properties":{"description":{"type":"string","title":"Description"},"next_state":{"type":"string","title":"Next State"},"filler_hint":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filler Hint"}},"type":"object","required":["description","next_state"],"title":"ExitCondition"},"ExplorationConfig":{"properties":{"coverage_driven_selection":{"type":"boolean","title":"Coverage Driven Selection","default":false},"enable_forking":{"type":"boolean","title":"Enable Forking","default":false},"max_forks_per_scenario":{"type":"integer","maximum":5.0,"minimum":0.0,"title":"Max Forks Per Scenario","default":2},"recommend_candidates":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Recommend Candidates","default":3}},"type":"object","title":"ExplorationConfig"},"ExternalIntegrationCredentialRequest":{"properties":{"service_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":100,"minItems":1,"title":"Service Ids"},"name":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["service_ids"],"title":"ExternalIntegrationCredentialRequest"},"ExternalIntegrationCredentialResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"integration_id":{"type":"string","format":"uuid","title":"Integration Id"},"client_id":{"type":"string","title":"Client Id"},"service_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Service Ids"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"is_active":{"type":"boolean","title":"Is Active"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"rotated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Rotated At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"}},"type":"object","required":["id","workspace_id","integration_id","client_id","service_ids","is_active"],"title":"ExternalIntegrationCredentialResponse"},"ExternalIntegrationCredentialSecretResponse":{"properties":{"credential":{"$ref":"#/components/schemas/ExternalIntegrationCredentialResponse"},"client_secret":{"type":"string","title":"Client Secret"}},"type":"object","required":["credential","client_secret"],"title":"ExternalIntegrationCredentialSecretResponse"},"ExternalIntegrationRequest":{"properties":{"name":{"type":"string","maxLength":128,"minLength":2,"pattern":"^[a-z0-9][a-z0-9_-]*[a-z0-9]$","title":"Name"},"display_name":{"$ref":"#/components/schemas/NameString"},"description":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Description"}},"type":"object","required":["name","display_name"],"title":"ExternalIntegrationRequest"},"ExternalIntegrationResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","maxLength":128,"minLength":2,"pattern":"^[a-z0-9][a-z0-9_-]*[a-z0-9]$","title":"Name"},"display_name":{"$ref":"#/components/schemas/NameString"},"description":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Description"},"is_active":{"type":"boolean","title":"Is Active"},"created_by_entity_id":{"type":"string","format":"uuid","title":"Created By Entity Id"},"created_by_credential_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By Credential Id"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","workspace_id","name","display_name","is_active","created_by_entity_id"],"title":"ExternalIntegrationResponse"},"ExternalIntegrationUpdateRequest":{"properties":{"name":{"type":"string","maxLength":128,"minLength":2,"pattern":"^[a-z0-9][a-z0-9_-]*[a-z0-9]$","title":"Name"},"display_name":{"$ref":"#/components/schemas/NameString","title":"Display Name"},"description":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Description"}},"type":"object","title":"ExternalIntegrationUpdateRequest"},"ExternalSystemString":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z0-9_\\-]+$"},"ExternalValueString":{"type":"string","maxLength":256,"minLength":1},"FailureClass":{"type":"string","enum":["timeout","input_rejected","rounds_exhausted","generic"],"title":"FailureClass","description":"Why a tool result is a failure — produced by the executor at RUN time.\n\nUnlike ``ResultDelivery`` (a fixed config-time axis), this is a runtime\nclassification the executor knows at the moment of failure. It flavors the\nagent-facing failure wording and the world-event / status-tool observability,\nand it is ALSO an optional routing key: a state x tool binding may set\n``ToolCallSpec.failure_delivery_by_class`` to deliver differently per class\n(e.g. interrupt on timeout, queue on a generic error). With no per-class map\n(the default), failed results route by the ``failure_delivery`` floor,\nunchanged. Add a member only in the same change that wires a producer for it —\nadding one also widens the per-class routing surface, so it must be a\ndeliberate, produced class."},"FeatureDef":{"properties":{"name":{"type":"string","title":"Name"},"kind":{"type":"string","title":"Kind"}},"type":"object","required":["name","kind"],"title":"FeatureDef"},"FeatureDistributionResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"feature":{"type":"string","title":"Feature"},"kind":{"type":"string","title":"Kind"},"bins":{"items":{"$ref":"#/components/schemas/HistogramBin"},"type":"array","title":"Bins"},"n_total":{"type":"integer","title":"N Total"},"n_y1":{"type":"integer","title":"N Y1"}},"type":"object","required":["workspace_id","feature","kind","bins","n_total","n_y1"],"title":"FeatureDistributionResponse"},"FeaturesResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/FeatureDef"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"FeaturesResponse"},"FhirAppointmentListResponse":{"properties":{"appointments":{"items":{"$ref":"#/components/schemas/FhirAppointmentView"},"type":"array","title":"Appointments"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More","default":false},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["appointments","total"],"title":"FhirAppointmentListResponse"},"FhirAppointmentView":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"},"patient_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Patient Name"},"practitioner_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Practitioner Name"},"location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Location Name"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"cancel_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancel Reason"},"appointment_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appointment Type"},"duration_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Minutes"},"modality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modality"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"canonical_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Id"},"event_count":{"type":"integer","title":"Event Count","default":0},"last_event_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Event At"}},"type":"object","required":["entity_id"],"title":"FhirAppointmentView"},"FhirImportRequest":{"properties":{"bundle":{"additionalProperties":true,"type":"object","title":"Bundle"},"source":{"type":"string","maxLength":128,"title":"Source","default":"fhir_import"},"source_system":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Source System"},"data_source_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Data Source Id"},"dedup":{"type":"boolean","title":"Dedup","description":"When true, identical re-uploads of the same FHIR resource are skipped via content-hash dedup. Set to false to force emission regardless of content changes.","default":true},"unsupported_resource_policy":{"$ref":"#/components/schemas/FhirUnsupportedResourcePolicy","description":"Controls resources whose resourceType is missing or not projected by platform FHIR APIs. 'error' skips the resource and adds a per-resource error; 'skip' skips it without adding an error. Unsupported resources are never emitted as silent raw world events.","default":"error"}},"type":"object","required":["bundle"],"title":"FhirImportRequest"},"FhirImportResponse":{"properties":{"events_created":{"type":"integer","title":"Events Created"},"events_skipped":{"type":"integer","title":"Events Skipped","default":0},"events_updated":{"type":"integer","title":"Events Updated","default":0},"entities_created":{"type":"integer","title":"Entities Created"},"entities_updated":{"type":"integer","title":"Entities Updated"},"error_count":{"type":"integer","title":"Error Count","default":0},"errors":{"items":{"type":"string"},"type":"array","maxItems":1000,"title":"Errors"},"errors_truncated":{"type":"boolean","title":"Errors Truncated","default":false},"unsupported_resource_count":{"type":"integer","title":"Unsupported Resource Count","default":0},"unsupported_resources":{"items":{"$ref":"#/components/schemas/FhirUnsupportedResourceItem"},"type":"array","maxItems":1000,"title":"Unsupported Resources"},"unsupported_resources_truncated":{"type":"boolean","title":"Unsupported Resources Truncated","default":false},"upsert_semantics":{"type":"string","const":"same_resource_id_upsert","title":"Upsert Semantics","description":"FHIR import uses workspace + resourceType + id as the natural key. Identical re-uploads can be deduped; changed resources supersede prior current events.","default":"same_resource_id_upsert"},"absence_semantics":{"type":"string","const":"absent_resources_persist","title":"Absence Semantics","description":"Resources omitted from a later bundle are not deleted or archived by import.","default":"absent_resources_persist"}},"type":"object","required":["events_created","entities_created","entities_updated"],"title":"FhirImportResponse"},"FhirLocationListResponse":{"properties":{"locations":{"items":{"$ref":"#/components/schemas/FhirLocationView"},"type":"array","title":"Locations"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More","default":false},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["locations","total"],"title":"FhirLocationListResponse"},"FhirLocationView":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Address"},"address_line":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address Line"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"latitude":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latitude"},"longitude":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Longitude"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"facility_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Facility Id"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"hours":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Hours"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"canonical_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Id"},"event_count":{"type":"integer","title":"Event Count","default":0},"last_event_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Event At"}},"type":"object","required":["entity_id"],"title":"FhirLocationView"},"FhirOrganizationListResponse":{"properties":{"organizations":{"items":{"$ref":"#/components/schemas/FhirOrganizationView"},"type":"array","title":"Organizations"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More","default":false},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["organizations","total"],"title":"FhirOrganizationListResponse"},"FhirOrganizationView":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Domain"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Address"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"canonical_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Id"},"event_count":{"type":"integer","title":"Event Count","default":0},"last_event_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Event At"}},"type":"object","required":["entity_id"],"title":"FhirOrganizationView"},"FhirPatientListResponse":{"properties":{"patients":{"items":{"$ref":"#/components/schemas/FhirPatientView"},"type":"array","title":"Patients"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More","default":false},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["patients","total"],"title":"FhirPatientListResponse"},"FhirPatientView":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Name"},"birth_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Birth Date"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"mrn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mrn"},"address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Address"},"address_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address State"},"address_postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address Postal Code"},"address_city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address City"},"active_conditions":{"items":{"type":"string"},"type":"array","title":"Active Conditions"},"active_medications":{"items":{"type":"string"},"type":"array","title":"Active Medications"},"allergies":{"items":{"type":"string"},"type":"array","title":"Allergies"},"insurance":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Insurance"},"primary_payer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Payer Name"},"practice_payer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Practice Payer Id"},"member_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Member Id"},"policyholder_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policyholder Name"},"policyholder_relationship":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policyholder Relationship"},"policyholder_dob":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Policyholder Dob"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"canonical_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Id"},"event_count":{"type":"integer","title":"Event Count","default":0},"confidence":{"type":"number","title":"Confidence","default":1.0},"last_event_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Event At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["entity_id"],"title":"FhirPatientView"},"FhirPractitionerListResponse":{"properties":{"practitioners":{"items":{"$ref":"#/components/schemas/FhirPractitionerView"},"type":"array","title":"Practitioners"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More","default":false},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["practitioners","total"],"title":"FhirPractitionerListResponse"},"FhirPractitionerView":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"npi":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Npi"},"specialty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Specialty"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"member_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Member Id"},"scheduling_eligible":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Scheduling Eligible"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"canonical_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Id"},"event_count":{"type":"integer","title":"Event Count","default":0},"last_event_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Event At"}},"type":"object","required":["entity_id"],"title":"FhirPractitionerView"},"FhirResourceHistoryEntry":{"properties":{"event_id":{"type":"string","format":"uuid","title":"Event Id"},"event_type":{"type":"string","title":"Event Type"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"data_source_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Data Source Id"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"is_current":{"type":"boolean","title":"Is Current"},"effective_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"fields_affected":{"items":{"type":"string"},"type":"array","title":"Fields Affected"},"data":{"additionalProperties":true,"type":"object","title":"Data"}},"type":"object","required":["event_id","event_type","is_current"],"title":"FhirResourceHistoryEntry"},"FhirResourceHistoryResponse":{"properties":{"resource_type":{"type":"string","title":"Resource Type"},"resource_id":{"type":"string","title":"Resource Id"},"entries":{"items":{"$ref":"#/components/schemas/FhirResourceHistoryEntry"},"type":"array","title":"Entries"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More","default":false},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["resource_type","resource_id","entries","total"],"title":"FhirResourceHistoryResponse"},"FhirResourceResponse":{"properties":{"resource_type":{"type":"string","title":"Resource Type"},"resource_id":{"type":"string","title":"Resource Id"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"data":{"additionalProperties":true,"type":"object","title":"Data"}},"type":"object","required":["resource_type","resource_id","data"],"title":"FhirResourceResponse"},"FhirSearchResponse":{"properties":{"resource_type":{"type":"string","title":"Resource Type"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"entries":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Entries"},"next_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Url"}},"type":"object","required":["resource_type","total","entries"],"title":"FhirSearchResponse"},"FhirSlotListResponse":{"properties":{"slots":{"items":{"$ref":"#/components/schemas/FhirSlotView"},"type":"array","title":"Slots"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More","default":false},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["slots","total"],"title":"FhirSlotListResponse"},"FhirSlotView":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"},"schedule_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule Ref"},"provider_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Name"},"provider_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Id"},"facility_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Facility Id"},"specialty":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Specialty"},"visit_type_ids":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Visit Type Ids"},"visit_type_names":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Visit Type Names"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"canonical_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Canonical Id"},"event_count":{"type":"integer","title":"Event Count","default":0},"last_event_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Event At"}},"type":"object","required":["entity_id"],"title":"FhirSlotView"},"FhirStatusResponse":{"properties":{"configured":{"type":"boolean","title":"Configured"},"connector_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connector Type"},"event_count":{"type":"integer","title":"Event Count"},"entity_count":{"type":"integer","title":"Entity Count"},"entity_type_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Entity Type Counts"},"resource_type_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Resource Type Counts"},"last_poll_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Poll At"},"last_change_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Change At"},"sync_healthy":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sync Healthy"}},"type":"object","required":["configured","event_count","entity_count"],"title":"FhirStatusResponse"},"FhirUnsupportedResourceItem":{"properties":{"resource_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Resource Type"},"resource_id":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Resource Id"},"location":{"type":"string","maxLength":128,"title":"Location"},"reason":{"type":"string","maxLength":512,"title":"Reason"}},"type":"object","required":["location","reason"],"title":"FhirUnsupportedResourceItem"},"FhirUnsupportedResourcePolicy":{"type":"string","enum":["error","skip"]},"FhirWriteRequest":{"properties":{"data":{"additionalProperties":true,"type":"object","title":"Data"},"data_source_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Data Source Id"}},"type":"object","required":["data"],"title":"FhirWriteRequest"},"FieldSaveRequest":{"properties":{"value":{"title":"Value","description":"The field value to save"}},"type":"object","required":["value"],"title":"FieldSaveRequest"},"FieldType":{"type":"string","enum":["text","textarea","date","phone","email","number","select","multiselect","checkbox","photo","signature","file","heading","info"],"title":"FieldType","description":"Input field types for surface data collection."},"FireTriggerRequest":{"properties":{"input":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input","description":"Optional overrides merged into the trigger's input_template at fire time."}},"type":"object","title":"FireTriggerRequest"},"ForecastDrawPoint":{"properties":{"draw_id":{"type":"integer","title":"Draw Id"},"t":{"type":"number","title":"T"},"value":{"type":"number","title":"Value"}},"type":"object","required":["draw_id","t","value"],"title":"ForecastDrawPoint"},"ForecastDrawsResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/ForecastDrawPoint"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"ForecastDrawsResponse"},"ForecastFanPointRow":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"run_id":{"type":"string","title":"Run Id"},"scenario":{"type":"string","enum":["baseline","with_policy","observational"],"title":"Scenario"},"t":{"type":"number","title":"T"},"lower_95":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lower 95"},"upper_95":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Upper 95"},"median":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Median"},"observed":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Observed"},"ym":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ym"},"is_historical":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Historical"}},"type":"object","required":["workspace_id","run_id","scenario","t"],"title":"ForecastFanPointRow"},"ForecastFanResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/ForecastFanPointRow"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"ForecastFanResponse"},"ForkAlternative":{"properties":{"caller_text":{"type":"string","maxLength":2000,"title":"Caller Text"},"emotion":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Emotion"},"valence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":-1.0},{"type":"null"}],"title":"Valence"}},"type":"object","required":["caller_text"],"title":"ForkAlternative"},"ForkRequest":{"properties":{"alternatives":{"items":{"$ref":"#/components/schemas/ForkAlternative"},"type":"array","maxItems":20,"minItems":1,"title":"Alternatives"}},"type":"object","required":["alternatives"],"title":"ForkRequest"},"FormTemplate-Input":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"$ref":"#/components/schemas/NameString"},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"category":{"type":"string","enum":["intake","update","consent","screening","survey","custom"],"title":"Category","default":"custom"},"patient_type":{"type":"string","enum":["new","returning","any"],"title":"Patient Type","default":"any"},"fields":{"items":{"$ref":"#/components/schemas/FormTemplateField"},"type":"array","maxItems":200,"minItems":1,"title":"Fields"},"sections":{"items":{"$ref":"#/components/schemas/FormTemplateSection"},"type":"array","maxItems":20,"minItems":1,"title":"Sections"},"branding":{"anyOf":[{"$ref":"#/components/schemas/BrandingConfig"},{"type":"null"}]},"completion_title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Completion Title"},"completion_message":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Completion Message"},"completion_action_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Completion Action Url"},"submit_button_text":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Submit Button Text"},"active":{"type":"boolean","title":"Active","default":true},"version":{"type":"integer","minimum":1.0,"title":"Version","default":1}},"type":"object","required":["name","fields","sections"],"title":"FormTemplate","description":"Reusable form template with sections, prefill, branding.\n\nExtends DataTemplate concept. Up to 200 fields, organized in sections.\nStored in workspace settings[\"form_templates\"] JSONB.\n\nExamples:\n- New patient intake (85 fields, 11 sections)\n- Returning patient update (27 fields, 5 sections)\n- Pre-surgery checklist (15 fields, 3 sections)\n- PHQ-9 screening (10 fields, 1 section)"},"FormTemplate-Output":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"$ref":"#/components/schemas/NameString"},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"category":{"type":"string","enum":["intake","update","consent","screening","survey","custom"],"title":"Category","default":"custom"},"patient_type":{"type":"string","enum":["new","returning","any"],"title":"Patient Type","default":"any"},"fields":{"items":{"$ref":"#/components/schemas/FormTemplateField"},"type":"array","maxItems":200,"minItems":1,"title":"Fields"},"sections":{"items":{"$ref":"#/components/schemas/FormTemplateSection"},"type":"array","maxItems":20,"minItems":1,"title":"Sections"},"branding":{"anyOf":[{"$ref":"#/components/schemas/BrandingConfig"},{"type":"null"}]},"completion_title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Completion Title"},"completion_message":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Completion Message"},"completion_action_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Completion Action Url"},"submit_button_text":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Submit Button Text"},"active":{"type":"boolean","title":"Active","default":true},"version":{"type":"integer","minimum":1.0,"title":"Version","default":1}},"type":"object","required":["name","fields","sections"],"title":"FormTemplate","description":"Reusable form template with sections, prefill, branding.\n\nExtends DataTemplate concept. Up to 200 fields, organized in sections.\nStored in workspace settings[\"form_templates\"] JSONB.\n\nExamples:\n- New patient intake (85 fields, 11 sections)\n- Returning patient update (27 fields, 5 sections)\n- Pre-surgery checklist (15 fields, 3 sections)\n- PHQ-9 screening (10 fields, 1 section)"},"FormTemplateField":{"properties":{"key":{"type":"string","maxLength":128,"minLength":1,"title":"Key"},"label":{"$ref":"#/components/schemas/NameString"},"field_type":{"$ref":"#/components/schemas/FieldType","default":"text"},"required":{"type":"boolean","title":"Required","default":true},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options"},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"placeholder":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Placeholder"},"validation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Validation"},"sensitive":{"type":"boolean","title":"Sensitive","default":false},"condition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Condition"},"consent_text":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Consent Text"},"prefill_path":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Prefill Path","description":"Dot-notation path into entity state for prefill (e.g. demographics.date_of_birth)"},"layout_group":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Layout Group","description":"Row grouping hint — fields with same layout_group render side-by-side"}},"type":"object","required":["key","label"],"title":"FormTemplateField","description":"Extended field with prefill_path mapping to entity state.\n\nUnlike SurfaceField (agent-generated, dynamic), FormTemplateField is\na reusable definition that maps to FHIR/EHR data paths for auto-prefill."},"FormTemplateListResponse":{"properties":{"templates":{"items":{"$ref":"#/components/schemas/FormTemplate-Output"},"type":"array","title":"Templates"}},"type":"object","required":["templates"],"title":"FormTemplateListResponse","description":"List of form templates for a workspace."},"FormTemplateSection":{"properties":{"id":{"type":"string","maxLength":64,"minLength":1,"title":"Id"},"title":{"$ref":"#/components/schemas/NameString"},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"field_keys":{"items":{"type":"string"},"type":"array","maxItems":200,"minItems":1,"title":"Field Keys"},"condition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Condition"}},"type":"object","required":["id","title","field_keys"],"title":"FormTemplateSection","description":"A section in a form template (maps to one wizard step)."},"FormTemplateUpdateRequest":{"properties":{"templates":{"items":{"$ref":"#/components/schemas/FormTemplate-Input"},"type":"array","maxItems":50,"title":"Templates"}},"type":"object","required":["templates"],"title":"FormTemplateUpdateRequest","description":"Replace all form templates."},"ForwardAction":{"properties":{"type":{"type":"string","const":"forward","title":"Type","default":"forward"}},"type":"object","title":"ForwardAction","description":"Cold-transfer the caller to the service's configured forwarding\ndestination (set via ``Service.voice_config.forwarding``).\n\nNo agent-side decision and no operator dashboard required — the engine\ninvokes the same forwarding callback used by the LLM-driven\n``forward_call`` tool, with no location override, which falls through to\nthe per-service ``ServiceForwardingConfig``.\n\nIf ``voice_config.forwarding`` is unset, the dispatcher falls back to the\noperator path (audit event + SSE only)."},"ForwardingDetails":{"properties":{"forward_to":{"type":"string","title":"Forward To","x-phi":true},"should_disconnect":{"type":"boolean","title":"Should Disconnect"},"warm_transfer":{"type":"boolean","title":"Warm Transfer","default":true},"forwarded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Forwarded At"}},"type":"object","required":["forward_to","should_disconnect"],"title":"ForwardingDetails"},"FunctionExample":{"properties":{"input":{"additionalProperties":true,"type":"object","title":"Input"},"output":{"title":"Output"},"description":{"type":"string","title":"Description","default":""}},"additionalProperties":false,"type":"object","required":["input","output"],"title":"FunctionExample","description":"One example call, surfaced to the LLM and the DC test panel.\n\nExamples are first-class metadata, not buried in a UC ``COMMENT``\nclause the way Databricks' native authoring requires. The DC\ntool-picker shows them; the LLM tool spec includes them inline."},"GapRequiredField":{"properties":{"path":{"type":"string","maxLength":256,"minLength":1,"title":"Path","description":"Dot-notation path into entity state"},"label":{"$ref":"#/components/schemas/NameString"},"field_type":{"$ref":"#/components/schemas/FieldType","default":"text"},"min_items":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Min Items","description":"For list fields, minimum items required"}},"type":"object","required":["path","label"],"title":"GapRequiredField","description":"A field that must be present in entity state."},"GapRequirement-Input":{"properties":{"name":{"$ref":"#/components/schemas/NameString"},"entity_type":{"type":"string","const":"person","title":"Entity Type","default":"person"},"trigger":{"type":"string","enum":["upcoming_appointment","recent_interaction"],"title":"Trigger","default":"upcoming_appointment"},"required_fields":{"items":{"$ref":"#/components/schemas/GapRequiredField"},"type":"array","maxItems":50,"minItems":1,"title":"Required Fields"},"channel":{"$ref":"#/components/schemas/ChannelType","default":"email"},"priority":{"type":"string","enum":["low","normal","high"],"title":"Priority","default":"normal"},"surface_title":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"Title for generated surfaces. Defaults to requirement name."},"surface_description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]}},"type":"object","required":["name","required_fields"],"title":"GapRequirement","description":"A named gap detection rule."},"GapRequirement-Output":{"properties":{"name":{"$ref":"#/components/schemas/NameString"},"entity_type":{"type":"string","const":"person","title":"Entity Type","default":"person"},"trigger":{"type":"string","enum":["upcoming_appointment","recent_interaction"],"title":"Trigger","default":"upcoming_appointment"},"required_fields":{"items":{"$ref":"#/components/schemas/GapRequiredField"},"type":"array","maxItems":50,"minItems":1,"title":"Required Fields"},"channel":{"$ref":"#/components/schemas/ChannelType","default":"email"},"priority":{"type":"string","enum":["low","normal","high"],"title":"Priority","default":"normal"},"surface_title":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"Title for generated surfaces. Defaults to requirement name."},"surface_description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]}},"type":"object","required":["name","required_fields"],"title":"GapRequirement","description":"A named gap detection rule."},"GapScannerPreviewRequest":{"properties":{"limit":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Limit","default":50}},"type":"object","title":"GapScannerPreviewRequest"},"GapScannerSettingsRequest":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"scan_interval_seconds":{"anyOf":[{"type":"integer","maximum":86400.0,"minimum":60.0},{"type":"null"}],"title":"Scan Interval Seconds"},"appointment_lookahead_hours":{"anyOf":[{"type":"integer","maximum":720.0,"minimum":1.0},{"type":"null"}],"title":"Appointment Lookahead Hours"},"cooldown_hours":{"anyOf":[{"type":"integer","maximum":8760.0,"minimum":1.0},{"type":"null"}],"title":"Cooldown Hours"},"max_surfaces_per_tick":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":1.0},{"type":"null"}],"title":"Max Surfaces Per Tick"},"max_pending_surfaces":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":0.0},{"type":"null"}],"title":"Max Pending Surfaces","description":"Max non-terminal surfaces per entity (0 = disabled)"},"min_completion_rate":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Min Completion Rate","description":"Min historical completion rate to create new surfaces (0.0 = disabled)"},"channel_optimization":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Channel Optimization","description":"Use entity preferred channel over static requirement channel"},"requirements":{"anyOf":[{"items":{"$ref":"#/components/schemas/GapRequirement-Input"},"type":"array","maxItems":100},{"type":"null"}],"title":"Requirements"}},"type":"object","title":"GapScannerSettingsRequest"},"GapScannerSettingsResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"scan_interval_seconds":{"type":"integer","title":"Scan Interval Seconds"},"appointment_lookahead_hours":{"type":"integer","title":"Appointment Lookahead Hours"},"cooldown_hours":{"type":"integer","title":"Cooldown Hours"},"max_surfaces_per_tick":{"type":"integer","title":"Max Surfaces Per Tick"},"max_pending_surfaces":{"type":"integer","title":"Max Pending Surfaces"},"min_completion_rate":{"type":"number","title":"Min Completion Rate"},"channel_optimization":{"type":"boolean","title":"Channel Optimization"},"requirements":{"items":{"$ref":"#/components/schemas/GapRequirement-Output"},"type":"array","title":"Requirements"}},"type":"object","required":["enabled","scan_interval_seconds","appointment_lookahead_hours","cooldown_hours","max_surfaces_per_tick","max_pending_surfaces","min_completion_rate","channel_optimization","requirements"],"title":"GapScannerSettingsResponse"},"GetSimulationBenchmarkResultsRequest":{"properties":{"run_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":100,"minItems":1,"title":"Run Ids"}},"type":"object","required":["run_ids"],"title":"GetSimulationBenchmarkResultsRequest"},"Guardrail":{"properties":{"name":{"type":"string","maxLength":128,"title":"Name"},"description":{"type":"string","maxLength":1000,"title":"Description"},"enforcement":{"type":"string","enum":["hard","soft"],"title":"Enforcement","default":"hard"}},"type":"object","required":["name","description"],"title":"Guardrail","description":"Typed safety rule enforced per-state (not just global freetext guidelines)."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HangupAction":{"properties":{"type":{"type":"string","const":"hangup","title":"Type","default":"hangup"}},"type":"object","title":"HangupAction","description":"End the call gracefully via the existing speaker-drain hangup path."},"HardEscalationRule":{"properties":{"name":{"type":"string","title":"Name"},"operator_type":{"type":"string","title":"Operator Type"},"reason":{"type":"string","title":"Reason"},"regulatory_basis":{"type":"string","title":"Regulatory Basis"},"immediate":{"type":"boolean","title":"Immediate","default":false},"detection":{"type":"string","enum":["intent","state","fhir"],"title":"Detection"},"intent_patterns":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Intent Patterns"}},"type":"object","required":["name","operator_type","reason","regulatory_basis","detection"],"title":"HardEscalationRule","description":"Non-negotiable escalation rule for healthcare compliance."},"HealFieldRequest":{"properties":{"key":{"type":"string","maxLength":128,"minLength":1,"title":"Key"},"value":{"type":"string","maxLength":2000,"minLength":1,"title":"Value"},"field_type":{"type":"string","maxLength":32,"title":"Field Type"},"label":{"type":"string","maxLength":256,"title":"Label"},"sensitive":{"type":"boolean","title":"Sensitive","default":false},"context":{"additionalProperties":true,"type":"object","title":"Context"}},"type":"object","required":["key","value","field_type","label"],"title":"HealFieldRequest"},"HealFieldResponse":{"properties":{"corrected_value":{"type":"string","maxLength":4000,"title":"Corrected Value"},"explanation":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Explanation"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"}},"type":"object","required":["corrected_value","confidence"],"title":"HealFieldResponse"},"HealthSyncResponse":{"properties":{"connector_heartbeats":{"items":{"$ref":"#/components/schemas/ConnectorHeartbeat"},"type":"array","title":"Connector Heartbeats"}},"type":"object","title":"HealthSyncResponse"},"HipaaReportResponse":{"properties":{"generated_at":{"type":"string","title":"Generated At"},"report_period_days":{"type":"integer","title":"Report Period Days"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"audit_summary":{"additionalProperties":true,"type":"object","title":"Audit Summary"},"retention_policy":{"additionalProperties":true,"type":"object","title":"Retention Policy"},"encryption":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Encryption"},"access_controls":{"additionalProperties":true,"type":"object","title":"Access Controls"},"api_key_summary":{"additionalProperties":{"type":"integer"},"type":"object","title":"Api Key Summary"},"compliance_status":{"type":"string","title":"Compliance Status"}},"type":"object","required":["generated_at","report_period_days","workspace_id","audit_summary","retention_policy","encryption","access_controls","api_key_summary","compliance_status"],"title":"HipaaReportResponse"},"HistogramBin":{"properties":{"x_lo":{"type":"number","title":"X Lo"},"x_hi":{"type":"number","title":"X Hi"},"y0":{"type":"integer","title":"Y0"},"y1":{"type":"integer","title":"Y1"}},"type":"object","required":["x_lo","x_hi","y0","y1"],"title":"HistogramBin"},"HumanSegment":{"properties":{"speaker_role":{"type":"string","title":"Speaker Role"},"transcript":{"type":"string","title":"Transcript","x-phi":true},"timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Timestamp"}},"type":"object","required":["speaker_role","transcript"],"title":"HumanSegment"},"IdentifierString":{"type":"string","maxLength":63,"minLength":1,"pattern":"^[a-z][a-z0-9_]{0,62}$"},"Identity":{"properties":{"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"developed_by":{"type":"string","title":"Developed By"},"default_spoken_language":{"type":"string","title":"Default Spoken Language"},"relationship_to_developer":{"$ref":"#/components/schemas/RelationshipToDeveloper"}},"type":"object","required":["name","role","developed_by","default_spoken_language"],"title":"Identity"},"IdentityMetrics":{"properties":{"active_api_keys":{"type":"integer","title":"Active Api Keys","default":0},"active_sessions":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Active Sessions"},"failed_auths_1h":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed Auths 1H"},"locked_accounts":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Locked Accounts"},"mfa_coverage_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Mfa Coverage Pct"}},"type":"object","title":"IdentityMetrics"},"Index-Input":{"properties":{"columns":{"items":{"$ref":"#/components/schemas/IdentifierString"},"type":"array","maxItems":32,"minItems":1,"title":"Columns"}},"type":"object","required":["columns"],"title":"Index"},"Index-Output":{"properties":{"name":{"type":"string","title":"Name"},"definition":{"type":"string","title":"Definition","description":"``pg_indexes.indexdef`` — the full CREATE INDEX statement."}},"type":"object","required":["name","definition"],"title":"Index"},"InjectRequest":{"properties":{"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message"},"sender":{"type":"string","maxLength":200,"title":"Sender","default":"System"},"event_type":{"type":"string","enum":["external_event","guidance"],"title":"Event Type","description":"external_event (factual info) or guidance (instructional)","default":"external_event"}},"type":"object","required":["message"],"title":"InjectRequest"},"InjectResponse":{"properties":{"status":{"type":"string","enum":["delivered","queued_no_subscriber"],"title":"Status"},"call_sid":{"type":"string","title":"Call Sid"}},"type":"object","required":["status","call_sid"],"title":"InjectResponse"},"IntakeFileResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"volume_path":{"type":"string","title":"Volume Path"},"sha256":{"type":"string","title":"Sha256"},"size_bytes":{"type":"integer","title":"Size Bytes"},"scan_status":{"type":"string","title":"Scan Status"}},"type":"object","required":["id","volume_path","sha256","size_bytes","scan_status"],"title":"IntakeFileResponse"},"IntakeLinkResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"customer_slug":{"$ref":"#/components/schemas/SlugString"},"display_name":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"upload_url":{"type":"string","maxLength":512,"title":"Upload Url"},"link_token":{"type":"string","maxLength":128,"minLength":32,"title":"Link Token"},"status":{"type":"string","enum":["active","expired","revoked","exhausted"],"title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"type":"string","format":"date-time","title":"Expires At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"max_uploads":{"type":"integer","title":"Max Uploads"},"upload_count":{"type":"integer","title":"Upload Count"},"last_upload_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Upload At"}},"type":"object","required":["id","workspace_id","customer_slug","display_name","upload_url","link_token","status","created_at","expires_at","revoked_at","max_uploads","upload_count","last_upload_at"],"title":"IntakeLinkResponse"},"IntakeUploadResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"customer_slug":{"$ref":"#/components/schemas/SlugString"},"filename":{"$ref":"#/components/schemas/NameString"},"content_type":{"type":"string","maxLength":256,"title":"Content Type"},"sha256":{"type":"string","maxLength":64,"minLength":64,"title":"Sha256"},"size_bytes":{"type":"integer","title":"Size Bytes"},"received_at":{"type":"string","format":"date-time","title":"Received At"},"scan_status":{"type":"string","enum":["skipped","pending","clean","infected"],"title":"Scan Status"}},"type":"object","required":["id","customer_slug","filename","content_type","sha256","size_bytes","received_at","scan_status"],"title":"IntakeUploadResponse"},"IntegrationApprovalResponse":{"properties":{"status":{"type":"string","enum":["granted","rejected"],"title":"Status"},"conversation_id":{"type":"string","maxLength":256,"minLength":1,"title":"Conversation Id"}},"type":"object","required":["status","conversation_id"],"title":"IntegrationApprovalResponse","description":"Resolution outcome for a pending integration-write approval."},"IntegrationRejectRequest":{"properties":{"reason":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Reason"}},"type":"object","title":"IntegrationRejectRequest","description":"Reject body — optional free-text reason surfaced to the agent."},"IntegrationToolRef-Input":{"properties":{"integration":{"type":"string","title":"Integration"},"endpoint":{"type":"string","title":"Endpoint"}},"type":"object","required":["integration","endpoint"],"title":"IntegrationToolRef","description":"Reference to an integration endpoint by integration + endpoint name."},"InteractionDynamics":{"properties":{"turn_taking_quality":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Turn Taking Quality","description":"How well speakers managed turn-taking - interruptions, overlaps, pacing"},"information_density":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Information Density","description":"Whether the agent gave too much or too little information per turn"},"repair_effectiveness":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Repair Effectiveness","description":"How misunderstandings were detected and resolved"},"rapport_trajectory":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Rapport Trajectory","description":"How the interpersonal dynamic evolved across the call"}},"type":"object","title":"InteractionDynamics","description":"System-level analysis of the conversation as a whole."},"InternalServiceConfigResponse":{"properties":{"service":{"$ref":"#/components/schemas/Service"},"agent_version":{"$ref":"#/components/schemas/AgentVersion"},"context_graph_version":{"$ref":"#/components/schemas/ContextGraphVersion"}},"type":"object","required":["service","agent_version","context_graph_version"],"title":"InternalServiceConfigResponse","description":"Composite response matching ServiceConfig shape for voice-agent consumption."},"InternalSkillResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"system_prompt":{"type":"string","title":"System Prompt","default":""},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema","default":{}},"result_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result Schema"},"model":{"type":"string","title":"Model","default":"claude-sonnet-4-6"},"max_tokens":{"type":"integer","title":"Max Tokens","default":4096},"max_result_chars":{"type":"integer","title":"Max Result Chars","default":2000},"max_input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Input Tokens"},"timeout_s":{"type":"number","title":"Timeout S","default":60.0},"thinking_effort":{"anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"null"}],"title":"Thinking Effort"},"enable_caching":{"type":"boolean","title":"Enable Caching","default":true},"enable_citations":{"type":"boolean","title":"Enable Citations","default":false},"use_structured_output":{"type":"boolean","title":"Use Structured Output","default":false},"integration_tools":{"items":{"$ref":"#/components/schemas/src__routes__internal_skills__IntegrationToolRef"},"type":"array","title":"Integration Tools","default":[]},"static_tools":{"items":{"$ref":"#/components/schemas/src__routes__internal_skills__StaticToolDef"},"type":"array","title":"Static Tools","default":[]},"enabled":{"type":"boolean","title":"Enabled","default":true},"max_agent_turns":{"type":"integer","title":"Max Agent Turns","default":20},"checkpoint_enabled":{"type":"boolean","title":"Checkpoint Enabled","default":true},"approval_required":{"type":"boolean","title":"Approval Required","default":false}},"type":"object","required":["id","workspace_id","slug","name","description"],"title":"InternalSkillResponse"},"InternalSkillsListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/InternalSkillResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"InternalSkillsListResponse"},"InvoiceItem":{"properties":{"id":{"type":"string","title":"Id","description":"Invoice ID"},"customer_id":{"type":"string","title":"Customer Id","description":"Customer ID"},"invoice_number":{"type":"string","title":"Invoice Number","description":"Human-readable invoice number"},"period_start":{"type":"string","title":"Period Start","description":"Billing period start (ISO-8601)"},"period_end":{"type":"string","title":"Period End","description":"Billing period end (ISO-8601)"},"subtotal":{"type":"string","title":"Subtotal","description":"Subtotal before adjustments"},"adjustments":{"type":"string","title":"Adjustments","description":"Adjustment amount"},"total":{"type":"string","title":"Total","description":"Invoice total"},"status":{"type":"string","enum":["draft","sent","paid","void"],"title":"Status","description":"Invoice status"},"line_items":{"items":{"$ref":"#/components/schemas/InvoiceLineItem"},"type":"array","title":"Line Items","description":"Itemized charges"},"pdf_s3_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf S3 Key","description":"S3 key for the PDF"},"sent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sent At","description":"When the invoice was sent (ISO-8601)"},"paid_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paid At","description":"When the invoice was paid (ISO-8601)"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At","description":"When the invoice was created (ISO-8601)"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"When the invoice was last updated (ISO-8601)"}},"type":"object","required":["id","customer_id","invoice_number","period_start","period_end","subtotal","adjustments","total","status","line_items","pdf_s3_key","sent_at","paid_at","created_at","updated_at"],"title":"InvoiceItem"},"InvoiceLineItem":{"properties":{"meter_key":{"type":"string","title":"Meter Key","description":"Meter identifier"},"metering_source":{"type":"string","enum":["production","simulation"],"title":"Metering Source","description":"Traffic class","default":"production"},"description":{"type":"string","title":"Description","description":"Line item description","default":""},"quantity":{"type":"string","title":"Quantity","description":"Usage quantity"},"unit_price":{"type":"string","title":"Unit Price","description":"Price per unit"},"total":{"type":"string","title":"Total","description":"Line item total"}},"type":"object","required":["meter_key","quantity","unit_price","total"],"title":"InvoiceLineItem","description":"A single line item on an invoice.\n\n``metering_source`` defaults to ``\"production\"`` for backward\ncompatibility with invoices generated before the metering_source\ndimension was introduced — those invoices were production-only by\ndefinition. New invoices always carry an explicit value."},"InvokeRequest":{"properties":{"input":{"additionalProperties":true,"type":"object","title":"Input","description":"Caller arguments matching input_schema."}},"type":"object","title":"InvokeRequest","description":"Invoke a registered function with caller-supplied args."},"InvokeResponse":{"properties":{"result":{"title":"Result"},"duration_ms":{"type":"number","title":"Duration Ms","default":0.0},"row_count":{"type":"integer","title":"Row Count","default":0}},"type":"object","title":"InvokeResponse"},"JoinCallRequest":{"properties":{"call_sid":{"type":"string","maxLength":64,"minLength":1,"title":"Call Sid"},"mode":{"type":"string","enum":["listen","takeover"],"title":"Mode","default":"takeover"}},"type":"object","required":["call_sid"],"title":"JoinCallRequest","description":"Request to join an active call as operator."},"JoinCallResponse":{"properties":{"participant_call_sid":{"type":"string","title":"Participant Call Sid","description":"Twilio participant call SID"},"conference_sid":{"type":"string","title":"Conference Sid","description":"Twilio conference SID"},"mode":{"type":"string","enum":["listen","takeover"],"title":"Mode","description":"Operator mode: listen or takeover"},"operator_entity_id":{"type":"string","format":"uuid","title":"Operator Entity Id","description":"World entity ID of the operator"}},"type":"object","required":["participant_call_sid","conference_sid","mode","operator_entity_id"],"title":"JoinCallResponse","description":"Confirmation of operator joining a call's conference."},"KetamineBlockOverlapParams":{"properties":{"rule_kind":{"type":"string","const":"ketamine_block_overlap","title":"Rule Kind","default":"ketamine_block_overlap"},"window_days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Window Days"}},"type":"object","required":["window_days"],"title":"KetamineBlockOverlapParams","description":"How many days after a ketamine session to block follow-up\nappointments (clinical safety window)."},"KeyMoment":{"properties":{"turn":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Turn","description":"Turn index where the moment occurred"},"type":{"type":"string","enum":["latency_spike","silence","barge_in","loop","tool_failure","escalation","safety_flag","high_risk","elevated_risk"],"title":"Type","description":"Category of the moment"},"severity":{"type":"string","enum":["info","warning","error"],"title":"Severity","description":"Severity level","default":"warning"},"description":{"type":"string","title":"Description","description":"Human-readable description"}},"type":"object","required":["type","description"],"title":"KeyMoment","description":"Notable event during the call worth highlighting."},"LLMConfig":{"properties":{"llm_name":{"type":"string","title":"Llm Name"},"params":{"additionalProperties":true,"type":"object","title":"Params"},"experience_controls":{"anyOf":[{"$ref":"#/components/schemas/LLMExperienceControls"},{"type":"null"}]}},"type":"object","required":["llm_name"],"title":"LLMConfig"},"LLMExperienceControls":{"properties":{"verbosity":{"anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"null"}],"title":"Verbosity"},"reasoning_effort":{"anyOf":[{"type":"string","enum":["none","minimal","low","medium","high","xhigh"]},{"type":"null"}],"title":"Reasoning Effort"},"temperature":{"anyOf":[{"type":"number","maximum":2.0,"minimum":0.0},{"type":"null"}],"title":"Temperature"},"top_p":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Top P"},"presence_penalty":{"anyOf":[{"type":"number","maximum":2.0,"minimum":-2.0},{"type":"null"}],"title":"Presence Penalty"},"frequency_penalty":{"anyOf":[{"type":"number","maximum":2.0,"minimum":-2.0},{"type":"null"}],"title":"Frequency Penalty"},"response_format":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Response Format"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed"},"stop":{"anyOf":[{"type":"string"},{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Stop"},"logit_bias":{"anyOf":[{"additionalProperties":{"type":"number","maximum":100.0,"minimum":-100.0},"type":"object"},{"type":"null"}],"title":"Logit Bias"},"logprobs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Logprobs"},"top_logprobs":{"anyOf":[{"type":"integer","maximum":20.0,"minimum":0.0},{"type":"null"}],"title":"Top Logprobs"},"parallel_tool_calls":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Parallel Tool Calls"},"service_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Tier"},"prompt_cache_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Cache Key"},"prompt_cache_retention":{"anyOf":[{"type":"string","enum":["in-memory","24h"]},{"type":"null"}],"title":"Prompt Cache Retention"},"safety_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Safety Identifier"},"store":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Store"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Metadata"}},"additionalProperties":false,"type":"object","title":"LLMExperienceControls","description":"First-class chat experience controls for consumer-facing agents.\n\n``params`` remains available as a provider-specific escape hatch. These\nfields cover the OpenAI Chat Completions controls that most directly shape\nresponse tone, feel, determinism, latency, and structured output behavior.\nToken budgets are intentionally excluded so version sets do not reintroduce\naccidental response truncation."},"LanguageProviderEntry":{"properties":{"provider":{"type":"string","enum":["cartesia","elevenlabs","groq"],"title":"Provider"},"config":{"additionalProperties":true,"type":"object","maxProperties":20,"title":"Config"}},"type":"object","required":["provider"],"title":"LanguageProviderEntry","description":"Per-language TTS provider configuration."},"LastPollInfo":{"properties":{"at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"At"},"duration_ms":{"type":"integer","title":"Duration Ms","default":0},"event_count":{"type":"integer","title":"Event Count","default":0},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"LastPollInfo"},"LatencySummary":{"properties":{"avg_engine_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Engine Ms","description":"Average reasoning-engine latency (ms)"},"p50_engine_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P50 Engine Ms","description":"Median engine latency (ms)"},"p95_engine_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P95 Engine Ms","description":"95th percentile engine latency (ms)"},"avg_audio_ttfb_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Audio Ttfb Ms","description":"Average audio time-to-first-byte (ms)"},"p50_audio_ttfb_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P50 Audio Ttfb Ms","description":"Median audio TTFB (ms)"},"p95_audio_ttfb_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P95 Audio Ttfb Ms","description":"95th percentile audio TTFB (ms)"},"avg_nav_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Nav Ms","description":"Average navigation latency (ms)"},"avg_render_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Render Ms","description":"Average render latency (ms)"},"turn_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Turn Count","description":"Number of turns the latency averages were computed over"},"silence_ratio":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Silence Ratio","description":"Fraction of call spent in silence"}},"type":"object","title":"LatencySummary","description":"Audio + engine latency metrics (one entry per turn averaged)."},"LeaveCallRequest":{"properties":{"call_sid":{"type":"string","maxLength":64,"minLength":1,"title":"Call Sid"}},"type":"object","required":["call_sid"],"title":"LeaveCallRequest","description":"Request to remove operator from an active call."},"LeaveCallResponse":{"properties":{"success":{"type":"boolean","title":"Success"}},"type":"object","required":["success"],"title":"LeaveCallResponse"},"LinkErrorResponse":{"properties":{"error_code":{"type":"string","enum":["invalid_token","link_not_found","link_expired","link_exhausted"],"title":"Error Code","description":"Machine-readable error code."},"message":{"type":"string","maxLength":512,"title":"Message","description":"Human-readable error message."}},"type":"object","required":["error_code","message"],"title":"LinkErrorResponse","description":"Error envelope returned for token / link validation failures."},"LinkInfoResponse":{"properties":{"display_name":{"type":"string","maxLength":512,"title":"Display Name","description":"Human-readable display name (falls back to customer slug)."},"customer_slug":{"type":"string","maxLength":128,"title":"Customer Slug","description":"Stable URL-safe customer identifier."},"max_upload_bytes":{"type":"integer","minimum":0.0,"title":"Max Upload Bytes","description":"Maximum allowed upload size in bytes."},"allowed_content_types":{"items":{"type":"string"},"type":"array","maxItems":64,"title":"Allowed Content Types","description":"Allowed Content-Type values for uploads, sorted lexicographically."}},"type":"object","required":["display_name","customer_slug","max_upload_bytes"],"title":"LinkInfoResponse","description":"Public metadata for an intake upload link, returned to the forms app."},"ListSimulationSuiteRunsResponse":{"properties":{"suite_id":{"type":"string","format":"uuid","title":"Suite Id"},"runs":{"items":{"$ref":"#/components/schemas/SimulationSuiteRunSummary"},"type":"array","title":"Runs"}},"type":"object","required":["suite_id","runs"],"title":"ListSimulationSuiteRunsResponse"},"ListSimulationSuitesResponse":{"properties":{"suites":{"items":{"$ref":"#/components/schemas/SimulationSuiteResponse"},"type":"array","title":"Suites"}},"type":"object","required":["suites"],"title":"ListSimulationSuitesResponse"},"LookupResponse":{"properties":{"results":{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":200,"title":"Results"}},"type":"object","title":"LookupResponse","description":"Autocompletion results for a surface lookup field."},"LoopLatencyPointItem":{"properties":{"hour":{"type":"string","format":"date-time","title":"Hour","description":"UTC hour bucket (truncated to the hour)."},"count":{"type":"integer","title":"Count","description":"Sensing→action pairs whose sensing event lands in this hour."},"p50_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P50 Seconds","description":"Median latency for this hour; null if no pairs."}},"type":"object","required":["hour","count"],"title":"LoopLatencyPointItem"},"LoopLatencyResponse":{"properties":{"as_of":{"type":"string","format":"date-time","title":"As Of","description":"Server clock at query time (UTC)."},"window_hours":{"type":"integer","title":"Window Hours"},"overall_count":{"type":"integer","title":"Overall Count","description":"Total pairs across the window."},"overall_p50_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Overall P50 Seconds","description":"Median latency across the whole window; null if no pairs."},"sparkline":{"items":{"$ref":"#/components/schemas/LoopLatencyPointItem"},"type":"array","maxItems":168,"title":"Sparkline"},"truncated":{"type":"boolean","title":"Truncated","description":"True when the underlying query hit the row cap; p50 is computed over the truncated sample.","default":false}},"type":"object","required":["as_of","window_hours","overall_count"],"title":"LoopLatencyResponse"},"M42CatalogResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/CatalogEntry"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"M42CatalogResponse"},"MemoryAnalyticsResponse":{"properties":{"total_entities_with_memory":{"type":"integer","title":"Total Entities With Memory"},"total_entities_in_workspace":{"type":"integer","title":"Total Entities In Workspace"},"coverage_rate":{"type":"number","title":"Coverage Rate"},"total_facts":{"type":"integer","title":"Total Facts"},"dimensions":{"items":{"$ref":"#/components/schemas/DimensionAnalytics"},"type":"array","title":"Dimensions"},"top_sources":{"items":{"$ref":"#/components/schemas/TopSource"},"type":"array","title":"Top Sources"},"facts_last_24h":{"type":"integer","title":"Facts Last 24H"},"facts_last_7d":{"type":"integer","title":"Facts Last 7D"},"facts_last_30d":{"type":"integer","title":"Facts Last 30D"},"active_dimensions":{"type":"integer","title":"Active Dimensions"},"builtin_dimensions":{"type":"integer","title":"Builtin Dimensions"},"custom_dimensions":{"type":"integer","title":"Custom Dimensions"},"llm_dimensions":{"type":"integer","title":"Llm Dimensions"}},"type":"object","required":["total_entities_with_memory","total_entities_in_workspace","coverage_rate","total_facts","dimensions","top_sources","facts_last_24h","facts_last_7d","facts_last_30d","active_dimensions","builtin_dimensions","custom_dimensions","llm_dimensions"],"title":"MemoryAnalyticsResponse"},"MemoryDimension":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"key":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Key","description":"Lowercase slug used as column key (e.g. 'clinical', 'cosmetic_preference')"},"name":{"$ref":"#/components/schemas/NameString"},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"event_types":{"items":{"type":"string"},"type":"array","maxItems":100,"minItems":1,"title":"Event Types","description":"Event types to scan (e.g. 'patient.created', 'condition.created', 'surface.submitted')"},"extract_paths":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Extract Paths","description":"JSONB paths for static extraction (e.g. '$.active_conditions'). Ignored when extraction_mode='llm'."},"extraction_mode":{"type":"string","enum":["static","llm"],"title":"Extraction Mode","description":"'static' uses extract_paths (fast, free). 'llm' uses ai_extract with description as prompt (semantic, incremental).","default":"static"},"weight":{"type":"number","maximum":10.0,"minimum":0.0,"title":"Weight","description":"Relative importance for scoring (higher = more important)","default":1.0},"active":{"type":"boolean","title":"Active","default":true},"builtin":{"type":"boolean","title":"Builtin","description":"True for platform-provided dimensions (read-only key)","default":false}},"type":"object","required":["key","name","event_types"],"title":"MemoryDimension","description":"A single memory dimension — defines what facts to extract from events.\n\nTwo extraction modes:\n- static: uses extract_paths (JSONPath) for fast, free extraction\n- llm: uses ai_extract with the dimension description as prompt\n  for semantic extraction. Only runs on new events (incremental MV refresh)."},"MemoryFact":{"properties":{"dimension":{"type":"string","title":"Dimension"},"event_type":{"type":"string","title":"Event Type"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"confidence":{"type":"number","title":"Confidence"},"extracted_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extracted Text"},"data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Data"},"ingested_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ingested At"}},"type":"object","required":["dimension","event_type","source","confidence","extracted_text","ingested_at"],"title":"MemoryFact"},"MemoryFactsResponse":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"dimension":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dimension"},"facts":{"items":{"$ref":"#/components/schemas/MemoryFact"},"type":"array","title":"Facts"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["entity_id","dimension","facts","total"],"title":"MemoryFactsResponse"},"MemorySettingsRequest":{"properties":{"dimensions":{"anyOf":[{"items":{"$ref":"#/components/schemas/MemoryDimension"},"type":"array"},{"type":"null"}],"title":"Dimensions"},"backfill_requested":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Backfill Requested"}},"type":"object","title":"MemorySettingsRequest","description":"Partial update — only provided fields are changed.\n\nThe dimensions list is replaced entirely when provided.\nBuilt-in dimensions can be deactivated (active=false) or have their\nweight changed, but their key cannot be reused for custom dimensions."},"MemorySettingsResponse":{"properties":{"dimensions":{"items":{"$ref":"#/components/schemas/MemoryDimension"},"type":"array","title":"Dimensions"},"backfill_requested":{"type":"boolean","title":"Backfill Requested"}},"type":"object","required":["dimensions","backfill_requested"],"title":"MemorySettingsResponse"},"MergedEntitiesResponse":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"linked_entities":{"items":{"$ref":"#/components/schemas/EntityResponse"},"type":"array","title":"Linked Entities"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["entity_id","linked_entities","total"],"title":"MergedEntitiesResponse"},"MeterBreakdown":{"properties":{"categories":{"additionalProperties":{"type":"number"},"type":"object","title":"Categories","description":"Sub-category values"}},"type":"object","title":"MeterBreakdown","description":"Breakdown of a meter value by sub-category."},"MeterSummary":{"properties":{"meter_key":{"type":"string","title":"Meter Key","description":"Unique meter identifier (e.g. voice_minutes)"},"metering_source":{"type":"string","enum":["production","simulation"],"title":"Metering Source","description":"Traffic class — production or simulation, billed separately","default":"production"},"display_name":{"type":"string","title":"Display Name","description":"Human-readable meter name"},"value":{"type":"number","title":"Value","description":"Metered value for the period"},"unit":{"type":"string","title":"Unit","description":"Unit of measurement (e.g. minutes, calls)"}},"type":"object","required":["meter_key","display_name","value","unit"],"title":"MeterSummary"},"MeterValueItem":{"properties":{"id":{"type":"string","title":"Id","description":"Meter value record ID"},"customer_id":{"type":"string","title":"Customer Id","description":"Customer ID"},"meter_key":{"type":"string","title":"Meter Key","description":"Meter identifier"},"metering_source":{"type":"string","enum":["production","simulation"],"title":"Metering Source","description":"Traffic class","default":"production"},"period_start":{"type":"string","title":"Period Start","description":"Period start (ISO-8601)"},"period_end":{"type":"string","title":"Period End","description":"Period end (ISO-8601)"},"value":{"type":"string","title":"Value","description":"Metered value"},"unit":{"type":"string","title":"Unit","description":"Unit of measurement"},"breakdown":{"$ref":"#/components/schemas/MeterBreakdown","description":"Sub-category breakdown"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Updated At","description":"Last updated (ISO-8601)"}},"type":"object","required":["id","customer_id","meter_key","period_start","period_end","value","unit","breakdown","updated_at"],"title":"MeterValueItem"},"MeteringEmitRequest":{"properties":{"event_type":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9._]*$","title":"Event Type"},"metering_quantity":{"type":"number","minimum":0.0,"title":"Metering Quantity"},"metering_source":{"type":"string","enum":["production","simulation"],"title":"Metering Source","description":"Traffic class — 'production' or 'simulation'."},"effective_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective At","description":"When the event happened. Defaults to ingest time."},"metering_unit":{"anyOf":[{"type":"string","maxLength":32,"minLength":1},{"type":"null"}],"title":"Metering Unit"},"metering_metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metering Metadata"},"event_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Event Id","description":"Optional deterministic row id (typically uuid5(NAMESPACE, '<stable-key>')). Re-emitting with the same value lands on the same world_events row instead of double-billing. Use for backfills and retries. Default: server generates a random uuid4."}},"type":"object","required":["event_type","metering_quantity","metering_source"],"title":"MeteringEmitRequest"},"MeteringEmitResponse":{"properties":{"status":{"type":"string","const":"accepted","title":"Status","description":"Emission outcome. Always 'accepted' on 202."},"event_type":{"type":"string","maxLength":64,"minLength":1,"title":"Event Type","description":"Echo of the emitted event_type."}},"type":"object","required":["status","event_type"],"title":"MeteringEmitResponse"},"MetricCatalogEntry":{"properties":{"key":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Key","description":"Metric key (lowercase alphanumeric + underscores)"},"name":{"$ref":"#/components/schemas/NameString"},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"metric_type":{"type":"string","enum":["numerical","categorical","boolean"],"title":"Metric Type"},"source":{"type":"string","enum":["call_intelligence","world_events","surface_events","emotion_events","connector_events","zerobus_events","voice_judge_results","custom"],"title":"Source"},"custom_source_key":{"anyOf":[{"type":"string","maxLength":128,"pattern":"^[a-z][a-z0-9_]*$"},{"type":"null"}],"title":"Custom Source Key"},"extraction_mode":{"type":"string","enum":["static","ai_classify","ai_extract","ai_query","sql_expr"],"title":"Extraction Mode","default":"static"},"granularity":{"type":"string","enum":["aggregate","per_entity"],"title":"Granularity","default":"aggregate"},"period_granularity":{"type":"string","enum":["hourly","daily"],"title":"Period Granularity","default":"daily"},"latency_tier":{"type":"string","enum":["streaming","near_realtime","batch"],"title":"Latency Tier","default":"batch"},"model_tier":{"type":"string","enum":["free","fast","balanced","max","custom"],"title":"Model Tier","default":"free"},"unit":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Unit"},"has_prompt":{"type":"boolean","title":"Has Prompt","default":false},"builtin":{"type":"boolean","title":"Builtin"}},"type":"object","required":["key","name","metric_type","source","builtin"],"title":"MetricCatalogEntry"},"MetricCatalogResponse":{"properties":{"metrics":{"items":{"$ref":"#/components/schemas/MetricCatalogEntry"},"type":"array","title":"Metrics"}},"type":"object","required":["metrics"],"title":"MetricCatalogResponse"},"MetricDefinition":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"key":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Key","description":"Lowercase slug used as metric key (e.g. 'voice_quality_score')"},"name":{"$ref":"#/components/schemas/NameString"},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"metric_type":{"type":"string","enum":["numerical","categorical","boolean"],"title":"Metric Type"},"latency_tier":{"type":"string","enum":["streaming","near_realtime","batch"],"title":"Latency Tier","description":"'streaming' — seconds-latency via ZeroBus streaming ingestion (continuous pipeline). 'near_realtime' — minutes-latency via triggered pipeline refresh. 'batch' — hourly/daily scheduled refresh (default, cheapest).","default":"batch"},"period_granularity":{"type":"string","enum":["hourly","daily"],"title":"Period Granularity","description":"'hourly' — one row per workspace per hour. Use for near_realtime metrics where shift-level visibility matters (voice quality, latency). 'daily' — one row per workspace per day (default, cheapest).","default":"daily"},"source":{"type":"string","enum":["call_intelligence","world_events","surface_events","emotion_events","connector_events","zerobus_events","voice_judge_results","custom"],"title":"Source","description":"Source key for the producer that supplies this metric. Built-ins include 'call_intelligence', 'world_events', and 'surface_events'. Use 'custom' with custom_source_key for extension producers."},"custom_source_key":{"anyOf":[{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$"},{"type":"null"}],"title":"Custom Source Key","description":"Extension source key used only when source='custom'."},"event_types":{"items":{"type":"string"},"type":"array","maxItems":100,"minItems":1,"title":"Event Types","description":"Event types to scan (e.g. 'call.outcome', 'surface.submitted'). For call_intelligence source, use pseudo-types: 'call_intelligence.row'."},"source_filter":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Filter","description":"Optional SQL WHERE fragment for additional filtering (e.g. \"source = 'voice_agent'\"). Applied after event_type filter."},"extraction_mode":{"type":"string","enum":["static","ai_classify","ai_extract","ai_query","sql_expr"],"title":"Extraction Mode","description":"'static' — JSONB path extraction (fast, free). 'ai_classify' — AI classification into user-defined labels (free). 'ai_extract' — AI field extraction from text (free). 'ai_query' — LLM-powered extraction with custom prompt (uses model_tier). 'sql_expr' — Raw SQL expression for computed metrics.","default":"static"},"extract_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Extract Path","description":"JSON path for static extraction (e.g. `$.quality_score`, `$.risk_level`). For `call_intelligence` and `world_events`, single-segment paths resolve to typed columns when available and fall back to JSONB extraction otherwise. Used when `extraction_mode='static'`."},"ai_labels":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":500},{"type":"null"}],"title":"Ai Labels","description":"Labels for ai_classify (categories) or ai_extract (field names). Required when extraction_mode='ai_classify' or 'ai_extract'. Examples: ['positive', 'negative', 'neutral'] or ['diagnosis', 'medication']."},"ai_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Ai Schema","description":"Extraction schema for ai_extract. Required when extraction_mode='ai_extract'."},"ai_query_endpoint":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Ai Query Endpoint","description":"Model serving endpoint for ai_query. Optional — if omitted, platform resolves from model_tier automatically. Override for custom endpoints."},"ai_query_prompt":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Ai Query Prompt","description":"Prompt template for ai_query. Use {data} placeholder for event data. Example: 'Classify this call transcript into one of: {labels}. Transcript: {data}'. Budgeted at 8KB to hold the full rubric + output spec for standard quality judges (longest authored rubric — conversational_naturalness — is ~5KB)."},"sql_expression":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Sql Expression","description":"Raw SQL expression evaluated in pipeline context. Has access to all columns in the source table. Example: 'CASE WHEN duration_seconds > 120 THEN 1.0 ELSE 0.0 END'. Required when extraction_mode='sql_expr'."},"aggregation":{"type":"string","enum":["count","sum","avg","min","max","count_distinct","ratio","rate"],"title":"Aggregation","description":"How to aggregate extracted values per workspace per period. 'ratio' requires ratio_numerator_event and ratio_denominator_event. 'rate' computes count(true) / count(all) for boolean metrics.","default":"count"},"ratio_numerator_event":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ratio Numerator Event","description":"Event type for numerator when aggregation='ratio'."},"ratio_denominator_event":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ratio Denominator Event","description":"Event type for denominator when aggregation='ratio'."},"valid_range_min":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Valid Range Min","description":"Minimum valid value for numerical metrics. Pipeline drops values outside range."},"valid_range_max":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Valid Range Max","description":"Maximum valid value for numerical metrics."},"freshness_sla_minutes":{"type":"integer","maximum":1440.0,"minimum":5.0,"title":"Freshness Sla Minutes","description":"Max acceptable staleness in minutes before alerting. Default: 60 (1 hour).","default":60},"unit":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Unit","description":"Display unit (e.g. 'score', 'minutes', '%', 'count')."},"categories":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":100},{"type":"null"}],"title":"Categories","description":"Allowed values for categorical metrics. Pipeline drops values not in this list when set."},"model_tier":{"type":"string","enum":["free","fast","balanced","max","custom"],"title":"Model Tier","description":"AI model tier for extraction quality/cost tradeoff. 'free' — platform managed models (ai_classify, ai_extract). 'fast' — optimized for simple classification, low latency. 'balanced' — quality scoring, moderate reasoning. 'max' — complex analysis, multi-step reasoning. 'custom' — use ai_query_endpoint directly. When extraction_mode='ai_query' and ai_query_endpoint is not set, platform resolves model_tier to the optimal model automatically.","default":"free"},"channel_scope":{"type":"string","enum":["all","voice","text","surface","inbound","outbound"],"title":"Channel Scope","description":"Business-logic channel filter. 'voice' — voice calls only. 'text' — SMS/text sessions. 'surface' — form submissions. 'inbound'/'outbound' — by direction. 'all' — no channel filter (default). Pipeline translates to appropriate source + event_type filters.","default":"all"},"applies_to_product_types":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Applies To Product Types","description":"Product types this metric applies to (matches service tags, e.g. 'scheduling', 'outbound', 'coaching', 'intake', 'triage', 'support'). When set, the metric only computes for calls belonging to services whose config.tags include one of these keys. When None (default), the metric applies to every service regardless of product type."},"prompt":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Prompt","description":"Rubric prompt for LLM judge evaluation with {$.path} context variables. Each {$.path} reference is extracted from the entity's projected state and substituted before sending to ai_query. The prompt is both the evaluation criteria and the context specification."},"granularity":{"type":"string","enum":["aggregate","per_entity"],"title":"Granularity","description":"'aggregate' groups by (workspace, period) — one value per time bucket. 'per_entity' keeps entity_id — one value per entity (call, encounter). Judge metrics are typically per_entity. Computed metrics are typically aggregate.","default":"aggregate"},"active":{"type":"boolean","title":"Active","default":true},"builtin":{"type":"boolean","title":"Builtin","description":"True for platform-provided metrics (read-only key).","default":false}},"type":"object","required":["key","name","metric_type","source","event_types"],"title":"MetricDefinition","description":"A single metric definition — what to extract and how.\n\nTwo broad modes:\n- Built-in metrics: extraction is handled by hardcoded pipeline logic\n  (extract_path + aggregation). Shipped with every workspace.\n- Custom metrics: extraction uses AI functions or static JSONB paths.\n  Defined per-workspace via settings API.\n\nFrozen: builtins are process-wide singletons exposed via the\n``BUILTIN_METRICS`` list. A mutable list field (e.g.\n``applies_to_product_types``) could otherwise be mutated by one caller\nand leak into every subsequent call in the same process."},"MetricListResponse":{"properties":{"metrics":{"items":{"oneOf":[{"$ref":"#/components/schemas/NumericalMetricValueResponse"},{"$ref":"#/components/schemas/CategoricalMetricValueResponse"},{"$ref":"#/components/schemas/BooleanMetricValueResponse"}],"discriminator":{"propertyName":"metric_type","mapping":{"boolean":"#/components/schemas/BooleanMetricValueResponse","categorical":"#/components/schemas/CategoricalMetricValueResponse","numerical":"#/components/schemas/NumericalMetricValueResponse"}}},"type":"array","title":"Metrics"}},"type":"object","required":["metrics"],"title":"MetricListResponse"},"MetricProjectionResponse":{"properties":{"status":{"type":"string","const":"projected","title":"Status"},"accepted":{"type":"integer","title":"Accepted"},"skipped_duplicates":{"type":"integer","title":"Skipped Duplicates"},"queued_jobs":{"type":"integer","title":"Queued Jobs","default":0,"deprecated":true}},"type":"object","required":["status","accepted","skipped_duplicates"],"title":"MetricProjectionResponse"},"MetricSettingsRequest":{"properties":{"definitions":{"anyOf":[{"items":{"$ref":"#/components/schemas/MetricDefinition"},"type":"array"},{"type":"null"}],"title":"Definitions"}},"type":"object","title":"MetricSettingsRequest","description":"Partial update — only provided fields are changed.\n\nThe definitions list is replaced entirely when provided.\nBuilt-in metrics can be deactivated (active=false) or have their\nfreshness_sla_minutes changed, but their key cannot be reused\nfor custom metrics."},"MetricSettingsResponse":{"properties":{"definitions":{"items":{"$ref":"#/components/schemas/MetricDefinition"},"type":"array","title":"Definitions"}},"type":"object","required":["definitions"],"title":"MetricSettingsResponse"},"ModelRegistryResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/ModelRegistryRow"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"ModelRegistryResponse"},"ModelRegistryRow":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"model_id":{"type":"string","title":"Model Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"focus_area":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Focus Area"},"algorithm":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Algorithm"},"version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Version"},"trained_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Trained At"},"training_set_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Training Set Size"},"coefficients_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coefficients Json"},"metrics_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metrics Json"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","required":["workspace_id","model_id"],"title":"ModelRegistryRow"},"NameString":{"type":"string","maxLength":256,"minLength":1},"NinetyDayRollingParams":{"properties":{"rule_kind":{"type":"string","const":"ninety_day_rolling","title":"Rule Kind","default":"ninety_day_rolling"},"days":{"type":"integer","maximum":365.0,"minimum":1.0,"title":"Days"}},"type":"object","required":["days"],"title":"NinetyDayRollingParams","description":"Rolling-window cap on appointments per patient (e.g. 90 days\nbetween TMS sessions)."},"NonDesiredState":{"properties":{"state":{"type":"string","maxLength":128,"title":"State"},"mode":{"type":"string","enum":["hard","soft"],"title":"Mode","default":"hard"}},"type":"object","required":["state"],"title":"NonDesiredState"},"NoteRollupCategoryEntry":{"properties":{"value":{"type":"string","title":"Value"},"n":{"type":"integer","title":"N"},"pct":{"type":"number","title":"Pct"},"mean_risk":{"type":"number","title":"Mean Risk"},"risk_lift":{"type":"number","title":"Risk Lift"}},"type":"object","required":["value","n","pct","mean_risk","risk_lift"],"title":"NoteRollupCategoryEntry"},"NoteRollupResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"total_notes":{"type":"integer","title":"Total Notes"},"cohort_mean_risk":{"type":"number","title":"Cohort Mean Risk"},"sentiment_distribution":{"items":{"$ref":"#/components/schemas/NoteRollupCategoryEntry"},"type":"array","title":"Sentiment Distribution"},"top_symptoms":{"items":{"$ref":"#/components/schemas/NoteRollupCategoryEntry"},"type":"array","title":"Top Symptoms"},"top_concerns":{"items":{"$ref":"#/components/schemas/NoteRollupCategoryEntry"},"type":"array","title":"Top Concerns"},"top_medications":{"items":{"$ref":"#/components/schemas/NoteRollupCategoryEntry"},"type":"array","title":"Top Medications"},"sdoh":{"$ref":"#/components/schemas/NoteRollupSdoh"}},"type":"object","required":["workspace_id","total_notes","cohort_mean_risk","sentiment_distribution","top_symptoms","top_concerns","top_medications","sdoh"],"title":"NoteRollupResponse"},"NoteRollupSdoh":{"properties":{"activity":{"items":{"$ref":"#/components/schemas/NoteRollupCategoryEntry"},"type":"array","title":"Activity"},"smoking":{"items":{"$ref":"#/components/schemas/NoteRollupCategoryEntry"},"type":"array","title":"Smoking"},"diet":{"items":{"$ref":"#/components/schemas/NoteRollupCategoryEntry"},"type":"array","title":"Diet"}},"type":"object","required":["activity","smoking","diet"],"title":"NoteRollupSdoh"},"NumericalMetricValueResponse":{"properties":{"metric_key":{"type":"string","title":"Metric Key"},"source":{"type":"string","title":"Source","default":"production"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"entity_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Id"},"service_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Id"},"run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Run Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"period_start":{"type":"string","format":"date-time","title":"Period Start"},"period_end":{"type":"string","format":"date-time","title":"Period End"},"event_count":{"type":"integer","title":"Event Count"},"avg_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Confidence"},"unit":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Unit"},"computed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Computed At"},"metric_type":{"type":"string","const":"numerical","title":"Metric Type"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"}},"type":"object","required":["metric_key","period_start","period_end","event_count","metric_type","value"],"title":"NumericalMetricValueResponse"},"OAuth2ClientCredentialsAuthDict":{"properties":{"type":{"type":"string","const":"oauth2_client_credentials","title":"Type"},"token_url":{"type":"string","title":"Token Url"},"client_id":{"type":"string","title":"Client Id"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"},"client_auth_method":{"type":"string","enum":["basic","body"],"title":"Client Auth Method"}},"type":"object","required":["type","token_url","client_id","scopes","client_auth_method"],"title":"OAuth2ClientCredentialsAuthDict","description":"OAuth 2.0 Client Credentials Grant — RFC 6749 § 4.4."},"OAuth2ClientCredentialsAuthRequest":{"properties":{"type":{"type":"string","const":"oauth2_client_credentials","title":"Type","default":"oauth2_client_credentials"},"token_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Token Url"},"client_id":{"type":"string","title":"Client Id"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"},"client_auth_method":{"type":"string","enum":["basic","body"],"title":"Client Auth Method","description":"RFC 6749 § 2.3.1: ``basic`` sends client_id+secret as HTTP Basic auth; ``body`` sends them in the form body.","default":"basic"}},"type":"object","required":["token_url","client_id"],"title":"OAuth2ClientCredentialsAuthRequest","description":"OAuth 2.0 Client Credentials Grant — RFC 6749 § 4.4.\n\nStrict RFC 6749 § 4.4.2 access token request: ``grant_type`` + optional\n``scope``. Client authentication (RFC 6749 § 2.3.1) is orthogonal —\n``client_auth_method`` picks between HTTP Basic auth and form-body\ncredentials. RFC 8707 ``resource`` and non-standard ``audience`` extensions\nare NOT supported here — add them back when a vendor needs one."},"OAuth2JwtBearerAuthDict":{"properties":{"type":{"type":"string","const":"oauth2_jwt_bearer","title":"Type"},"token_url":{"type":"string","title":"Token Url"},"assertion_issuer":{"type":"string","title":"Assertion Issuer"},"assertion_audience":{"type":"string","title":"Assertion Audience"},"assertion_subject":{"type":"string","title":"Assertion Subject"},"assertion_lifetime_seconds":{"type":"integer","title":"Assertion Lifetime Seconds"},"include_iat":{"type":"boolean","title":"Include Iat"},"include_jti":{"type":"boolean","title":"Include Jti"},"assertion_algorithm":{"type":"string","enum":["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],"title":"Assertion Algorithm"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"},"extra_claims":{"additionalProperties":true,"type":"object","title":"Extra Claims"}},"type":"object","required":["type","token_url","assertion_issuer","assertion_audience","assertion_subject","assertion_lifetime_seconds","include_iat","include_jti","assertion_algorithm","scopes","extra_claims"],"title":"OAuth2JwtBearerAuthDict","description":"OAuth 2.0 JWT Bearer Token Grant — RFC 7523 § 2.1."},"OAuth2JwtBearerAuthRequest":{"properties":{"type":{"type":"string","const":"oauth2_jwt_bearer","title":"Type","default":"oauth2_jwt_bearer"},"token_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Token Url"},"assertion_issuer":{"type":"string","title":"Assertion Issuer","description":"RFC 7523 ``iss`` claim — typically the service-account email or client_id."},"assertion_audience":{"type":"string","title":"Assertion Audience","description":"RFC 7523 ``aud`` claim — typically the token_url."},"assertion_subject":{"type":"string","title":"Assertion Subject","description":"RFC 7523 § 3 ``sub`` claim — MUST be present. For service-account flows\nwhere the client is its own subject, set to the same value as ``assertion_issuer``.\nUse a different value only for delegation / impersonation grants."},"assertion_lifetime_seconds":{"type":"integer","title":"Assertion Lifetime Seconds","default":3600},"include_iat":{"type":"boolean","title":"Include Iat","description":"RFC 7523 § 3 item 6 — ``iat`` claim set to mint time. Most IdPs (Google, Azure)\nrequire it for anti-replay; leave True unless a specific vendor rejects it.","default":true},"include_jti":{"type":"boolean","title":"Include Jti","description":"When True, generate a fresh ``jti`` (anti-replay) on every mint.","default":true},"assertion_algorithm":{"type":"string","enum":["RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"],"title":"Assertion Algorithm","default":"RS256"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes","description":"RFC 7523 § 2.1 ``scope`` form-body parameter. Vendors that put scopes inside\nthe JWT instead (Google service accounts) use ``extra_claims = {\"scope\": \"...\"}``\nand leave this empty."},"extra_claims":{"additionalProperties":true,"type":"object","title":"Extra Claims","description":"RFC 7523 § 3 item 8 — arbitrary additional JWT claims (e.g. Google's\n``scope`` claim, Azure's tenant claim). Merged BEFORE the required claims so\nIdP-specific extensions can't override ``iss`` / ``sub`` / ``aud`` / ``exp`` /\n``iat`` / ``nbf`` / ``jti``.","default":{}}},"type":"object","required":["token_url","assertion_issuer","assertion_audience","assertion_subject"],"title":"OAuth2JwtBearerAuthRequest","description":"OAuth 2.0 JWT Bearer Token Grant — RFC 7523 § 2.1."},"OcrRequest":{"properties":{"image":{"type":"string","maxLength":10000000,"minLength":1,"title":"Image","description":"Base64-encoded image data"},"target_fields":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50},{"type":"null"}],"title":"Target Fields","description":"Optional list of field keys to extract"}},"type":"object","required":["image"],"title":"OcrRequest"},"OcrResponse":{"properties":{"extracted_fields":{"additionalProperties":true,"type":"object","title":"Extracted Fields"},"confidence":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Confidence"}},"type":"object","required":["confidence"],"title":"OcrResponse","description":"Structured field extraction result for an uploaded image."},"OperatorAction":{"properties":{"type":{"type":"string","const":"operator","title":"Type","default":"operator"}},"type":"object","title":"OperatorAction","description":"Today's behavior — write escalation.requested + publish SSE, wait for a\nhuman operator to join via the dashboard. No-op if no operators are staffed."},"OperatorIntelligenceSummary":{"properties":{"escalated":{"type":"boolean","title":"Escalated","description":"Whether the call was escalated to a human operator","default":false},"operator_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Operator Active","description":"Whether an operator was active during escalation. True = active; False = escalation occurred but no operator picked up; None = no escalation occurred (do NOT coerce to False)."}},"type":"object","title":"OperatorIntelligenceSummary","description":"Operator intervention summary.\n\nThree-valued semantics on ``operator_active``:\n- ``True``  — escalation occurred and an operator was active.\n- ``False`` — escalation occurred but no operator picked up.\n- ``None``  — no escalation occurred (producer omits the key).\n  Readers must distinguish; do not coerce ``None`` → ``False``."},"OperatorPerformanceItem":{"properties":{"operator_id":{"type":"string","format":"uuid","title":"Operator Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Display name"},"status":{"type":"string","enum":["online","busy","offline"],"title":"Status","description":"Current availability"},"total_escalations_handled":{"type":"integer","title":"Total Escalations Handled","description":"Lifetime escalation count"},"avg_handle_time_seconds":{"type":"number","title":"Avg Handle Time Seconds","description":"Average handle time in seconds"},"last_call_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Call At","description":"ISO-8601 timestamp of last call"}},"type":"object","required":["operator_id","status","total_escalations_handled","avg_handle_time_seconds"],"title":"OperatorPerformanceItem"},"OperatorPerformanceResponse":{"properties":{"summary":{"$ref":"#/components/schemas/OperatorPerformanceSummary","description":"Aggregate operator performance metrics"},"trend":{"items":{"$ref":"#/components/schemas/OperatorPerformanceTrendPoint"},"type":"array","maxItems":2200,"title":"Trend","description":"Time series of escalation counts per interval bucket"}},"type":"object","required":["summary","trend"],"title":"OperatorPerformanceResponse","description":"Operator escalation performance and quality comparison over time."},"OperatorPerformanceSummary":{"properties":{"total_calls":{"type":"integer","title":"Total Calls","description":"Total number of calls in the period"},"escalated_count":{"type":"integer","title":"Escalated Count","description":"Number of calls escalated to an operator"},"escalation_rate":{"type":"number","title":"Escalation Rate","description":"Fraction of calls that were escalated (0.0-1.0)"},"operator_handled_count":{"type":"integer","title":"Operator Handled Count","description":"Number of calls where an operator was active"},"avg_escalated_duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Escalated Duration Seconds","description":"Average duration in seconds of escalated calls"},"avg_escalated_quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Escalated Quality Score","description":"Average quality score of escalated calls"},"avg_non_escalated_quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Non Escalated Quality Score","description":"Average quality score of non-escalated calls"}},"type":"object","required":["total_calls","escalated_count","escalation_rate","operator_handled_count"],"title":"OperatorPerformanceSummary","description":"Aggregate operator escalation stats for the period."},"OperatorPerformanceTrendPoint":{"properties":{"date":{"type":"string","format":"date","title":"Date","description":"Date for the time bucket"},"total_calls":{"type":"integer","title":"Total Calls","description":"Total calls in this time bucket"},"escalated_count":{"type":"integer","title":"Escalated Count","description":"Escalated calls in this time bucket"}},"type":"object","required":["date","total_calls","escalated_count"],"title":"OperatorPerformanceTrendPoint","description":"Single time-bucket data point in the operator performance trend series."},"OperatorResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Display name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Contact email"},"type":{"anyOf":[{"type":"string","enum":["clinical","administrative","crisis_counselor"]},{"type":"null"}],"title":"Type","description":"Operator specialization"},"skills":{"items":{"type":"string"},"type":"array","title":"Skills","description":"Skill tags for routing"},"connection_method":{"type":"string","enum":["browser","phone"],"title":"Connection Method","description":"How the operator connects to calls"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","description":"E.164 phone number for phone-based operators"},"role":{"type":"string","enum":["operator","supervisor","admin"],"title":"Role","description":"Permission role"},"status":{"type":"string","enum":["online","busy","offline"],"title":"Status","description":"Current availability"},"last_status_change":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Status Change","description":"ISO-8601 timestamp of last status transition"},"active_call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Call Sid","description":"Call SID if currently on a call"},"total_escalations_handled":{"type":"integer","title":"Total Escalations Handled","description":"Lifetime escalation count"},"avg_handle_time_seconds":{"type":"number","title":"Avg Handle Time Seconds","description":"Average escalation handle time in seconds"},"last_call_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Call At","description":"ISO-8601 timestamp of last call"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the operator was created"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"When the operator was last updated"}},"type":"object","required":["id","workspace_id","skills","connection_method","role","status","total_escalations_handled","avg_handle_time_seconds"],"title":"OperatorResponse"},"OperatorStatusCounts":{"properties":{"total":{"type":"integer","title":"Total"},"online":{"type":"integer","title":"Online"},"busy":{"type":"integer","title":"Busy"},"offline":{"type":"integer","title":"Offline"}},"type":"object","required":["total","online","busy","offline"],"title":"OperatorStatusCounts"},"OrderedPathway":{"properties":{"id":{"type":"string","maxLength":64,"title":"Id"},"sequence":{"items":{"type":"string","maxLength":128},"type":"array","maxItems":50,"minItems":1,"title":"Sequence"}},"type":"object","required":["id","sequence"],"title":"OrderedPathway"},"OutboundLogItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_id":{"type":"string","format":"uuid","title":"Event Id"},"synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Synced At"},"sync_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sync Error"},"attempt_count":{"type":"integer","title":"Attempt Count"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","event_id","attempt_count","created_at"],"title":"OutboundLogItem"},"OutboundSinkSummary":{"properties":{"data_source_id":{"type":"string","format":"uuid","title":"Data Source Id"},"data_source_name":{"type":"string","title":"Data Source Name"},"total":{"type":"integer","title":"Total"},"synced":{"type":"integer","title":"Synced"},"failed":{"type":"integer","title":"Failed"},"pending":{"type":"integer","title":"Pending"},"last_synced_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Synced At"}},"type":"object","required":["data_source_id","data_source_name","total","synced","failed","pending"],"title":"OutboundSinkSummary"},"OutboundSummary":{"properties":{"total":{"type":"integer","title":"Total","default":0},"synced":{"type":"integer","title":"Synced","default":0},"failed":{"type":"integer","title":"Failed","default":0},"pending":{"type":"integer","title":"Pending","default":0},"last_synced_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Synced At"}},"type":"object","title":"OutboundSummary"},"OutboundSyncBySinkResponse":{"properties":{"sinks":{"items":{"$ref":"#/components/schemas/SinkSyncStatus"},"type":"array","title":"Sinks"}},"type":"object","required":["sinks"],"title":"OutboundSyncBySinkResponse"},"OutreachRule":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"$ref":"#/components/schemas/NameString"},"trigger":{"type":"string","enum":["appointment_window","post_visit","gap_detected","form_intake","manual"],"title":"Trigger","default":"appointment_window"},"trigger_config":{"additionalProperties":true,"type":"object","title":"Trigger Config","description":"Trigger-specific config (hours_before, hours_after, etc.)"},"channel":{"$ref":"#/components/schemas/ChannelType","default":"email"},"consent_required":{"type":"boolean","title":"Consent Required","default":true},"quiet_hours":{"$ref":"#/components/schemas/QuietHours"},"review_required":{"type":"boolean","title":"Review Required","default":false},"message_template":{"type":"string","maxLength":1600,"title":"Message Template","default":"Hi {first_name}, please complete your form: {surface_url}"},"data_template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Data Template Id"},"form_template_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Form Template Id"},"active":{"type":"boolean","title":"Active","default":true}},"type":"object","required":["name"],"title":"OutreachRule","description":"A single outreach rule — defines WHEN, WHAT, and HOW to reach a patient."},"OutreachSettingsRequest":{"properties":{"rules":{"anyOf":[{"items":{"$ref":"#/components/schemas/OutreachRule"},"type":"array"},{"type":"null"}],"title":"Rules"},"data_templates":{"anyOf":[{"items":{"$ref":"#/components/schemas/DataTemplate-Input"},"type":"array"},{"type":"null"}],"title":"Data Templates"}},"type":"object","title":"OutreachSettingsRequest","description":"Partial update — only provided fields are changed.\n\nRules and data_templates lists are replaced entirely when provided."},"OutreachSettingsResponse":{"properties":{"rules":{"items":{"$ref":"#/components/schemas/OutreachRule"},"type":"array","title":"Rules"},"data_templates":{"items":{"$ref":"#/components/schemas/DataTemplate-Output"},"type":"array","title":"Data Templates"}},"type":"object","required":["rules","data_templates"],"title":"OutreachSettingsResponse"},"PaginatedResponse_ActiveEscalationItem_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ActiveEscalationItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[ActiveEscalationItem]"},"PaginatedResponse_AgentResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AgentResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[AgentResponse]"},"PaginatedResponse_AgentVersionResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AgentVersionResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[AgentVersionResponse]"},"PaginatedResponse_ApiKeyResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ApiKeyResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[ApiKeyResponse]"},"PaginatedResponse_AuditEventResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/src__routes__operators_models__AuditEventResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[AuditEventResponse]"},"PaginatedResponse_ContextGraphResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ContextGraphResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[ContextGraphResponse]"},"PaginatedResponse_ContextGraphVersionResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ContextGraphVersionResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[ContextGraphVersionResponse]"},"PaginatedResponse_CustomerItem_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CustomerItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[CustomerItem]"},"PaginatedResponse_DashboardDefinitionResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DashboardDefinitionResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[DashboardDefinitionResponse]"},"PaginatedResponse_DataSourceResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DataSourceResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[DataSourceResponse]"},"PaginatedResponse_EscalationEventResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/EscalationEventResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[EscalationEventResponse]"},"PaginatedResponse_ExternalIntegrationResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ExternalIntegrationResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[ExternalIntegrationResponse]"},"PaginatedResponse_InvoiceItem_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/InvoiceItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[InvoiceItem]"},"PaginatedResponse_MeterValueItem_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MeterValueItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[MeterValueItem]"},"PaginatedResponse_OperatorResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OperatorResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[OperatorResponse]"},"PaginatedResponse_OutboundLogItem_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OutboundLogItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[OutboundLogItem]"},"PaginatedResponse_ReviewItemResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReviewItemResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[ReviewItemResponse]"},"PaginatedResponse_SchedulingRuleSetResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SchedulingRuleSetResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[SchedulingRuleSetResponse]"},"PaginatedResponse_ServiceResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ServiceResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[ServiceResponse]"},"PaginatedResponse_SesSetupListItemResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SesSetupListItemResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[SesSetupListItemResponse]"},"PaginatedResponse_SimulationCaseResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SimulationCaseResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[SimulationCaseResponse]"},"PaginatedResponse_SkillResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SkillResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[SkillResponse]"},"PaginatedResponse_SourceEventItem_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SourceEventItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[SourceEventItem]"},"PaginatedResponse_SurfaceResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SurfaceResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[SurfaceResponse]"},"PaginatedResponse_TriggerResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TriggerResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[TriggerResponse]"},"PaginatedResponse_TriggerRunResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TriggerRunResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[TriggerRunResponse]"},"PaginatedResponse_WorkspaceResponse_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/WorkspaceResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"}},"type":"object","required":["items","has_more"],"title":"PaginatedResponse[WorkspaceResponse]"},"PanelResultResponse":{"properties":{"panel_id":{"type":"string","title":"Panel Id","description":"Panel identifier from the definition"},"columns":{"items":{"type":"string"},"type":"array","title":"Columns","description":"Column names"},"rows":{"items":{"items":{},"type":"array"},"type":"array","title":"Rows","description":"Result rows"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if query failed"}},"type":"object","required":["panel_id","columns","rows"],"title":"PanelResultResponse"},"ParamValueDict":{"properties":{"param_name":{"type":"string","title":"Param Name"},"description":{"type":"string","title":"Description"}},"type":"object","required":["param_name","description"],"title":"ParamValueDict","description":"Routing target for one per-request parameter on the exchange call.\n\nPaired with a wire-name (header / body-field key) on\n``CustomTokenExchangeAuthDict.param_headers`` / ``param_body_fields``."},"ParamValueRequest":{"properties":{"param_name":{"type":"string","title":"Param Name"},"description":{"type":"string","title":"Description"}},"type":"object","required":["param_name","description"],"title":"ParamValueRequest","description":"Routing target for a single per-request parameter on the exchange call.\n\nPaired with a wire-name (header / body-field key) on\n``CustomTokenExchangeAuthRequest.param_headers`` / ``param_body_fields``."},"Participant":{"properties":{"participant_id":{"type":"string","title":"Participant Id"},"role":{"type":"string","enum":["caller","agent","operator"],"title":"Role"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number","x-phi":true},"joined_at":{"type":"string","format":"date-time","title":"Joined At"},"left_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Left At"}},"type":"object","required":["participant_id","role","joined_at"],"title":"Participant"},"PatientLabRow":{"properties":{"patient_id":{"type":"string","title":"Patient Id"},"observation_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Observation Date"},"test_name":{"type":"string","title":"Test Name"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"units":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Units"},"loinc_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Loinc Code"}},"type":"object","required":["patient_id","test_name"],"title":"PatientLabRow"},"PatientLabsResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/PatientLabRow"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"PatientLabsResponse"},"PatientListItem":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Patient name"},"birth_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Birth Date","description":"Date of birth (YYYY-MM-DD)"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender","description":"Gender"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Primary phone number"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Primary email address"},"mrn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mrn","description":"Medical record number"},"event_count":{"type":"integer","title":"Event Count","default":0},"last_event_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Event At"}},"type":"object","required":["entity_id"],"title":"PatientListItem","description":"Typed patient list item — replaces untyped dict."},"PatientNoteExtractions":{"properties":{"symptoms":{"items":{"type":"string"},"type":"array","title":"Symptoms"},"concerns":{"items":{"type":"string"},"type":"array","title":"Concerns"},"medications_planned":{"items":{"type":"string"},"type":"array","title":"Medications Planned"},"hba1c_sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hba1C Sentiment"},"activity_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Activity Level"},"smoking_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smoking Status"},"food_pattern":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Food Pattern"},"n_symptoms":{"type":"integer","title":"N Symptoms","default":0},"n_concerns":{"type":"integer","title":"N Concerns","default":0}},"type":"object","required":["symptoms","concerns","medications_planned"],"title":"PatientNoteExtractions"},"PatientNoteResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"patient_id":{"type":"string","title":"Patient Id"},"authored_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Authored At"},"author":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author"},"note_text":{"type":"string","title":"Note Text"},"extractions":{"$ref":"#/components/schemas/PatientNoteExtractions"}},"type":"object","required":["workspace_id","patient_id","note_text","extractions"],"title":"PatientNoteResponse"},"PatientSearchResponse":{"properties":{"patients":{"items":{"$ref":"#/components/schemas/PatientListItem"},"type":"array","title":"Patients"},"total":{"type":"integer","title":"Total"},"has_more":{"type":"boolean","title":"Has More","default":false},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["patients","total"],"title":"PatientSearchResponse"},"PatientSummaryResponse":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"entity_type":{"type":"string","title":"Entity Type"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"state":{"additionalProperties":true,"type":"object","title":"State","description":"Full JSONB state blob. Prefer typed fields below.","deprecated":true},"event_count":{"type":"integer","title":"Event Count"},"last_event_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Event At"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name","description":"Patient name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone","description":"Primary phone number (E.164)"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email","description":"Primary email address"},"birth_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Birth Date","description":"Date of birth (YYYY-MM-DD)"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender","description":"Gender"},"mrn":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mrn","description":"Medical record number"}},"type":"object","required":["entity_id","entity_type","display_name","event_count","last_event_at"],"title":"PatientSummaryResponse"},"PatientSurfaceSpec":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Description"},"fields":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Fields"},"sections":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Sections"},"branding":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Branding"},"submit_button_text":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Submit Button Text"},"completion_title":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Completion Title"},"completion_message":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Completion Message"},"completion_action_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Completion Action Url"},"context":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Context"}},"type":"object","title":"PatientSurfaceSpec","description":"Patient-facing surface spec — what forms-app renders.\n\nFree-form by design: ``fields``/``sections``/``branding`` are forwarded\nfrom the upstream surface document as raw dicts. Renamed from\n``SurfaceSpec`` to avoid an OpenAPI schema-name collision with\n``platform_lib.surfaces.models.SurfaceSpec`` (which would otherwise\nforce FastAPI to namespace both classes and rename the existing\n``SurfaceSpec`` schema in the committed openapi.json)."},"PatientTimelineResponse":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Events"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["entity_id","events","total"],"title":"PatientTimelineResponse"},"PatientTopologyResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/PatientTopologyRow"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"PatientTopologyResponse"},"PatientTopologyRow":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"patient_id":{"type":"string","title":"Patient Id"},"umap_x":{"type":"number","title":"Umap X"},"umap_y":{"type":"number","title":"Umap Y"},"pca_x":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pca X"},"pca_y":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pca Y"},"pca_z":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pca Z"},"cluster_name":{"type":"string","title":"Cluster Name"},"age_bucket":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Age Bucket"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"nationality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nationality"},"district":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"District"},"charlson_cci":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Charlson Cci"},"bmi_latest":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bmi Latest"},"hba1c_latest":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Hba1C Latest"},"risk_tier":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Risk Tier"},"y_hat_t2d_1yr":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Y Hat T2D 1Yr"},"y_hat_htn_1yr":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Y Hat Htn 1Yr"},"y_hat_chf_90d":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Y Hat Chf 90D"},"y_hat_asthma_12mo":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Y Hat Asthma 12Mo"},"y_hat_ckd_1yr":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Y Hat Ckd 1Yr"},"y_hat_copd_12mo":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Y Hat Copd 12Mo"},"y_hat_composite":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Y Hat Composite"},"emergence_month":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Emergence Month"}},"type":"object","required":["workspace_id","patient_id","umap_x","umap_y","cluster_name"],"title":"PatientTopologyRow"},"PerformanceSummaryResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"total_operators":{"type":"integer","title":"Total Operators"},"online":{"type":"integer","title":"Online"},"busy":{"type":"integer","title":"Busy"},"offline":{"type":"integer","title":"Offline"},"total_escalations_handled":{"type":"integer","title":"Total Escalations Handled"},"avg_handle_time_seconds":{"type":"number","title":"Avg Handle Time Seconds"},"operators":{"items":{"$ref":"#/components/schemas/OperatorPerformanceItem"},"type":"array","title":"Operators"}},"type":"object","required":["workspace_id","total_operators","online","busy","offline","total_escalations_handled","avg_handle_time_seconds","operators"],"title":"PerformanceSummaryResponse"},"PhoneE164":{"type":"string","maxLength":16,"minLength":2},"PhoneNumberCallVolume":{"properties":{"phone_number":{"type":"string","title":"Phone Number","description":"E.164 phone number"},"total_calls":{"type":"integer","title":"Total Calls","description":"Total calls across the period"},"inbound":{"type":"integer","title":"Inbound","description":"Inbound call count"},"outbound":{"type":"integer","title":"Outbound","description":"Outbound call count"},"avg_duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Duration Seconds","description":"Average call duration"},"by_date":{"items":{"$ref":"#/components/schemas/DailyCallVolume"},"type":"array","title":"By Date","description":"Daily volume breakdown"}},"type":"object","required":["phone_number","total_calls","inbound","outbound"],"title":"PhoneNumberCallVolume"},"PipelineMetrics":{"properties":{"sources_total":{"type":"integer","title":"Sources Total","default":0},"sources_healthy":{"type":"integer","title":"Sources Healthy","default":0},"sources_degraded":{"type":"integer","title":"Sources Degraded","default":0},"sources_failing":{"type":"integer","title":"Sources Failing","default":0},"events_last_hour":{"type":"integer","title":"Events Last Hour","default":0},"outbound_pending":{"type":"integer","title":"Outbound Pending","default":0},"outbound_failed":{"type":"integer","title":"Outbound Failed","default":0},"connector_status":{"type":"string","enum":["healthy","degraded","unavailable"],"title":"Connector Status","default":"unavailable"}},"type":"object","title":"PipelineMetrics"},"PipelineStatusResponse":{"properties":{"status":{"type":"string","title":"Status"},"connector_runner_status":{"type":"string","title":"Connector Runner Status"},"uptime_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Uptime Seconds"},"active_polls":{"type":"integer","title":"Active Polls","default":0},"total_events":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Events","description":"Read-model event count for the last 7 days. Null means the read model is empty or unavailable; zero means the read model is ready and has no events."},"event_read_model_status":{"type":"string","enum":["ready","empty","unavailable"],"title":"Event Read Model Status","default":"empty"},"event_read_model_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Event Read Model Synced At"},"total_entities":{"type":"integer","title":"Total Entities","default":0},"sources":{"items":{"$ref":"#/components/schemas/SourceStatus"},"type":"array","title":"Sources","default":[]},"entity_resolution":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Entity Resolution"},"review_loop":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Review Loop"},"outbound_dispatch":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Outbound Dispatch"},"outbound_subscriber":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Outbound Subscriber"},"reconciliation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Reconciliation"},"gap_scanner":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Gap Scanner"}},"type":"object","required":["status","connector_runner_status"],"title":"PipelineStatusResponse"},"PlaybackTimeline":{"properties":{"turns":{"items":{"$ref":"#/components/schemas/TurnTimeline"},"type":"array","title":"Turns"},"segments":{"items":{"$ref":"#/components/schemas/TimelineSegment"},"type":"array","title":"Segments"},"duration_seconds":{"type":"number","title":"Duration Seconds"},"timebase":{"anyOf":[{"$ref":"#/components/schemas/TimelineTimebase"},{"type":"null"}],"description":"Canonical timebase shared by waveform, overlays, seek state, zoom, and scroll transforms."},"lanes":{"items":{"$ref":"#/components/schemas/TimelineLaneDefinition"},"type":"array","title":"Lanes","description":"Canonical actor/system lane model. Every segment lane_id resolves against this collection.","default":[]},"total_user_speech_seconds":{"type":"number","title":"Total User Speech Seconds","default":0.0},"total_agent_speech_seconds":{"type":"number","title":"Total Agent Speech Seconds","default":0.0},"total_silence_seconds":{"type":"number","title":"Total Silence Seconds","default":0.0},"avg_processing_gap_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Processing Gap Ms"},"max_processing_gap_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Processing Gap Ms"},"avg_perceived_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Perceived Latency Ms"}},"type":"object","required":["turns","segments","duration_seconds"],"title":"PlaybackTimeline"},"PositiveSignalResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/PositiveSignalRow"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"PositiveSignalResponse"},"PositiveSignalRow":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"signal_id":{"type":"string","title":"Signal Id"},"metric_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metric Label"},"headline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Headline"},"delta_value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Delta Value"},"delta_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delta Unit"},"baseline":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Baseline"},"narrative":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Narrative"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["workspace_id","signal_id"],"title":"PositiveSignalRow"},"PreloadSpec":{"properties":{"tool_id":{"type":"string","maxLength":256,"title":"Tool Id"},"params":{"additionalProperties":true,"type":"object","maxProperties":20,"title":"Params"}},"type":"object","required":["tool_id"],"title":"PreloadSpec","description":"A tool call executed deterministically by the engine on state entry.\n\nUnlike LLM-driven tool calls, preloads run before any LLM turn —\nthe results appear in the interaction log so the engage LLM sees\nthem as pre-loaded context.  All preloads in a state execute in\nparallel.  Param values support ``{caller_mrn}`` and ``{entity_id}``\ntemplate variables resolved from the session's caller context."},"PriorityQueueItem":{"properties":{"call_sid":{"type":"string","title":"Call Sid","description":"Twilio call SID"},"caller_id":{"type":"string","title":"Caller Id","description":"Caller phone number","default":""},"caller_phone":{"anyOf":[{"type":"string","maxLength":16,"pattern":"^\\+[1-9]\\d{1,14}$"},{"type":"null"}],"title":"Caller Phone","description":"Caller E.164 phone number for console clients"},"service_id":{"type":"string","title":"Service Id","description":"Service ID handling the call","default":""},"service_name":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}],"description":"Human-readable service name when available"},"direction":{"type":"string","enum":["inbound","outbound","playground","simulated","test"],"title":"Direction","description":"Call direction","default":"inbound"},"data_quality_flags":{"items":{"type":"string","const":"invalid_direction"},"type":"array","title":"Data Quality Flags","default":[]},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At","description":"When the active call started"},"priority_score":{"type":"number","maximum":1.0,"minimum":0.0,"title":"Priority Score","description":"Priority score normalized to 0.0-1.0"},"priority_reasons":{"items":{"type":"string","enum":["high_risk","long_wait","negative_emotion","safety_concern","looping"]},"type":"array","title":"Priority Reasons","default":[]},"wait_seconds":{"type":"number","title":"Wait Seconds","default":0.0},"risk_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Risk Score"},"risk_level":{"anyOf":[{"type":"string","enum":["low","medium","high","critical"]},{"type":"null"}],"title":"Risk Level"},"current_emotion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Emotion"},"current_valence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Current Valence"},"current_state":{"type":"string","title":"Current State","default":""},"turn_count":{"type":"integer","title":"Turn Count","default":0},"escalation_active":{"type":"boolean","title":"Escalation Active","default":false},"entity_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Name"},"brief_context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brief Context"}},"type":"object","required":["call_sid","priority_score"],"title":"PriorityQueueItem","description":"An active call ranked by operator priority."},"PriorityQueueResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"queue":{"items":{"$ref":"#/components/schemas/PriorityQueueItem"},"type":"array","title":"Queue"},"total_active":{"type":"integer","title":"Total Active"}},"type":"object","required":["workspace_id","queue","total_active"],"title":"PriorityQueueResponse"},"ProgressHint":{"properties":{"deterministic":{"type":"boolean","title":"Deterministic","default":false},"phrases":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":10,"minItems":1,"description":"Filler phrases. deterministic=true: played verbatim in order. deterministic=false: used as hints for early attempts."},{"type":"null"}],"title":"Phrases"},"trigger_delay_ms":{"anyOf":[{"type":"integer","maximum":30000.0,"minimum":0.0},{"type":"null"}],"title":"Trigger Delay Ms"},"interval_ms":{"anyOf":[{"type":"integer","maximum":30000.0,"minimum":100.0},{"type":"null"}],"title":"Interval Ms"},"mode":{"type":"string","enum":["auto","silent","backchannel","verbal"],"title":"Mode","default":"auto"},"progress_class":{"anyOf":[{"type":"string","enum":["lookup","write","external_call","compute","multi_step"]},{"type":"null"}],"title":"Progress Class"},"expected_latency_ms":{"anyOf":[{"type":"integer","maximum":60000.0,"minimum":0.0},{"type":"null"}],"title":"Expected Latency Ms"},"custom_phrase":{"anyOf":[{"type":"string","maxLength":500,"description":"Legacy: use phrases instead."},{"type":"null"}],"title":"Custom Phrase"}},"additionalProperties":false,"type":"object","title":"ProgressHint","description":"How the agent narrates waiting on a tool.\n\n``deterministic=true``: scripted — ``phrases`` play verbatim in order.\n``deterministic=false``: engine picks — ``phrases`` are hints.\n``trigger_delay_ms``: milliseconds before first filler (0 = immediate).\n``interval_ms``: milliseconds between subsequent fillers."},"PromptLogEntry":{"properties":{"event_id":{"type":"string","format":"uuid","title":"Event Id"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"effective_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective At"},"ingested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ingested At"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"prompt_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prompt Type"},"turn_index":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Turn Index"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"history":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"History"},"full_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Prompt"},"llm_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Model"},"llm_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Llm Response"},"state_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State Name"},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action"},"tool_names":{"items":{"type":"string"},"type":"array","title":"Tool Names"},"has_tools":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Tools"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"data_parse_error":{"type":"boolean","title":"Data Parse Error","default":false}},"type":"object","required":["event_id","workspace_id"],"title":"PromptLogEntry","description":"One ``prompt_log`` event projection — full LLM input + output for a turn.\n\nUnbounded string fields (``system_prompt``, ``full_prompt``,\n``llm_response``) reflect the producer's payload as-is — typically\n1-50 KB each, occasionally larger for long histories. SDK consumers\nshould not assume a max length."},"PromptLogListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PromptLogEntry"},"type":"array","title":"Items"},"count":{"type":"integer","minimum":0.0,"title":"Count"},"has_more":{"type":"boolean","title":"Has More"},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset","description":"Pass back as offset to fetch the next page; null when has_more is false"},"applied_time_window_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Applied Time Window Days","description":"Auto-applied time bound (in days) when no call_sid/from_ts/to_ts was passed. Null when the caller supplied an explicit selectivity-bearing filter."},"resolved_call_sid":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Resolved Call Sid","description":"When ``conversation_id`` was supplied, this is the underlying ``call_sid`` that the lookup resolved to. Useful for callers that want to drill into per-call surfaces afterward without re-querying ``world.entities``. Null when the caller filtered by ``call_sid`` directly or did not filter by conversation."},"resolved_conversation_kind":{"anyOf":[{"type":"string","enum":["call","conversation"]},{"type":"null"}],"title":"Resolved Conversation Kind","description":"``entity_type`` of the conversation entity when ``conversation_id`` was supplied (``call`` for voice/sim, ``conversation`` for text/sms/whatsapp/email). Null otherwise."}},"type":"object","required":["items","count","has_more"],"title":"PromptLogListResponse"},"ProviderType":{"type":"string","enum":["twilio","websocket","ses","sendblue"],"title":"ProviderType","description":"Messaging provider that implements a channel.\n\nMultiple providers may serve the same ChannelKind."},"ProvisionResponse":{"properties":{"workspace":{"$ref":"#/components/schemas/WorkspaceResponse"}},"type":"object","required":["workspace"],"title":"ProvisionResponse"},"PurgeEntityResponse":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"events_deleted":{"type":"integer","title":"Events Deleted"},"edges_deleted":{"type":"integer","title":"Edges Deleted"},"entity_deleted":{"type":"boolean","title":"Entity Deleted"},"delta_events_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delta Events Note"}},"type":"object","required":["entity_id","display_name","events_deleted","edges_deleted","entity_deleted"],"title":"PurgeEntityResponse"},"QualityBreakdown":{"properties":{"score":{"type":"number","title":"Score"},"components":{"items":{"$ref":"#/components/schemas/QualityComponent"},"type":"array","title":"Components"},"workspace_avg":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Workspace Avg"},"workspace_percentile":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Workspace Percentile"}},"type":"object","required":["score","components"],"title":"QualityBreakdown","description":"Structured breakdown of how quality score was computed."},"QualityComponent":{"properties":{"name":{"type":"string","enum":["latency","silence","barge_ins","loops","escalation","tool_failures"],"title":"Name","description":"Quality dimension"},"penalty":{"type":"number","title":"Penalty","description":"Penalty subtracted from the score"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value","description":"Raw measured value"},"threshold":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Threshold","description":"Threshold that was exceeded"},"severity":{"type":"string","enum":["none","minor","major","critical"],"title":"Severity","description":"Severity of the penalty","default":"none"}},"type":"object","required":["name","penalty"],"title":"QualityComponent","description":"Single quality score component with penalty and context."},"QuietHours":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":false},"start_hour":{"type":"integer","maximum":23.0,"minimum":0.0,"title":"Start Hour","default":21},"end_hour":{"type":"integer","maximum":23.0,"minimum":0.0,"title":"End Hour","default":8},"timezone":{"type":"string","maxLength":64,"title":"Timezone","default":"America/New_York"}},"type":"object","title":"QuietHours","description":"Quiet hours — no outbound outreach during this window."},"RankedAnomalyResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/RankedAnomalyRow"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"RankedAnomalyResponse"},"RankedAnomalyRow":{"properties":{"indicator":{"type":"string","title":"Indicator","default":"t2d_risk"},"district_name":{"type":"string","title":"District Name"},"lat":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lat"},"lon":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lon"},"rate_per_1k":{"type":"number","title":"Rate Per 1K","default":0.0},"territory_mean":{"type":"number","title":"Territory Mean","default":0.0},"residual":{"type":"number","title":"Residual","default":0.0},"cohort_size":{"type":"integer","title":"Cohort Size","default":0},"is_anomaly":{"type":"boolean","title":"Is Anomaly","default":true},"alert_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alert Id"},"severity":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Severity"},"priority_score":{"type":"number","title":"Priority Score","default":0.0},"impact":{"type":"number","title":"Impact","default":0.0},"narrative":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Narrative"},"decomposition":{"items":{"$ref":"#/components/schemas/DecompositionRow"},"type":"array","title":"Decomposition","default":[]}},"type":"object","required":["district_name"],"title":"RankedAnomalyRow"},"RecommendRequest":{"properties":{"session_id":{"type":"string","maxLength":64,"title":"Session Id"},"n":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"N","default":5}},"type":"object","required":["session_id"],"title":"RecommendRequest"},"RecommendResponse":{"properties":{"suggestions":{"items":{"type":"string"},"type":"array","maxItems":100,"title":"Suggestions","description":"LLM-generated caller message suggestions"}},"type":"object","required":["suggestions"],"title":"RecommendResponse"},"RecordingMetadataResponse":{"properties":{"call_sid":{"type":"string","title":"Call Sid","description":"Twilio call SID"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id","description":"Workspace that owns this recording"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id","description":"Service (agent) that handled the call"},"direction":{"type":"string","enum":["inbound","outbound"],"title":"Direction","description":"Call direction"},"duration_seconds":{"type":"number","title":"Duration Seconds","description":"Total call duration in seconds"},"inbound_format":{"type":"string","title":"Inbound Format","description":"Audio format for the inbound (caller) channel"},"inbound_sample_rate":{"type":"integer","title":"Inbound Sample Rate","description":"Sample rate in Hz for the inbound channel"},"outbound_format":{"type":"string","title":"Outbound Format","description":"Audio format for the outbound (agent) channel"},"outbound_sample_rate":{"type":"integer","title":"Outbound Sample Rate","description":"Sample rate in Hz for the outbound channel"},"tts_provider":{"type":"string","title":"Tts Provider","description":"Text-to-speech provider used for the call"},"call_start_iso":{"type":"string","title":"Call Start Iso","description":"Call start time as ISO-8601 string"},"call_end_iso":{"type":"string","title":"Call End Iso","description":"Call end time as ISO-8601 string"},"inbound_size_bytes":{"type":"integer","title":"Inbound Size Bytes","description":"Inbound audio file size in bytes"},"outbound_size_bytes":{"type":"integer","title":"Outbound Size Bytes","description":"Outbound audio file size in bytes"},"media_start_epoch_ms":{"type":"number","title":"Media Start Epoch Ms","description":"Media stream start time as Unix epoch milliseconds"}},"type":"object","required":["call_sid","workspace_id","direction","duration_seconds","inbound_format","inbound_sample_rate","outbound_format","outbound_sample_rate","tts_provider","call_start_iso","call_end_iso","inbound_size_bytes","outbound_size_bytes","media_start_epoch_ms"],"title":"RecordingMetadataResponse","description":"Call recording metadata."},"RecordingUrlsResponse":{"properties":{"call_sid":{"type":"string","title":"Call Sid","description":"Twilio call SID"},"status":{"type":"string","const":"available","title":"Status","description":"Recording availability status","default":"available"},"inbound_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inbound Url","description":"Download URL for inbound (caller) audio"},"outbound_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outbound Url","description":"Download URL for outbound (agent) audio"},"metadata_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata Url","description":"Download URL for recording metadata JSON"}},"type":"object","required":["call_sid"],"title":"RecordingUrlsResponse","description":"Download paths for call recording playback."},"RegisteredFunction":{"properties":{"name":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Name"},"description":{"type":"string","maxLength":2048,"minLength":1,"title":"Description"},"when_to_use":{"type":"string","maxLength":2048,"title":"When To Use","default":""},"function_type":{"type":"string","enum":["sql","ai","udtf","python"],"title":"Function Type","default":"sql"},"returns":{"type":"string","enum":["table","scalar"],"title":"Returns","default":"table"},"returns_type":{"type":"string","enum":["string","integer","number","boolean"],"title":"Returns Type","default":"string"},"parameters":{"items":{"$ref":"#/components/schemas/platform_lib__platform_functions__models__Parameter"},"type":"array","maxItems":32,"title":"Parameters"},"returns_columns":{"items":{"$ref":"#/components/schemas/ReturnColumn"},"type":"array","maxItems":32,"title":"Returns Columns"},"body":{"type":"string","maxLength":8192,"minLength":1,"title":"Body"},"timeout_ms":{"type":"integer","maximum":60000.0,"minimum":100.0,"title":"Timeout Ms","default":30000},"examples":{"items":{"$ref":"#/components/schemas/FunctionExample"},"type":"array","maxItems":8,"title":"Examples"}},"additionalProperties":false,"type":"object","required":["name","description","body"],"title":"RegisteredFunction","description":"The authored shape of a platform function.\n\nIdentical wire format whether it's authored as a YAML file in the\nrepo or POSTed to ``/v1/{ws}/functions/deploy``. The deploy\npipeline validates this, derives the JSON Schema for the LLM tool\nspec, and INSERTs a row into ``platform.functions`` with the next\nmonotonic ``version`` per ``(workspace_id, name)``. For\n``python`` / ``udtf`` rows, deploy ALSO issues\n``CREATE OR REPLACE FUNCTION`` against the warehouse to materialize\nthe UC UDF."},"RegisteredFunctionListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RegisteredFunctionResponse"},"type":"array","title":"Items"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["items","count"],"title":"RegisteredFunctionListResponse"},"RegisteredFunctionResponse":{"properties":{"name":{"type":"string","title":"Name"},"function_type":{"type":"string","title":"Function Type"},"returns_kind":{"type":"string","title":"Returns Kind"},"description":{"type":"string","title":"Description","default":""},"when_to_use":{"type":"string","title":"When To Use","default":""},"parameters":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Parameters"},"sql_template":{"type":"string","title":"Sql Template"},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema"},"examples":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Examples"},"timeout_ms":{"type":"integer","title":"Timeout Ms","default":30000},"last_test_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Test At"},"last_test_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Test Status"},"last_test_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Test Error"},"last_test_duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Test Duration Ms"},"deployed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deployed At"},"deployed_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deployed By"}},"type":"object","required":["name","function_type","returns_kind","sql_template"],"title":"RegisteredFunctionResponse","description":"Single row from ``platform.functions``."},"RejectRequest":{"properties":{"reason":{"type":"string","maxLength":2000,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"RejectRequest","description":"Reject events — demotes confidence to 0.0."},"RejectSurfaceRequest":{"properties":{"reason":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Reason"}},"type":"object","title":"RejectSurfaceRequest"},"RelationshipToDeveloper":{"properties":{"ownership":{"type":"string","title":"Ownership"},"type":{"type":"string","title":"Type"},"conversation_visibility":{"type":"string","title":"Conversation Visibility"},"thought_visibility":{"type":"string","title":"Thought Visibility"}},"type":"object","required":["ownership","type","conversation_visibility","thought_visibility"],"title":"RelationshipToDeveloper"},"RenameColumnAction":{"properties":{"op":{"type":"string","const":"rename_column","title":"Op"},"from":{"$ref":"#/components/schemas/IdentifierString"},"to":{"$ref":"#/components/schemas/IdentifierString"}},"type":"object","required":["op","from","to"],"title":"RenameColumnAction"},"ResolveTemplateRequest":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"}},"type":"object","required":["entity_id"],"title":"ResolveTemplateRequest","description":"Resolve a form template for a specific entity."},"ResolveTemplateResponse":{"properties":{"spec":{"$ref":"#/components/schemas/SurfaceSpec"},"prefilled_count":{"type":"integer","title":"Prefilled Count"},"total_fields":{"type":"integer","title":"Total Fields"}},"type":"object","required":["spec","prefilled_count","total_fields"],"title":"ResolveTemplateResponse","description":"Resolved SurfaceSpec with prefill values."},"ResolvedToolItem":{"properties":{"tool_name":{"type":"string","title":"Tool Name"},"tool_type":{"type":"string","title":"Tool Type"},"description":{"type":"string","title":"Description","default":""},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema"},"states":{"items":{"type":"string"},"type":"array","title":"States"},"tier":{"type":"string","title":"Tier","default":"world"},"is_write":{"type":"boolean","title":"Is Write","default":false},"additional_instructions":{"additionalProperties":{"type":"string"},"type":"object","title":"Additional Instructions"}},"type":"object","required":["tool_name","tool_type"],"title":"ResolvedToolItem"},"RestIntegrationResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Integration ID."},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id","description":"Workspace ID."},"name":{"type":"string","title":"Name","description":"Slug-like identifier, immutable post-create."},"display_name":{"type":"string","title":"Display Name","description":"Human-readable name."},"enabled":{"type":"boolean","title":"Enabled","description":"Whether the integration is active."},"approval_policy":{"type":"string","enum":["none","writes","all"],"title":"Approval Policy","description":"Human-in-the-loop approval gate. ``none`` = no approval required;\n``writes`` = approval required for write-classified endpoints;\n``all`` = approval required for every endpoint.","default":"none"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the integration was created."},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When the integration was last updated."},"kind":{"type":"string","const":"rest","title":"Kind","description":"Discriminator.","default":"rest"},"base_url":{"type":"string","title":"Base Url","description":"Base URL for REST integrations."},"auth":{"anyOf":[{"$ref":"#/components/schemas/StaticHeaderAuthDict"},{"$ref":"#/components/schemas/OAuth2ClientCredentialsAuthDict"},{"$ref":"#/components/schemas/OAuth2JwtBearerAuthDict"},{"$ref":"#/components/schemas/CustomTokenExchangeAuthDict"},{"type":"null"}],"title":"Auth","description":"Authentication configuration (lib TypedDict union)."},"endpoint_count":{"type":"integer","title":"Endpoint Count","description":"Number of configured endpoints. Fetch the full list via GET /endpoints."}},"type":"object","required":["id","workspace_id","name","display_name","enabled","created_at","updated_at","base_url","endpoint_count"],"title":"RestIntegrationResponse","description":"REST variant — base URL, auth config, endpoint count."},"RetentionPolicyRequest":{"properties":{"call_recordings_days":{"anyOf":[{"type":"integer","maximum":36500.0,"minimum":365.0},{"type":"null"}],"title":"Call Recordings Days"},"call_transcripts_days":{"anyOf":[{"type":"integer","maximum":36500.0,"minimum":365.0},{"type":"null"}],"title":"Call Transcripts Days"},"audit_log_days":{"anyOf":[{"type":"integer","maximum":36500.0,"minimum":365.0},{"type":"null"}],"title":"Audit Log Days"},"world_events_days":{"anyOf":[{"type":"integer","maximum":36500.0,"minimum":365.0},{"type":"null"}],"title":"World Events Days"},"phi_data_days":{"anyOf":[{"type":"integer","maximum":36500.0,"minimum":365.0},{"type":"null"}],"title":"Phi Data Days"},"legal_hold":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Legal Hold"},"legal_hold_reason":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]}},"type":"object","title":"RetentionPolicyRequest"},"RetentionPolicyResponse":{"properties":{"call_recordings_days":{"type":"integer","title":"Call Recordings Days"},"call_transcripts_days":{"type":"integer","title":"Call Transcripts Days"},"audit_log_days":{"type":"integer","title":"Audit Log Days"},"world_events_days":{"type":"integer","title":"World Events Days"},"phi_data_days":{"type":"integer","title":"Phi Data Days"},"legal_hold":{"type":"boolean","title":"Legal Hold"},"legal_hold_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Hold Reason"}},"type":"object","required":["call_recordings_days","call_transcripts_days","audit_log_days","world_events_days","phi_data_days","legal_hold"],"title":"RetentionPolicyResponse"},"ReturnColumn":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Name"},"type":{"type":"string","enum":["string","integer","number","boolean"],"title":"Type"},"description":{"type":"string","maxLength":512,"title":"Description","default":""}},"additionalProperties":false,"type":"object","required":["name","type"],"title":"ReturnColumn","description":"One column in a UDTF's output schema.\n\nUC ``RETURNS TABLE(<col1> <type1>, <col2> <type2>, ...)`` requires\ndeclaring the schema at deploy time. This list anchors that\nschema for ``function_type=udtf`` rows. ``name`` becomes the\ncolumn name in the result rows; ``type`` maps to a Databricks\nSQL type via the same ``ParameterType`` Literal we use for inputs."},"ReviewActionResponse":{"properties":{"surface_id":{"type":"string","format":"uuid","title":"Surface Id"},"status":{"$ref":"#/components/schemas/SurfaceStatus"},"action":{"type":"string","enum":["approved","rejected"],"title":"Action"}},"type":"object","required":["surface_id","status","action"],"title":"ReviewActionResponse"},"ReviewDashboardResponse":{"properties":{"stats":{"$ref":"#/components/schemas/ReviewStatsResponse"},"pending_by_priority":{"additionalProperties":{"type":"integer"},"type":"object","title":"Pending By Priority"},"pending_by_reason":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Pending By Reason"},"recent_completed":{"items":{"$ref":"#/components/schemas/ReviewItemResponse"},"type":"array","title":"Recent Completed"},"completion_rate_24h":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Completion Rate 24H"}},"type":"object","required":["stats","pending_by_priority","pending_by_reason","recent_completed","completion_rate_24h"],"title":"ReviewDashboardResponse","description":"Composite dashboard for the review queue page."},"ReviewDiffResponse":{"properties":{"item_id":{"type":"string","title":"Item Id"},"original_events":{"items":{"$ref":"#/components/schemas/EventSummary"},"type":"array","title":"Original Events"},"corrected_events":{"items":{"$ref":"#/components/schemas/EventSummary"},"type":"array","title":"Corrected Events"}},"type":"object","required":["item_id","original_events","corrected_events"],"title":"ReviewDiffResponse","description":"Original vs corrected event data for a completed correction."},"ReviewItemResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"session_id":{"type":"string","title":"Session Id"},"event_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Event Ids"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"priority":{"type":"integer","title":"Priority"},"reason":{"type":"string","title":"Reason"},"judge_analysis":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Judge Analysis"},"status":{"type":"string","enum":["pending","in_progress","completed","rejected"],"title":"Status"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the review item was created"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"completed_action":{"anyOf":[{"type":"string","enum":["approve","reject","correct","approved","rejected","corrected"]},{"type":"null"}],"title":"Completed Action"},"events":{"anyOf":[{"items":{"$ref":"#/components/schemas/EventSummary"},"type":"array"},{"type":"null"}],"title":"Events"},"entity":{"anyOf":[{"$ref":"#/components/schemas/EntitySummary"},{"type":"null"}]}},"type":"object","required":["id","workspace_id","session_id","event_ids","entity_id","entity_type","priority","reason","judge_analysis","status","assigned_to","completed_at","completed_action"],"title":"ReviewItemResponse"},"ReviewMetrics":{"properties":{"queue_depth":{"type":"integer","title":"Queue Depth"},"pending_by_priority":{"additionalProperties":{"type":"integer"},"type":"object","title":"Pending By Priority"},"approved_7d":{"type":"integer","title":"Approved 7D"},"rejected_7d":{"type":"integer","title":"Rejected 7D"},"avg_review_time_hours":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Review Time Hours"},"total_items":{"type":"integer","title":"Total Items","default":0}},"type":"object","required":["queue_depth","pending_by_priority","approved_7d","rejected_7d"],"title":"ReviewMetrics"},"ReviewStatsResponse":{"properties":{"pending":{"type":"integer","title":"Pending"},"completed":{"type":"integer","title":"Completed"},"rejected":{"type":"integer","title":"Rejected"},"avg_review_minutes":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Review Minutes"}},"type":"object","required":["pending","completed","rejected","avg_review_minutes"],"title":"ReviewStatsResponse"},"RiskSignalConfig":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":true},"weights":{"additionalProperties":{"type":"number"},"type":"object","title":"Weights","default":{}},"auto_escalate_threshold":{"type":"number","title":"Auto Escalate Threshold","default":70.0},"alert_threshold":{"type":"number","title":"Alert Threshold","default":50.0},"monitor_threshold":{"type":"number","title":"Monitor Threshold","default":30.0}},"type":"object","title":"RiskSignalConfig","description":"Per-workspace risk scoring config. Stored on Service."},"RiskSummary":{"properties":{"composite_score":{"type":"number","title":"Composite Score","description":"Overall risk score 0.0 to 1.0","default":0.0},"level":{"type":"string","enum":["low","medium","high","critical"],"title":"Level","description":"Risk level","default":"low"}},"type":"object","title":"RiskSummary","description":"Aggregated risk signals across the call.\n\nFree-form residual on the raw ``risk_summary`` JSONB:\n``signals: list[{name, raw_score, weight, weighted_score, detail}]``\n— the per-signal breakdown that aggregates into ``composite_score``.\nNot exposed via this typed shape; consumers needing per-signal\ndetail read the JSONB endpoint."},"RotateApiKeyRequest":{"properties":{"duration_days":{"type":"integer","maximum":90.0,"minimum":1.0,"title":"Duration Days"}},"type":"object","required":["duration_days"],"title":"RotateApiKeyRequest"},"RunSimulationBenchmarkRequest":{"properties":{"suite_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Suite Id"},"required_tags":{"items":{"type":"string","maxLength":128},"type":"array","maxItems":20,"title":"Required Tags"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id","description":"Optional world entity UUID to bind caller context for every selected saved-case run. When omitted, each case falls back to fixtures.case_specific.entity_id if present."},"max_cases":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Max Cases","default":20},"max_turns":{"type":"integer","maximum":40.0,"minimum":1.0,"title":"Max Turns","default":20},"concurrency":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"Concurrency","default":1},"branch_name":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Branch Name"},"tags":{"items":{"type":"string","maxLength":128},"type":"array","maxItems":20,"title":"Tags"},"exploration":{"anyOf":[{"$ref":"#/components/schemas/ExplorationConfig"},{"type":"null"}]}},"type":"object","title":"RunSimulationBenchmarkRequest"},"RunSimulationCaseRequest":{"properties":{"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id","description":"Optional world entity UUID to bind caller context for this saved-case run. When omitted, the runner falls back to fixtures.case_specific.entity_id if present."},"max_turns":{"type":"integer","maximum":40.0,"minimum":1.0,"title":"Max Turns","default":20},"concurrency":{"type":"integer","maximum":20.0,"minimum":1.0,"title":"Concurrency","default":1},"branch_name":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Branch Name"},"tags":{"items":{"type":"string","maxLength":128},"type":"array","maxItems":20,"title":"Tags"},"exploration":{"anyOf":[{"$ref":"#/components/schemas/ExplorationConfig"},{"type":"null"}]}},"type":"object","title":"RunSimulationCaseRequest"},"SafetyState":{"properties":{"peak_concern_level":{"type":"integer","title":"Peak Concern Level","default":0},"concern_turn_count":{"type":"integer","title":"Concern Turn Count","default":0},"trajectory":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trajectory"},"triage_history":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Triage History","default":[]},"concept_matches":{"items":{"$ref":"#/components/schemas/ConceptMatch"},"type":"array","title":"Concept Matches","default":[]}},"type":"object","title":"SafetyState"},"SafetySummary":{"properties":{"match_count":{"type":"integer","title":"Match Count","description":"Number of safety filter matches","default":0}},"type":"object","title":"SafetySummary","description":"Safety filter results.\n\nFree-form residual on the raw ``safety_summary`` JSONB:\n``actions: dict | list`` — escalation handler actions taken\nwhen ``match_count > 0``. Not exposed via this typed shape."},"SampleFact":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"extracted_text":{"type":"string","title":"Extracted Text"},"confidence":{"type":"number","title":"Confidence"}},"type":"object","required":["entity_id","extracted_text","confidence"],"title":"SampleFact","description":"Representative fact snippet for a dimension (quality inspection / demos)."},"SampleResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"SampleResponse"},"SaveFieldResponse":{"properties":{"status":{"type":"string","const":"saved","title":"Status","default":"saved"}},"type":"object","title":"SaveFieldResponse","description":"Acknowledgement returned when a field is auto-saved."},"Scenario":{"properties":{"description":{"type":"string","maxLength":512,"title":"Description"},"temperament":{"type":"string","maxLength":32,"title":"Temperament","default":"neutral"},"initial_message":{"type":"string","maxLength":1000,"title":"Initial Message"},"scenario_instructions":{"type":"string","maxLength":2000,"title":"Scenario Instructions"},"persona":{"$ref":"#/components/schemas/ScenarioPersona"},"case_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Case Id"}},"type":"object","required":["description","initial_message","scenario_instructions"],"title":"Scenario"},"ScenarioPersona":{"properties":{"name":{"type":"string","maxLength":128,"title":"Name","default":""},"role":{"type":"string","maxLength":64,"title":"Role","default":"patient"},"communication_style":{"type":"string","maxLength":512,"title":"Communication Style","default":""},"default_language":{"type":"string","maxLength":16,"title":"Default Language","default":"en-US"},"background":{"type":"string","maxLength":2000,"title":"Background","default":""}},"type":"object","title":"ScenarioPersona"},"SchedulingRuleSetResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"agent_kind":{"type":"string","enum":["tms","ketamine","general"],"title":"Agent Kind"},"rule_kind":{"type":"string","enum":["clinic_open_hours","tms_mapping_release","tms_session_grid","ketamine_block_overlap","ninety_day_rolling","concurrent_start_block"],"title":"Rule Kind"},"params":{"additionalProperties":true,"type":"object","title":"Params"},"is_active":{"type":"boolean","title":"Is Active"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","workspace_id","agent_kind","rule_kind","params","is_active","created_by","created_at","updated_at"],"title":"SchedulingRuleSetResponse","description":"Wire shape for a single rule set. ``params`` stays as ``dict``\nhere (not the discriminated union) so add-a-new-kind doesn't break\nolder clients still on the previous SDK version — the SDK's typed\nhelpers can re-validate into ``RuleParams`` when needed."},"SchemaResponse":{"properties":{"lakebase_tables":{"additionalProperties":{"additionalProperties":{"type":"string"},"type":"object"},"type":"object","title":"Lakebase Tables"},"databricks_catalogs":{"items":{"type":"string"},"type":"array","title":"Databricks Catalogs"},"uc_functions":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Uc Functions"},"ai_functions":{"items":{"type":"string"},"type":"array","title":"Ai Functions"}},"type":"object","required":["lakebase_tables","databricks_catalogs","uc_functions","ai_functions"],"title":"SchemaResponse"},"ScoreSessionRequest":{"properties":{"score":{"type":"number","maximum":100.0,"minimum":0.0,"title":"Score"},"score_rationale":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Score Rationale"}},"type":"object","required":["score"],"title":"ScoreSessionRequest"},"SearchString":{"type":"string","maxLength":200,"minLength":1},"SendGuidanceRequest":{"properties":{"call_sid":{"type":"string","maxLength":64,"minLength":1,"title":"Call Sid"},"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message"}},"type":"object","required":["call_sid","message"],"title":"SendGuidanceRequest"},"SendGuidanceResponse":{"properties":{"status":{"type":"string","enum":["delivered","failed"],"title":"Status","description":"Delivery status"},"call_sid":{"type":"string","title":"Call Sid","description":"Call SID the guidance was sent to"}},"type":"object","required":["status","call_sid"],"title":"SendGuidanceResponse"},"Service":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"context_graph_id":{"type":"string","format":"uuid","title":"Context Graph Id"},"keyterms":{"items":{"type":"string"},"type":"array","title":"Keyterms"},"is_active":{"type":"boolean","title":"Is Active"},"version_sets":{"additionalProperties":{"$ref":"#/components/schemas/VersionSet-Output"},"type":"object","title":"Version Sets"},"tags":{"items":{"$ref":"#/components/schemas/ServiceTag"},"type":"array","title":"Tags"},"tool_capacity":{"type":"integer","title":"Tool Capacity","default":3},"safety_filters_enabled":{"type":"boolean","title":"Safety Filters Enabled","default":true},"channel_type":{"type":"string","enum":["voice","text"],"title":"Channel Type","default":"voice"},"environment":{"type":"string","enum":["sandbox","production"],"title":"Environment","default":"production"},"risk_signal_config":{"anyOf":[{"$ref":"#/components/schemas/RiskSignalConfig"},{"type":"null"}]},"hard_escalation_rules":{"items":{"$ref":"#/components/schemas/HardEscalationRule"},"type":"array","title":"Hard Escalation Rules","default":[]},"voice_config":{"anyOf":[{"$ref":"#/components/schemas/ServiceVoiceConfig-Output"},{"type":"null"}]},"escalation_policy":{"anyOf":[{"$ref":"#/components/schemas/EscalationPolicy"},{"type":"null"}]},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","name","description","agent_id","context_graph_id","keyterms","is_active","version_sets","tags"],"title":"Service","description":"A service links an agent + context graph + version sets."},"ServiceBindingRequest":{"properties":{"service_id":{"type":"string","format":"uuid","title":"Service Id"}},"type":"object","required":["service_id"],"title":"ServiceBindingRequest"},"ServiceBindingResponse":{"properties":{"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"service_id":{"type":"string","format":"uuid","title":"Service Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"channel":{"type":"string","enum":["inbound_voice","outbound_voice","ringless_voicemail","email"],"title":"Channel"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["use_case_id","service_id","workspace_id","channel","created_at","updated_at"],"title":"ServiceBindingResponse"},"ServiceForwardingConfig":{"properties":{"forward_to":{"$ref":"#/components/schemas/PhoneE164"},"should_disconnect":{"type":"boolean","title":"Should Disconnect","default":true},"warm_transfer":{"type":"boolean","title":"Warm Transfer","default":true}},"type":"object","required":["forward_to"],"title":"ServiceForwardingConfig","description":"Per-service call-forwarding destination + transfer mechanism.\n\nRead by:\n  - LLM-driven ``forward_call`` tool (tier 3 fallback when the LLM doesn't\n    pass an explicit ``phone_number`` and no EHR location is configured).\n  - ``EscalationPolicy.ForwardAction`` — engine-fired escalation with no\n    overrides falls through to the same path.\n\nDistinct from ``platform_lib.phone_numbers.ForwardingConfig`` (per-phone\nlegacy shape with ``enabled``); per-service forwarding is a binary\npresence — set means tier 3 resolves to it, None means tier 3 has no\nstatic target."},"ServiceResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"agent_id":{"type":"string","format":"uuid","title":"Agent Id"},"context_graph_id":{"type":"string","format":"uuid","title":"Context Graph Id"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"context_graph_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context Graph Name"},"keyterms":{"items":{"type":"string"},"type":"array","title":"Keyterms"},"is_active":{"type":"boolean","title":"Is Active"},"version_sets":{"additionalProperties":{"$ref":"#/components/schemas/VersionSet-Output"},"type":"object","title":"Version Sets"},"tags":{"items":{"$ref":"#/components/schemas/ServiceTag"},"type":"array","title":"Tags"},"tool_capacity":{"type":"integer","title":"Tool Capacity"},"safety_filters_enabled":{"type":"boolean","title":"Safety Filters Enabled","default":true},"channel_type":{"type":"string","enum":["voice","text"],"title":"Channel Type","default":"voice"},"environment":{"type":"string","enum":["sandbox","production"],"title":"Environment","default":"production"},"voice_config":{"anyOf":[{"$ref":"#/components/schemas/ServiceVoiceConfig-Output"},{"type":"null"}]},"escalation_policy":{"anyOf":[{"$ref":"#/components/schemas/EscalationPolicy"},{"type":"null"}]},"is_system":{"type":"boolean","title":"Is System","default":false},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","workspace_id","name","description","agent_id","context_graph_id","keyterms","is_active","version_sets","tags","tool_capacity","created_at","updated_at"],"title":"ServiceResponse"},"ServiceTag":{"properties":{"key":{"type":"string","title":"Key"},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"}},"type":"object","required":["key"],"title":"ServiceTag"},"ServiceVoiceConfig-Input":{"properties":{"tts_model":{"anyOf":[{"type":"string","enum":["sonic-turbo","sonic-3"]},{"type":"null"}],"title":"Tts Model"},"max_buffer_delay_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Buffer Delay Ms"},"eager_eot_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eager Eot Threshold"},"eot_timeout_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Eot Timeout Ms"},"filler_style":{"type":"string","enum":["backchannel","phrase","silent"],"title":"Filler Style","default":"backchannel"},"filler_vocabulary":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Filler Vocabulary"},"backchannel_delay_ms":{"type":"integer","title":"Backchannel Delay Ms","default":400},"max_response_sentences":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Response Sentences"},"max_response_words":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Response Words"},"barge_in_min_speech_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Barge In Min Speech S"},"barge_in_cooldown_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Barge In Cooldown S"},"min_tts_speed":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Tts Speed"},"post_eot_pause_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Post Eot Pause Ms"},"transition_deadline_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transition Deadline Ms"},"progress_interval_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress Interval Ms"},"empathy_hold_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Empathy Hold Ms"},"filler_cooldown_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Filler Cooldown Ms"},"progress_vocabulary":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Progress Vocabulary"},"tts_provider":{"anyOf":[{"type":"string","enum":["cartesia","elevenlabs","groq"]},{"type":"null"}],"title":"Tts Provider"},"tts_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tts Config"},"language_providers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/LanguageProviderEntry"},"type":"object","maxProperties":10},{"type":"null"}],"title":"Language Providers"},"forward_call_enabled":{"type":"boolean","title":"Forward Call Enabled","default":false},"forwarding":{"anyOf":[{"$ref":"#/components/schemas/ServiceForwardingConfig"},{"type":"null"}]}},"type":"object","title":"ServiceVoiceConfig","description":"Per-service voice pipeline tuning. Overrides workspace/env defaults.\n\nEach field is optional — None means inherit from the layer above\n(workspace VoiceSettings → env vars → hardcoded defaults)."},"ServiceVoiceConfig-Output":{"properties":{"tts_model":{"anyOf":[{"type":"string","enum":["sonic-turbo","sonic-3"]},{"type":"null"}],"title":"Tts Model"},"max_buffer_delay_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Buffer Delay Ms"},"eager_eot_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eager Eot Threshold"},"eot_timeout_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Eot Timeout Ms"},"filler_style":{"type":"string","enum":["backchannel","phrase","silent"],"title":"Filler Style","default":"backchannel"},"filler_vocabulary":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Filler Vocabulary"},"backchannel_delay_ms":{"type":"integer","title":"Backchannel Delay Ms","default":400},"max_response_sentences":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Response Sentences"},"max_response_words":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Response Words"},"barge_in_min_speech_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Barge In Min Speech S"},"barge_in_cooldown_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Barge In Cooldown S"},"min_tts_speed":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Min Tts Speed"},"post_eot_pause_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Post Eot Pause Ms"},"transition_deadline_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transition Deadline Ms"},"progress_interval_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress Interval Ms"},"empathy_hold_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Empathy Hold Ms"},"filler_cooldown_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Filler Cooldown Ms"},"progress_vocabulary":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Progress Vocabulary"},"tts_provider":{"anyOf":[{"type":"string","enum":["cartesia","elevenlabs","groq"]},{"type":"null"}],"title":"Tts Provider"},"tts_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tts Config"},"language_providers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/LanguageProviderEntry"},"type":"object","maxProperties":10},{"type":"null"}],"title":"Language Providers"},"forward_call_enabled":{"type":"boolean","title":"Forward Call Enabled","default":false},"forwarding":{"anyOf":[{"$ref":"#/components/schemas/ServiceForwardingConfig"},{"type":"null"}]}},"type":"object","title":"ServiceVoiceConfig","description":"Per-service voice pipeline tuning. Overrides workspace/env defaults.\n\nEach field is optional — None means inherit from the layer above\n(workspace VoiceSettings → env vars → hardcoded defaults)."},"SesSetupDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"domain_identity":{"type":"string","title":"Domain Identity"},"dns_checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dns Checked At"},"dns_records":{"items":{"$ref":"#/components/schemas/DnsRecordResponse"},"type":"array","title":"Dns Records"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_name","domain_identity","dns_checked_at","dns_records","created_at","updated_at"],"title":"SesSetupDetailResponse"},"SesSetupListItemResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"domain_identity":{"type":"string","title":"Domain Identity"},"dns_verified":{"type":"boolean","title":"Dns Verified","description":"Aggregate of every DNS record's ``verified`` at the last refresh."},"dns_checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Dns Checked At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","tenant_name","domain_identity","dns_verified","dns_checked_at","created_at","updated_at"],"title":"SesSetupListItemResponse"},"SessionResponse":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id"],"title":"SessionResponse"},"SetColumnDefaultAction":{"properties":{"op":{"type":"string","const":"set_column_default","title":"Op"},"name":{"$ref":"#/components/schemas/IdentifierString"},"default":{"$ref":"#/components/schemas/Default"}},"type":"object","required":["op","name","default"],"title":"SetColumnDefaultAction"},"SetColumnNullableAction":{"properties":{"op":{"type":"string","const":"set_column_nullable","title":"Op"},"name":{"$ref":"#/components/schemas/IdentifierString"},"nullable":{"type":"boolean","title":"Nullable"}},"type":"object","required":["op","name","nullable"],"title":"SetColumnNullableAction"},"SignalResponseAlignment":{"properties":{"signal":{"type":"string","maxLength":2000,"minLength":1,"title":"Signal","description":"The signal observed (e.g. caller tone shift, tool result, silence)"},"agent_response":{"type":"string","maxLength":2000,"minLength":1,"title":"Agent Response","description":"What the agent did in response"},"alignment":{"type":"string","enum":["aligned","misaligned","partial"],"title":"Alignment","description":"Whether the response was aligned, misaligned, or partial"},"insight":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Insight","description":"Short insight on why the alignment went the way it did"}},"type":"object","required":["signal","agent_response","alignment"],"title":"SignalResponseAlignment","description":"Whether the agent's response aligned with a salient signal in the call."},"SimulationBenchmarkAggregateSummary":{"properties":{"selected_count":{"type":"integer","title":"Selected Count"},"started_count":{"type":"integer","title":"Started Count"},"skipped_count":{"type":"integer","title":"Skipped Count"},"failed_to_start_count":{"type":"integer","title":"Failed To Start Count"},"status_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Status Counts"},"scored_count":{"type":"integer","title":"Scored Count","default":0},"average_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Score"}},"type":"object","required":["selected_count","started_count","skipped_count","failed_to_start_count"],"title":"SimulationBenchmarkAggregateSummary"},"SimulationBenchmarkBreakdownSummary":{"properties":{"run_count":{"type":"integer","title":"Run Count","default":0},"status_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Status Counts"},"completed_count":{"type":"integer","title":"Completed Count","default":0},"failed_count":{"type":"integer","title":"Failed Count","default":0},"scored_count":{"type":"integer","title":"Scored Count","default":0},"average_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Score"},"pass_count":{"type":"integer","title":"Pass Count","default":0},"fail_count":{"type":"integer","title":"Fail Count","default":0}},"type":"object","title":"SimulationBenchmarkBreakdownSummary"},"SimulationBenchmarkCaseResult":{"properties":{"case_id":{"type":"string","format":"uuid","title":"Case Id"},"status":{"type":"string","enum":["started","skipped","failed_to_start"],"title":"Status"},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"result_pointer":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result Pointer"},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Reason"}},"type":"object","required":["case_id","status"],"title":"SimulationBenchmarkCaseResult"},"SimulationBenchmarkPerRunSummary":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"service_id":{"type":"string","format":"uuid","title":"Service Id"},"status":{"type":"string","enum":["running","completed","failed"],"title":"Status"},"tags":{"items":{"type":"string","maxLength":128},"type":"array","title":"Tags"},"case_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Case Ids"},"session_ids":{"items":{"type":"string","maxLength":128},"type":"array","title":"Session Ids"},"total_sessions":{"type":"integer","title":"Total Sessions","default":0},"total_turns":{"type":"integer","title":"Total Turns","default":0},"terminal_session_count":{"type":"integer","title":"Terminal Session Count","default":0},"scored_session_count":{"type":"integer","title":"Scored Session Count","default":0},"average_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Score"},"passed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Passed"},"pass_count":{"type":"integer","title":"Pass Count","default":0},"fail_count":{"type":"integer","title":"Fail Count","default":0},"score_rationales":{"items":{"type":"string","maxLength":2000},"type":"array","title":"Score Rationales"},"capability_tags":{"items":{"type":"string","maxLength":128},"type":"array","title":"Capability Tags"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"result_pointer":{"additionalProperties":true,"type":"object","title":"Result Pointer"},"immediate_average_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Immediate Average Score"},"immediate_passed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Immediate Passed"},"immediate_pass_count":{"type":"integer","title":"Immediate Pass Count","default":0},"immediate_fail_count":{"type":"integer","title":"Immediate Fail Count","default":0},"metric_status":{"type":"string","enum":["pending","available","unavailable"],"title":"Metric Status","default":"pending"},"metric_result_count":{"type":"integer","title":"Metric Result Count","default":0},"metrics_last_checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Metrics Last Checked At"}},"type":"object","required":["run_id","service_id","status"],"title":"SimulationBenchmarkPerRunSummary"},"SimulationBenchmarkResultsResponse":{"properties":{"run_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Run Ids"},"total_runs":{"type":"integer","title":"Total Runs"},"status_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Status Counts"},"completed_count":{"type":"integer","title":"Completed Count","default":0},"failed_count":{"type":"integer","title":"Failed Count","default":0},"scored_count":{"type":"integer","title":"Scored Count","default":0},"average_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Score"},"pass_count":{"type":"integer","title":"Pass Count","default":0},"fail_count":{"type":"integer","title":"Fail Count","default":0},"metric_status":{"type":"string","enum":["pending","available","unavailable"],"title":"Metric Status","default":"pending"},"metric_result_count":{"type":"integer","title":"Metric Result Count","default":0},"metrics_last_checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Metrics Last Checked At"},"per_run":{"items":{"$ref":"#/components/schemas/SimulationBenchmarkPerRunSummary"},"type":"array","title":"Per Run"},"capability_breakdown":{"additionalProperties":{"$ref":"#/components/schemas/SimulationBenchmarkBreakdownSummary"},"type":"object","title":"Capability Breakdown"},"missing_run_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Missing Run Ids"}},"type":"object","required":["run_ids","total_runs"],"title":"SimulationBenchmarkResultsResponse"},"SimulationBenchmarkRunResponse":{"properties":{"batch_id":{"type":"string","format":"uuid","title":"Batch Id"},"suite_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Suite Id"},"required_tags":{"items":{"type":"string","maxLength":128},"type":"array","title":"Required Tags"},"selected_case_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Selected Case Ids"},"run_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Run Ids"},"cases":{"items":{"$ref":"#/components/schemas/SimulationBenchmarkCaseResult"},"type":"array","title":"Cases"},"skipped_cases":{"items":{"$ref":"#/components/schemas/SimulationBenchmarkCaseResult"},"type":"array","title":"Skipped Cases"},"failed_to_start_cases":{"items":{"$ref":"#/components/schemas/SimulationBenchmarkCaseResult"},"type":"array","title":"Failed To Start Cases"},"aggregate_summary":{"$ref":"#/components/schemas/SimulationBenchmarkAggregateSummary"}},"type":"object","required":["batch_id","required_tags","selected_case_ids","run_ids","cases","skipped_cases","failed_to_start_cases","aggregate_summary"],"title":"SimulationBenchmarkRunResponse"},"SimulationCaseAssertionEval":{"properties":{"type":{"type":"string","const":"assertion","title":"Type"},"key":{"type":"string","maxLength":128,"minLength":1,"title":"Key"},"assertion_kind":{"type":"string","maxLength":128,"minLength":1,"title":"Assertion Kind"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"expected":{"anyOf":[{},{"type":"null"}],"title":"Expected"},"params":{"additionalProperties":true,"type":"object","title":"Params"},"weight":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight"}},"type":"object","required":["type","key","assertion_kind"],"title":"SimulationCaseAssertionEval"},"SimulationCaseGrounding":{"properties":{"patient_entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Patient Entity Id"}},"type":"object","title":"SimulationCaseGrounding","description":"Optional bindings that start the sim from existing workspace data."},"SimulationCaseMetricEval":{"properties":{"type":{"type":"string","const":"metric","title":"Type"},"metric_key":{"type":"string","maxLength":128,"minLength":1,"title":"Metric Key"},"expected":{"anyOf":[{},{"type":"null"}],"title":"Expected"},"params":{"additionalProperties":true,"type":"object","title":"Params"},"weight":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Weight"}},"type":"object","required":["type","metric_key"],"title":"SimulationCaseMetricEval"},"SimulationCaseResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"description":{"type":"string","maxLength":2000,"title":"Description"},"persona":{"additionalProperties":true,"type":"object","title":"Persona"},"scenario":{"$ref":"#/components/schemas/SimulationCaseScenario"},"grounding":{"$ref":"#/components/schemas/SimulationCaseGrounding"},"evals":{"items":{"anyOf":[{"$ref":"#/components/schemas/SimulationCaseMetricEval"},{"$ref":"#/components/schemas/SimulationCaseAssertionEval"}]},"type":"array","title":"Evals"},"tags":{"items":{"type":"string","maxLength":128},"type":"array","title":"Tags"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","workspace_id","description","scenario"],"title":"SimulationCaseResponse","description":"HTTP response shape for durable simulation cases."},"SimulationCaseScenario":{"properties":{"instructions":{"type":"string","maxLength":10000,"minLength":1,"title":"Instructions"},"initial_message":{"type":"string","maxLength":2000,"title":"Initial Message","default":""},"temperament":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Temperament"}},"type":"object","required":["instructions"],"title":"SimulationCaseScenario","description":"Runnable patient-side scenario content for a saved case."},"SimulationEvalResultResponse":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Id"},"run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Run Id"},"case_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Case Id"},"session_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Session Id"},"eval_key":{"type":"string","maxLength":128,"title":"Eval Key"},"eval_type":{"type":"string","enum":["assertion","metric"],"title":"Eval Type"},"assertion_kind":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Assertion Kind"},"metric_key":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Metric Key"},"status":{"type":"string","enum":["passed","failed","pending","skipped","error"],"title":"Status"},"passed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Passed"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"expected":{"anyOf":[{},{"type":"null"}],"title":"Expected"},"actual":{"anyOf":[{},{"type":"null"}],"title":"Actual"},"rationale":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Rationale"},"details":{"additionalProperties":true,"type":"object","title":"Details"},"definition":{"additionalProperties":true,"type":"object","title":"Definition"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["eval_key","eval_type","status"],"title":"SimulationEvalResultResponse"},"SimulationIntelligenceResponse":{"properties":{"session_id":{"type":"string","title":"Session Id"},"intelligence":{"additionalProperties":true,"type":"object","title":"Intelligence"}},"type":"object","required":["session_id","intelligence"],"title":"SimulationIntelligenceResponse"},"SimulationObservation":{"properties":{"state_before":{"type":"string","title":"State Before"},"state_after":{"type":"string","title":"State After"},"state_changed":{"type":"boolean","title":"State Changed"},"agent_text":{"type":"string","title":"Agent Text"},"is_terminal":{"type":"boolean","title":"Is Terminal"},"tools_called":{"items":{"type":"string"},"type":"array","title":"Tools Called","default":[]},"tool_call_details":{"items":{"$ref":"#/components/schemas/ToolCallDetail"},"type":"array","title":"Tool Call Details","default":[]},"selected_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Selected Action"},"empathy_tier":{"type":"integer","title":"Empathy Tier","default":0},"has_pause":{"type":"boolean","title":"Has Pause","default":false},"engine_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Engine Ms"},"nav_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nav Ms"}},"type":"object","required":["state_before","state_after","state_changed","agent_text","is_terminal"],"title":"SimulationObservation"},"SimulationRunResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"service_id":{"type":"string","format":"uuid","title":"Service Id"},"branch_name":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Branch Name"},"status":{"type":"string","enum":["running","completed","failed"],"title":"Status"},"tags":{"items":{"type":"string","maxLength":128},"type":"array","title":"Tags"},"total_sessions":{"type":"integer","title":"Total Sessions","default":0},"total_turns":{"type":"integer","title":"Total Turns","default":0},"objective":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Objective"},"bridge_request":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Bridge Request"},"scenarios":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Scenarios"},"snapshot":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Snapshot"},"total_scenarios_requested":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Scenarios Requested"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"metric_status":{"type":"string","enum":["pending","available","unavailable"],"title":"Metric Status","default":"pending"},"metric_result_count":{"type":"integer","title":"Metric Result Count","default":0},"metrics_last_checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Metrics Last Checked At"},"eval_results":{"items":{"$ref":"#/components/schemas/SimulationEvalResultResponse"},"type":"array","title":"Eval Results"},"eval_result_count":{"type":"integer","title":"Eval Result Count","default":0},"eval_pass_count":{"type":"integer","title":"Eval Pass Count","default":0},"eval_fail_count":{"type":"integer","title":"Eval Fail Count","default":0},"eval_error_count":{"type":"integer","title":"Eval Error Count","default":0}},"type":"object","required":["id","service_id","status"],"title":"SimulationRunResponse","description":"Full run payload — used by GET /runs/{run_id} for replay flows."},"SimulationSessionResponse":{"properties":{"session_id":{"type":"string","title":"Session Id"},"greeting":{"type":"string","title":"Greeting"},"is_terminal":{"type":"boolean","title":"Is Terminal"},"snapshot":{"$ref":"#/components/schemas/SimulationSnapshotResponse"}},"type":"object","required":["session_id","greeting","is_terminal","snapshot"],"title":"SimulationSessionResponse"},"SimulationSnapshotResponse":{"properties":{"current_state":{"$ref":"#/components/schemas/SimulationStateResponse"},"reachable_states":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Reachable States","default":[]},"turn_policy":{"$ref":"#/components/schemas/SimulationTurnPolicyResponse","default":{"barge_in_enabled":true,"greeting_shield_s":0.0,"safety_response":"suspend_forward","context_strategy":"full","block_forward_call":false,"block_forward_call_after_turns":-1}},"conversation_history":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Conversation History","default":[]},"states_visited":{"items":{"type":"string"},"type":"array","title":"States Visited","default":[]},"state_transitions":{"items":{"items":{"type":"string"},"type":"array"},"type":"array","title":"State Transitions","default":[]},"total_turns":{"type":"integer","title":"Total Turns","default":0},"tools_called":{"items":{"type":"string"},"type":"array","title":"Tools Called","default":[]},"terminal_reached":{"type":"boolean","title":"Terminal Reached","default":false},"context_graph_topology":{"items":{"additionalProperties":{"type":"string"},"type":"object"},"type":"array","title":"Context Graph Topology","default":[]},"terminal_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Terminal State"}},"additionalProperties":true,"type":"object","required":["current_state"],"title":"SimulationSnapshotResponse"},"SimulationStateResponse":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"objective":{"type":"string","title":"Objective","default":""},"actions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Actions","default":[]},"exit_conditions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Exit Conditions","default":[]},"action_guidelines":{"items":{"type":"string"},"type":"array","title":"Action Guidelines","default":[]},"boundary_constraints":{"items":{"type":"string"},"type":"array","title":"Boundary Constraints","default":[]},"guardrails":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Guardrails","default":[]},"tools":{"items":{"type":"string"},"type":"array","title":"Tools","default":[]}},"additionalProperties":true,"type":"object","required":["name","type"],"title":"SimulationStateResponse"},"SimulationStepResponse":{"properties":{"observation":{"$ref":"#/components/schemas/SimulationObservation"},"snapshot":{"$ref":"#/components/schemas/SimulationSnapshotResponse"}},"type":"object","required":["observation","snapshot"],"title":"SimulationStepResponse"},"SimulationSuiteResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","maxLength":128,"title":"Name"},"description":{"type":"string","maxLength":2000,"title":"Description","default":""},"case_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Case Ids"},"required_tags":{"items":{"type":"string","maxLength":128},"type":"array","title":"Required Tags"},"tags":{"items":{"type":"string","maxLength":128},"type":"array","title":"Tags"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata"},"case_count":{"type":"integer","minimum":0.0,"title":"Case Count"},"created_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Created By"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","workspace_id","name","case_count"],"title":"SimulationSuiteResponse","description":"HTTP response shape for first-class simulation suites."},"SimulationSuiteRunResultsResponse":{"properties":{"run_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Run Ids"},"total_runs":{"type":"integer","title":"Total Runs"},"status_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Status Counts"},"completed_count":{"type":"integer","title":"Completed Count","default":0},"failed_count":{"type":"integer","title":"Failed Count","default":0},"scored_count":{"type":"integer","title":"Scored Count","default":0},"average_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Average Score"},"pass_count":{"type":"integer","title":"Pass Count","default":0},"fail_count":{"type":"integer","title":"Fail Count","default":0},"metric_status":{"type":"string","enum":["pending","available","unavailable"],"title":"Metric Status","default":"pending"},"metric_result_count":{"type":"integer","title":"Metric Result Count","default":0},"metrics_last_checked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Metrics Last Checked At"},"per_run":{"items":{"$ref":"#/components/schemas/SimulationBenchmarkPerRunSummary"},"type":"array","title":"Per Run"},"capability_breakdown":{"additionalProperties":{"$ref":"#/components/schemas/SimulationBenchmarkBreakdownSummary"},"type":"object","title":"Capability Breakdown"},"missing_run_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Missing Run Ids"},"suite_run_id":{"type":"string","format":"uuid","title":"Suite Run Id"},"suite_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Suite Id"},"summary":{"$ref":"#/components/schemas/SimulationSuiteRunSummary"}},"type":"object","required":["run_ids","total_runs","suite_run_id","summary"],"title":"SimulationSuiteRunResultsResponse"},"SimulationSuiteRunSummary":{"properties":{"suite_run_id":{"type":"string","format":"uuid","title":"Suite Run Id"},"suite_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Suite Id"},"run_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Run Ids"},"total_runs":{"type":"integer","title":"Total Runs"},"status":{"type":"string","enum":["running","completed","failed"],"title":"Status"},"status_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Status Counts"},"case_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Case Ids"},"total_sessions":{"type":"integer","title":"Total Sessions","default":0},"total_turns":{"type":"integer","title":"Total Turns","default":0},"tags":{"items":{"type":"string","maxLength":128},"type":"array","title":"Tags"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"result_pointer":{"additionalProperties":true,"type":"object","title":"Result Pointer"}},"type":"object","required":["suite_run_id","run_ids","total_runs","status"],"title":"SimulationSuiteRunSummary"},"SimulationTurnPolicyResponse":{"properties":{"barge_in_enabled":{"type":"boolean","title":"Barge In Enabled","default":true},"greeting_shield_s":{"type":"number","title":"Greeting Shield S","default":0.0},"safety_response":{"type":"string","title":"Safety Response","default":"suspend_forward"},"context_strategy":{"type":"string","title":"Context Strategy","default":"full"},"block_forward_call":{"type":"boolean","title":"Block Forward Call","default":false},"block_forward_call_after_turns":{"type":"integer","title":"Block Forward Call After Turns","default":-1}},"type":"object","title":"SimulationTurnPolicyResponse"},"SinkSyncStatus":{"properties":{"data_source_id":{"type":"string","format":"uuid","title":"Data Source Id"},"name":{"type":"string","title":"Name"},"source_type":{"type":"string","title":"Source Type"},"total":{"type":"integer","title":"Total"},"synced":{"type":"integer","title":"Synced"},"failed":{"type":"integer","title":"Failed"},"pending":{"type":"integer","title":"Pending"}},"type":"object","required":["data_source_id","name","source_type","total","synced","failed","pending"],"title":"SinkSyncStatus"},"SkillContextGraphReference":{"properties":{"context_graph_id":{"type":"string","format":"uuid","title":"Context Graph Id"},"context_graph_name":{"type":"string","title":"Context Graph Name"},"version":{"type":"integer","title":"Version"},"states":{"items":{"$ref":"#/components/schemas/SkillStateReference"},"type":"array","title":"States"}},"type":"object","required":["context_graph_id","context_graph_name","version","states"],"title":"SkillContextGraphReference"},"SkillReferencesResponse":{"properties":{"skill_id":{"type":"string","format":"uuid","title":"Skill Id"},"skill_slug":{"type":"string","title":"Skill Slug"},"context_graph_references":{"items":{"$ref":"#/components/schemas/SkillContextGraphReference"},"type":"array","title":"Context Graph References"},"service_references":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Service References"}},"type":"object","required":["skill_id","skill_slug","context_graph_references","service_references"],"title":"SkillReferencesResponse"},"SkillResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"system_prompt":{"type":"string","title":"System Prompt"},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema"},"result_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result Schema"},"model":{"type":"string","title":"Model"},"max_tokens":{"type":"integer","title":"Max Tokens"},"max_result_chars":{"type":"integer","title":"Max Result Chars"},"max_input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Input Tokens"},"timeout_s":{"type":"number","title":"Timeout S"},"thinking_effort":{"anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"null"}],"title":"Thinking Effort"},"enable_caching":{"type":"boolean","title":"Enable Caching"},"enable_citations":{"type":"boolean","title":"Enable Citations"},"use_structured_output":{"type":"boolean","title":"Use Structured Output"},"integration_tools":{"items":{"$ref":"#/components/schemas/src__models__IntegrationToolRef"},"type":"array","title":"Integration Tools"},"static_tools":{"items":{"$ref":"#/components/schemas/src__models__StaticToolDef"},"type":"array","title":"Static Tools"},"enabled":{"type":"boolean","title":"Enabled"},"max_agent_turns":{"type":"integer","title":"Max Agent Turns"},"checkpoint_enabled":{"type":"boolean","title":"Checkpoint Enabled"},"approval_required":{"type":"boolean","title":"Approval Required"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","workspace_id","slug","name","description","system_prompt","input_schema","result_schema","model","max_tokens","max_result_chars","max_input_tokens","timeout_s","thinking_effort","enable_caching","enable_citations","use_structured_output","integration_tools","static_tools","enabled","max_agent_turns","checkpoint_enabled","approval_required","created_at","updated_at"],"title":"SkillResponse"},"SkillStateReference":{"properties":{"state_name":{"type":"string","title":"State Name"},"tool_spec_category":{"type":"string","title":"Tool Spec Category"}},"type":"object","required":["state_name","tool_spec_category"],"title":"SkillStateReference"},"SlugString":{"type":"string","maxLength":63,"minLength":2,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]$"},"SourceBreakdownItem":{"properties":{"source_system":{"type":"string","title":"Source System"},"entity_type":{"type":"string","title":"Entity Type"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["source_system","entity_type","count"],"title":"SourceBreakdownItem"},"SourceBreakdownResponse":{"properties":{"breakdown":{"items":{"$ref":"#/components/schemas/SourceBreakdownItem"},"type":"array","title":"Breakdown"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["breakdown","total"],"title":"SourceBreakdownResponse"},"SourceEventItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_type":{"type":"string","title":"Event Type"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"source":{"type":"string","title":"Source"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"confidence":{"type":"number","title":"Confidence"},"ingested_at":{"type":"string","format":"date-time","title":"Ingested At"}},"type":"object","required":["id","event_type","source","confidence","ingested_at"],"title":"SourceEventItem"},"SourceFailureItem":{"properties":{"event_id":{"type":"string","format":"uuid","title":"Event Id"},"event_type":{"type":"string","title":"Event Type"},"fhir_resource_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fhir Resource Type"},"sync_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sync Error"},"ingested_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ingested At"}},"type":"object","required":["event_id","event_type"],"title":"SourceFailureItem"},"SourceHistoryItem":{"properties":{"bucket":{"type":"string","title":"Bucket"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"event_count":{"type":"integer","title":"Event Count"}},"type":"object","required":["bucket","event_count"],"title":"SourceHistoryItem"},"SourceListItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"source_type":{"type":"string","enum":["rest_api","webhook","file_drop","fhir_store","ehr","database","custom","smart_fhir","customer_intake","lakebase_schema","crm"],"title":"Source Type"},"is_active":{"type":"boolean","title":"Is Active"},"health_status":{"type":"string","enum":["unknown","healthy","degraded"],"title":"Health Status"},"last_poll":{"anyOf":[{"$ref":"#/components/schemas/LastPollInfo"},{"type":"null"}]},"event_count":{"type":"integer","title":"Event Count","default":0},"last_sync_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sync At"}},"type":"object","required":["id","name","source_type","is_active","health_status"],"title":"SourceListItem"},"SourceOverviewResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"source_type":{"type":"string","enum":["rest_api","webhook","file_drop","fhir_store","ehr","database","custom","smart_fhir","customer_intake","lakebase_schema","crm"],"title":"Source Type"},"is_active":{"type":"boolean","title":"Is Active"},"health_status":{"type":"string","enum":["unknown","healthy","degraded"],"title":"Health Status"},"last_sync_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sync At"},"last_sync_status":{"anyOf":[{"type":"string","enum":["success","error"]},{"type":"null"}],"title":"Last Sync Status"},"last_sync_event_count":{"type":"integer","title":"Last Sync Event Count","default":0},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"event_count":{"type":"integer","title":"Event Count","default":0},"entity_count":{"type":"integer","title":"Entity Count","default":0},"last_poll":{"anyOf":[{"$ref":"#/components/schemas/LastPollInfo"},{"type":"null"}]},"recent_failures":{"items":{"$ref":"#/components/schemas/SourceFailureItem"},"type":"array","title":"Recent Failures","default":[]},"outbound":{"$ref":"#/components/schemas/OutboundSummary","default":{"total":0,"synced":0,"failed":0,"pending":0}}},"type":"object","required":["id","name","source_type","is_active","health_status"],"title":"SourceOverviewResponse"},"SourceStatus":{"properties":{"data_source_id":{"type":"string","format":"uuid","title":"Data Source Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"source_type":{"type":"string","enum":["rest_api","webhook","file_drop","fhir_store","ehr","database","custom","smart_fhir","customer_intake","lakebase_schema","crm"],"title":"Source Type"},"connector_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connector Type"},"status":{"type":"string","title":"Status"},"last_poll_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Poll At"},"last_poll_duration_ms":{"type":"integer","title":"Last Poll Duration Ms","default":0},"last_poll_event_count":{"type":"integer","title":"Last Poll Event Count","default":0},"last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Error"},"consecutive_errors":{"type":"integer","title":"Consecutive Errors","default":0},"connection_healthy":{"type":"boolean","title":"Connection Healthy","default":true}},"type":"object","required":["data_source_id","workspace_id","source_type","status"],"title":"SourceStatus"},"SqlQueryRequest":{"properties":{"sql":{"type":"string","maxLength":50000,"minLength":1,"title":"Sql","description":"Read-only SQL query against Databricks."}},"type":"object","required":["sql"],"title":"SqlQueryRequest"},"SqlQueryResponse":{"properties":{"results":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Results"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"SqlQueryResponse"},"StartSessionRequest":{"properties":{"service_id":{"type":"string","format":"uuid","title":"Service Id"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id","description":"World model entity UUID. Provide either entity_id or canonical_id."},"canonical_id":{"anyOf":[{"$ref":"#/components/schemas/CanonicalIdString"},{"type":"null"}],"description":"World model canonical_id of the form 'source:resource_type:id' (e.g. 'charmhealth:Patient:67890'). The structural regex on CanonicalIdString blocks spaces, names, DOBs, and similar regulated content. Resolved against the SDP-projected world.entities table; a freshly-created entity may not be visible yet if the projection is lagging. Provide either entity_id or canonical_id, not both."},"channel_kind":{"type":"string","const":"web","title":"Channel Kind"},"greeting":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Greeting","description":"Custom greeting. Agent auto-greets if omitted."}},"type":"object","required":["service_id","channel_kind"],"title":"StartSessionRequest"},"StartSessionResponse":{"properties":{"conversation_id":{"type":"string","format":"uuid","title":"Conversation Id"},"session_status":{"type":"string","enum":["created","already_active"],"title":"Session Status"},"channel_kind":{"type":"string","const":"web","title":"Channel Kind"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"service_id":{"type":"string","format":"uuid","title":"Service Id"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["conversation_id","session_status","channel_kind","entity_id","service_id","created_at"],"title":"StartSessionResponse"},"StateRiskOverride":{"properties":{"topic_risk_score":{"type":"number","title":"Topic Risk Score","default":0.0},"auto_escalate_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Auto Escalate Threshold"},"max_loop_count":{"type":"integer","title":"Max Loop Count","default":3},"operator_skill":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Operator Skill"}},"type":"object","title":"StateRiskOverride","description":"Per-state escalation tuning. Stored on ActionState."},"StateTransition":{"properties":{"type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"},"previous_state":{"type":"string","title":"Previous State","default":""},"next_state":{"type":"string","title":"Next State","default":""},"annotation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Annotation"},"nav_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nav Ms"},"from_state":{"type":"string","title":"From State","readOnly":true},"to_state":{"type":"string","title":"To State","readOnly":true}},"type":"object","required":["from_state","to_state"],"title":"StateTransition"},"StaticHeaderAuthDict":{"properties":{"type":{"type":"string","const":"static_header","title":"Type"},"header_name":{"type":"string","title":"Header Name"}},"type":"object","required":["type","header_name"],"title":"StaticHeaderAuthDict","description":"Static workspace-level secret used verbatim as a single header value.\n\nReplaces legacy ``api_key_header`` and ``bearer_token`` — bearer is just\n``header_name=\"Authorization\"`` with the SSM secret holding ``\"Bearer <token>\"``."},"StaticHeaderAuthRequest":{"properties":{"type":{"type":"string","const":"static_header","title":"Type","default":"static_header"},"header_name":{"type":"string","maxLength":256,"minLength":1,"pattern":"^[A-Za-z0-9!#$%&'*+\\-.^_`|~]+$","title":"Header Name","description":"Outbound header name (RFC 7230 tchar)."}},"type":"object","required":["header_name"],"title":"StaticHeaderAuthRequest","description":"Static workspace-level secret used verbatim as a single header value."},"StaticToolDef-Input":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema"}},"type":"object","required":["name","description","input_schema"],"title":"StaticToolDef","description":"A built-in tool available to companion agents."},"StepRequest":{"properties":{"session_id":{"type":"string","maxLength":64,"title":"Session Id"},"caller_text":{"type":"string","maxLength":2000,"title":"Caller Text"},"emotion":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Emotion"},"valence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":-1.0},{"type":"null"}],"title":"Valence"}},"type":"object","required":["session_id","caller_text"],"title":"StepRequest"},"StoredParameter":{"properties":{"name":{"type":"string","title":"Name"},"type":{"type":"string","enum":["string","integer","number","boolean"],"title":"Type"},"description":{"type":"string","title":"Description"},"default":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"type":"null"}],"title":"Default"}},"additionalProperties":false,"type":"object","required":["name","type","description"],"title":"StoredParameter","description":"One typed input parameter to a workspace data query — trusted shape.\n\nRead-path model: the DB's CHECK constraints already enforced ``name``\nregex and ``type`` enum on write, and the deploy endpoint's strict\n:class:`Parameter` validators enforced ``description`` length and\ntypo-rejection at the inbound network edge. After that, every\nconstruction of this model (DB read projection, executor binding,\nagent-engine spec, outbound response) is trusted — no 422 surface.\n\n``default is None`` is the canonical \"required\" signal: the executor\nraises if a caller omits a required argument, otherwise substitutes\nthe stored default."},"StratifiedFitRow":{"properties":{"workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","const":"labs"}],"title":"Workspace Id"},"outcome_key":{"type":"string","title":"Outcome Key"},"outcome_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome Name"},"cohort":{"type":"string","title":"Cohort"},"region":{"type":"string","title":"Region"},"n":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"N"},"base_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Base Rate"},"auroc":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Auroc"},"intercept":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Intercept"},"coefficients_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coefficients Json"},"is_pooled_fallback":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Pooled Fallback"}},"type":"object","required":["workspace_id","outcome_key","cohort","region"],"title":"StratifiedFitRow"},"StratifiedFitsResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"count":{"type":"integer","title":"Count"},"items":{"items":{"$ref":"#/components/schemas/StratifiedFitRow"},"type":"array","title":"Items"}},"type":"object","required":["workspace_id","count","items"],"title":"StratifiedFitsResponse"},"StrippedNonemptyString":{"type":"string","minLength":1},"SubToolLog":{"properties":{"tool_name":{"type":"string","title":"Tool Name","description":"Name of the tool that was invoked"},"input":{"additionalProperties":true,"type":"object","title":"Input","description":"Input parameters passed to the tool"},"output":{"type":"string","title":"Output","description":"Raw output returned by the tool"},"duration_ms":{"type":"number","title":"Duration Ms","description":"Execution time in milliseconds"},"succeeded":{"type":"boolean","title":"Succeeded","description":"Whether the tool invocation succeeded"},"round":{"type":"integer","title":"Round","description":"Agent reasoning round in which the tool was called"}},"type":"object","required":["tool_name","input","output","duration_ms","succeeded","round"],"title":"SubToolLog"},"SubToolLogItem":{"properties":{"tool_name":{"type":"string","title":"Tool Name","default":""},"input":{"additionalProperties":true,"type":"object","title":"Input"},"output":{"type":"string","title":"Output","default":""},"duration_ms":{"type":"number","title":"Duration Ms","default":0.0},"succeeded":{"type":"boolean","title":"Succeeded","default":true}},"type":"object","title":"SubToolLogItem"},"SuggestionsResponse":{"properties":{"suggestions":{"items":{"type":"string"},"type":"array","title":"Suggestions"}},"type":"object","required":["suggestions"],"title":"SuggestionsResponse"},"SurfaceErrorResponse":{"properties":{"error_code":{"type":"string","maxLength":64,"title":"Error Code","description":"Machine-readable error code."},"message":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Message","description":"Human-readable error message. Omitted for token-validator errors that only carry ``reason``."},"reason":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Reason","description":"Debug detail from the token validator (e.g. ``token expired``)."},"details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Details","description":"Optional structured validation details for 422 responses."}},"type":"object","required":["error_code"],"title":"SurfaceErrorResponse","description":"Error envelope returned by patient-facing surface JSON endpoints.\n\nFrontend (forms-app) reads ``error_code`` for branching and ``message``\nfor user-visible copy. ``reason`` is a debug-only field set by the token\nvalidator. ``details`` is set when a request body fails server-side\nvalidation."},"SurfaceField":{"properties":{"key":{"type":"string","maxLength":128,"minLength":1,"title":"Key"},"label":{"$ref":"#/components/schemas/NameString"},"field_type":{"$ref":"#/components/schemas/FieldType"},"required":{"type":"boolean","title":"Required","default":true},"options":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Options"},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"placeholder":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Placeholder"},"prefill_value":{"anyOf":[{},{"type":"null"}],"title":"Prefill Value"},"validation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Validation"},"sensitive":{"type":"boolean","title":"Sensitive","default":false},"condition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Condition"},"consent_text":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}],"title":"Consent Text"}},"type":"object","required":["key","label","field_type"],"title":"SurfaceField","description":"A single data collection field in a surface spec.\n\nGenerated by agents from HSM analysis. Each field maps\nto a specific piece of data the world model needs."},"SurfaceProgressResponse":{"properties":{"surface_id":{"type":"string","format":"uuid","title":"Surface Id"},"total_fields":{"type":"integer","title":"Total Fields"},"filled_count":{"type":"integer","title":"Filled Count"},"empty_count":{"type":"integer","title":"Empty Count"},"filled_keys":{"items":{"type":"string"},"type":"array","title":"Filled Keys"},"empty_keys":{"items":{"type":"string"},"type":"array","title":"Empty Keys"},"required_empty_keys":{"items":{"type":"string"},"type":"array","title":"Required Empty Keys"}},"type":"object","required":["surface_id","total_fields","filled_count","empty_count","filled_keys","empty_keys","required_empty_keys"],"title":"SurfaceProgressResponse"},"SurfaceResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"event_id":{"type":"string","format":"uuid","title":"Event Id"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"$ref":"#/components/schemas/SurfaceStatus"},"channel":{"anyOf":[{"$ref":"#/components/schemas/ChannelType"},{"type":"null"}]},"use_case_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Use Case Id"},"fields_count":{"type":"integer","title":"Fields Count"},"fields":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Fields","default":[]},"resource_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Type"},"context":{"additionalProperties":true,"type":"object","title":"Context","default":{}},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"delivered_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivered At"},"opened_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Opened At"},"submitted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Submitted At"},"submitted_data":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Submitted Data"},"delivery_metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Delivery Metadata"}},"type":"object","required":["id","event_id","status","fields_count"],"title":"SurfaceResponse"},"SurfaceSection":{"properties":{"title":{"$ref":"#/components/schemas/NameString"},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"field_keys":{"items":{"type":"string"},"type":"array","maxItems":100,"minItems":1,"title":"Field Keys"},"condition":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Condition"}},"type":"object","required":["title","field_keys"],"title":"SurfaceSection","description":"A page/step in a multi-page surface form."},"SurfaceSpec":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"title":{"$ref":"#/components/schemas/NameString"},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"fields":{"items":{"$ref":"#/components/schemas/SurfaceField"},"type":"array","maxItems":200,"minItems":1,"title":"Fields"},"channel":{"$ref":"#/components/schemas/ChannelType","default":"web"},"expires_in_hours":{"type":"integer","maximum":8760.0,"minimum":1.0,"title":"Expires In Hours","default":168},"context":{"additionalProperties":true,"type":"object","title":"Context"},"resource_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Resource Type"},"branding":{"anyOf":[{"$ref":"#/components/schemas/BrandingConfig"},{"type":"null"}]},"sections":{"anyOf":[{"items":{"$ref":"#/components/schemas/SurfaceSection"},"type":"array"},{"type":"null"}],"title":"Sections"},"completion_title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Completion Title"},"completion_message":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Completion Message"},"completion_action_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Completion Action Url"},"submit_button_text":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Submit Button Text"}},"type":"object","required":["entity_id","title","fields"],"title":"SurfaceSpec","description":"A complete surface specification generated by an agent.\n\nThe agent reads the HSM (entity state, relationships,\nconfidence gaps) and produces this spec. The spec is stored as a\nworld.event and rendered by platform-api into a patient-facing page."},"SurfaceSpecResponse":{"properties":{"surface_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Surface Id"},"entity_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Entity Id"},"status":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Status"},"spec":{"$ref":"#/components/schemas/PatientSurfaceSpec"},"saved_values":{"additionalProperties":true,"type":"object","title":"Saved Values"}},"type":"object","required":["spec"],"title":"SurfaceSpecResponse","description":"Surface render bundle returned to forms-app SSR."},"SurfaceStatus":{"type":"string","enum":["created","pending_review","delivered","opened","partial","completed","expired","archived"],"title":"SurfaceStatus","description":"Lifecycle status of a surface."},"SwitchModeRequest":{"properties":{"call_sid":{"type":"string","maxLength":64,"minLength":1,"title":"Call Sid"},"participant_call_sid":{"type":"string","maxLength":64,"title":"Participant Call Sid","default":""},"mode":{"type":"string","enum":["listen","takeover"],"title":"Mode"}},"type":"object","required":["call_sid","mode"],"title":"SwitchModeRequest","description":"Request to toggle operator mode on an active call."},"SwitchModeResponse":{"properties":{"mode":{"type":"string","enum":["listen","takeover"],"title":"Mode","description":"New operator mode"}},"type":"object","required":["mode"],"title":"SwitchModeResponse"},"SyncFailureEntry":{"properties":{"event_id":{"type":"string","format":"uuid","title":"Event Id"},"event_type":{"type":"string","title":"Event Type"},"fhir_resource_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fhir Resource Type"},"fhir_resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fhir Resource Id"},"sync_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sync Error"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["event_id","event_type","fhir_resource_type","fhir_resource_id","sync_error","created_at"],"title":"SyncFailureEntry"},"SyncHistoryEntry":{"properties":{"date":{"type":"string","title":"Date"},"event_count":{"type":"integer","title":"Event Count"},"synced_count":{"type":"integer","title":"Synced Count"},"failed_count":{"type":"integer","title":"Failed Count"}},"type":"object","required":["date","event_count","synced_count","failed_count"],"title":"SyncHistoryEntry"},"TMSMappingReleaseParams":{"properties":{"rule_kind":{"type":"string","const":"tms_mapping_release","title":"Rule Kind","default":"tms_mapping_release"},"reservation_window_hours":{"type":"integer","maximum":720.0,"minimum":0.0,"title":"Reservation Window Hours"},"weekend_skip":{"type":"boolean","title":"Weekend Skip","default":true}},"type":"object","required":["reservation_window_hours"],"title":"TMSMappingReleaseParams","description":"How long before a TMS mapping appointment its slot is released\nback to the pool. ``weekend_skip=True`` adds Saturday + Sunday days\nto the wall-clock countdown (clinic doesn't release on weekends)."},"TMSSessionGridParams":{"properties":{"rule_kind":{"type":"string","const":"tms_session_grid","title":"Rule Kind","default":"tms_session_grid"},"interval_minutes":{"type":"integer","maximum":120.0,"minimum":5.0,"title":"Interval Minutes"},"boundary_minutes":{"items":{"type":"integer"},"type":"array","maxItems":60,"minItems":1,"title":"Boundary Minutes"}},"type":"object","required":["interval_minutes","boundary_minutes"],"title":"TMSSessionGridParams","description":"TMS sessions only start at fixed minute-of-hour boundaries\n(e.g. ``:00`` and ``:30``) so the technician can run them\nback-to-back without gaps."},"TargetSpec":{"properties":{"desired_states":{"items":{"type":"string","maxLength":128},"type":"array","maxItems":50,"title":"Desired States"},"non_desired_states":{"items":{"$ref":"#/components/schemas/NonDesiredState"},"type":"array","maxItems":50,"title":"Non Desired States"},"ordered_pathways":{"items":{"$ref":"#/components/schemas/OrderedPathway"},"type":"array","maxItems":20,"title":"Ordered Pathways"},"completion_criteria":{"$ref":"#/components/schemas/CompletionCriteria"}},"type":"object","title":"TargetSpec"},"TestCallerNumbersRequest":{"properties":{"numbers":{"items":{"type":"string"},"type":"array","maxItems":100,"title":"Numbers"}},"type":"object","required":["numbers"],"title":"TestCallerNumbersRequest"},"TestCallerNumbersResponse":{"properties":{"numbers":{"items":{"type":"string"},"type":"array","title":"Numbers"}},"type":"object","required":["numbers"],"title":"TestCallerNumbersResponse"},"TestInvokeResponse":{"properties":{"result":{"title":"Result"},"duration_ms":{"type":"number","title":"Duration Ms","default":0.0},"row_count":{"type":"integer","title":"Row Count","default":0},"status":{"type":"string","title":"Status","default":"pass"},"error":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Error"},"test_duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Test Duration Ms"}},"type":"object","title":"TestInvokeResponse","description":"Response shape for ``POST /v1/{ws}/functions/{name}/test``.\n\nStructural superset of :class:`InvokeResponse`. Adds ``status`` and\n``error`` so the DC can render the executor's failure detail inline\nrather than a generic \"Invocation failed.\" The underlying invoke\nuses the same path; ``status`` / ``error`` are filled in by\n``service.test`` after catching any ``HTTPException`` (503) from the\nexecutor, so the route never bubbles a 5xx for a logical SQL\nfailure — it's still a 200 with ``status=fail`` so the caller can\nshow the message.\n\nInvariant (enforced by :func:`_check_error_when_fail`):\n``status == \"fail\" → error is not None and len(error) > 0``."},"TestSkillRequest":{"properties":{"input":{"additionalProperties":true,"type":"object","title":"Input","description":"Input parameters to pass to the skill executor."},"static_tool_mocks":{"additionalProperties":{"$ref":"#/components/schemas/_ToolMockValue"},"propertyNames":{"$ref":"#/components/schemas/_ToolMockKey"},"type":"object","maxProperties":64,"title":"Static Tool Mocks","description":"Map of static tool name (max 128 chars) to mocked output string (max 16 KB). Up to 64 entries."}},"type":"object","required":["input"],"title":"TestSkillRequest"},"TestSkillResponse":{"properties":{"result":{"type":"string","title":"Result","description":"Final result text produced by the skill"},"duration_ms":{"type":"number","title":"Duration Ms","description":"Total execution time in milliseconds"},"input_tokens":{"type":"integer","title":"Input Tokens","description":"Number of input tokens consumed"},"output_tokens":{"type":"integer","title":"Output Tokens","description":"Number of output tokens generated"},"cached_tokens":{"type":"integer","title":"Cached Tokens","description":"Number of tokens served from cache"},"rounds":{"type":"integer","title":"Rounds","description":"Number of agent reasoning rounds executed"},"sub_tool_logs":{"items":{"$ref":"#/components/schemas/SubToolLog"},"type":"array","title":"Sub Tool Logs","description":"Chronological log of tool invocations"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if the skill execution failed"}},"type":"object","required":["result","duration_ms","input_tokens","output_tokens","cached_tokens","rounds","sub_tool_logs"],"title":"TestSkillResponse"},"TextTurnRequest":{"properties":{"phone_number":{"type":"string","maxLength":16,"pattern":"^\\+[1-9]\\d{1,14}$","title":"Phone Number"},"text":{"type":"string","maxLength":8192,"minLength":1,"title":"Text"}},"type":"object","required":["phone_number","text"],"title":"TextTurnRequest","description":"Request body for ``POST /v1/{ws}/services/{service_id}/text-turn``."},"TextTurnResponse":{"properties":{"text":{"type":"string","maxLength":8192,"title":"Text"}},"type":"object","required":["text"],"title":"TextTurnResponse","description":"Response body — the agent's text reply.\n\nReturned only on 200; 204 indicates the engine elected silence."},"ThroughputBucket":{"properties":{"bucket":{"type":"string","title":"Bucket"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"event_count":{"type":"integer","title":"Event Count"}},"type":"object","required":["bucket","event_count"],"title":"ThroughputBucket"},"TimelineActor":{"properties":{"kind":{"type":"string","enum":["agent","human","operator","system","tool"],"title":"Kind"},"role":{"type":"string","enum":["agent","caller","operator","runtime","state","tool"],"title":"Role"},"label":{"type":"string","title":"Label"},"participant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Id"}},"type":"object","required":["kind","role","label"],"title":"TimelineActor"},"TimelineLaneDefinition":{"properties":{"id":{"type":"string","maxLength":160,"minLength":1,"title":"Id","description":"Stable canonical lane id used by timeline visualizations. Segments attach via TimelineSegment.lane_id; consumers should not re-infer lanes from CSS or pixel positions."},"track":{"type":"string","enum":["agent","caller","operator","system","tool"],"title":"Track","description":"High-level actor-semantic track for styling and grouping."},"label":{"type":"string","title":"Label","description":"Display label for the lane."},"order":{"type":"integer","title":"Order","description":"Stable vertical order within the timeline lane model."},"actor":{"anyOf":[{"$ref":"#/components/schemas/TimelineActor"},{"type":"null"}],"description":"Actor represented by this lane when applicable."}},"type":"object","required":["id","track","label","order"],"title":"TimelineLaneDefinition"},"TimelineSegment":{"properties":{"type":{"type":"string","enum":["agent_speech","barge_in","caller_speech","filler_hesitation","filler_nav","greeting","interrupted_speech","processing_gap","silence","silence_check","state_transition","tool_call"],"title":"Type"},"lane":{"type":"string","enum":["agent","caller","events","operator","system","tool"],"title":"Lane"},"track":{"anyOf":[{"type":"string","enum":["agent","caller","operator","system","tool"]},{"type":"null"}],"title":"Track","description":"Actor-semantic display track for the segment. Inferred for legacy producers."},"lane_id":{"anyOf":[{"type":"string","maxLength":160,"minLength":1},{"type":"null"}],"title":"Lane Id","description":"Canonical lane id. Must match PlaybackTimeline.lanes[].id after platform normalization."},"order":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Order","description":"Canonical event order after platform time/lane normalization."},"actor":{"anyOf":[{"$ref":"#/components/schemas/TimelineActor"},{"type":"null"}],"description":"Actor responsible for the segment. Inferred for legacy producers."},"start":{"type":"number","title":"Start"},"end":{"type":"number","title":"End"},"label":{"type":"string","title":"Label"},"turn_index":{"type":"integer","title":"Turn Index"},"stt_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stt Confidence"},"eot_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eot Confidence"},"audio_window_start":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Window Start"},"audio_window_end":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Window End"},"engine_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Engine Ms"},"nav_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nav Ms"},"render_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Render Ms"},"audio_ttfb_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Ttfb Ms"},"e2e_ttfb_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"E2E Ttfb Ms"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"parent_call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent Call Id"},"integration_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Integration Name"},"endpoint_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint Name"},"protocol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Protocol"},"succeeded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Succeeded"},"duration_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Ms"},"from_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From State"},"to_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To State"},"emotion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Emotion"},"valence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Valence"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},"type":"object","required":["type","lane","start","end","label","turn_index"],"title":"TimelineSegment"},"TimelineTimebase":{"properties":{"unit":{"type":"string","const":"seconds","title":"Unit","description":"Timeline offsets are always seconds.","default":"seconds"},"origin":{"type":"string","enum":["media_start","call_start","synthetic"],"title":"Origin","description":"Zero point used for segment start/end offsets.","default":"media_start"},"start":{"type":"number","title":"Start","description":"Visible/canonical timeline range start in seconds.","default":0.0},"end":{"type":"number","title":"End","description":"Visible/canonical timeline range end in seconds.","default":0.0}},"type":"object","title":"TimelineTimebase"},"ToolCall":{"properties":{"tool_name":{"type":"string","title":"Tool Name"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"input":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input"},"output":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Output"},"output_truncated":{"type":"boolean","title":"Output Truncated","default":false},"output_original_length":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Output Original Length"},"output_truncated_to":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Output Truncated To"},"duration_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Ms"},"succeeded":{"type":"boolean","title":"Succeeded","default":true},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"integration_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Integration Name"},"endpoint_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Endpoint Name"},"protocol":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Protocol"}},"type":"object","required":["tool_name"],"title":"ToolCall"},"ToolCallDetail":{"properties":{"tool_name":{"type":"string","title":"Tool Name"},"input":{"type":"string","title":"Input","default":""},"result":{"type":"string","title":"Result","default":""},"call_id":{"type":"string","title":"Call Id","default":""},"succeeded":{"type":"boolean","title":"Succeeded","default":true}},"type":"object","required":["tool_name"],"title":"ToolCallDetail","description":"Rich tool call data from a simulation step."},"ToolCallSpec":{"properties":{"tool_id":{"type":"string","title":"Tool Id"},"additional_instruction":{"type":"string","title":"Additional Instruction","default":""},"navigate_on_completion":{"type":"boolean","title":"Navigate On Completion","default":false},"progress":{"anyOf":[{"$ref":"#/components/schemas/ProgressHint"},{"type":"null"}]},"result_persistence":{"type":"string","enum":["accumulate","override"],"title":"Result Persistence","default":"accumulate"},"delivery":{"type":"string","enum":["interrupt","queue"],"title":"Delivery","default":"interrupt"},"failure_delivery":{"anyOf":[{"type":"string","enum":["interrupt","queue"]},{"type":"null"}],"title":"Failure Delivery"},"failure_delivery_by_class":{"anyOf":[{"additionalProperties":{"type":"string","enum":["interrupt","queue"]},"propertyNames":{"$ref":"#/components/schemas/FailureClass"},"type":"object"},{"type":"null"}],"title":"Failure Delivery By Class"},"execution":{"type":"string","enum":["blocking","background"],"title":"Execution","default":"blocking"},"audio_fillers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Audio Fillers"},"audio_filler_triggered_after":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Filler Triggered After"}},"type":"object","required":["tool_id"],"title":"ToolCallSpec","description":"A tool call that the agent can make in a state."},"ToolExecuteRequest":{"properties":{"tool_type":{"type":"string","maxLength":64,"title":"Tool Type","description":"world_tool — other tool families use their dedicated endpoints"},"tool_name":{"$ref":"#/components/schemas/NameString","description":"Fully qualified tool name"},"service_id":{"type":"string","format":"uuid","title":"Service Id","description":"Service ID that owns the HSM"},"input_params":{"additionalProperties":true,"type":"object","title":"Input Params","description":"Parameters to pass to the tool handler"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id","description":"Optional entity ID for context"},"dry_run":{"type":"boolean","title":"Dry Run","description":"If true, write tools are simulated without persistence","default":false}},"type":"object","required":["tool_type","tool_name","service_id"],"title":"ToolExecuteRequest"},"ToolExecuteResponse":{"properties":{"result":{"title":"Result"},"duration_ms":{"type":"number","title":"Duration Ms","default":0.0},"dry_run":{"type":"boolean","title":"Dry Run","default":false},"source":{"type":"string","title":"Source","default":"tool_test"},"tool_type":{"type":"string","title":"Tool Type","default":""},"tier":{"type":"string","title":"Tier","default":"world"},"is_write":{"type":"boolean","title":"Is Write","default":false},"sub_tool_logs":{"items":{"$ref":"#/components/schemas/SubToolLogItem"},"type":"array","title":"Sub Tool Logs"},"blocked_side_effects":{"items":{"type":"string"},"type":"array","title":"Blocked Side Effects"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","title":"ToolExecuteResponse"},"ToolResolveResponse":{"properties":{"tools":{"items":{"$ref":"#/components/schemas/ResolvedToolItem"},"type":"array","title":"Tools"},"service_id":{"type":"string","format":"uuid","title":"Service Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"}},"type":"object","required":["tools","service_id","workspace_id"],"title":"ToolResolveResponse"},"ToolSummary":{"properties":{"total_calls":{"type":"integer","title":"Total Calls","description":"Total tool invocations","default":0},"succeeded":{"type":"integer","title":"Succeeded","description":"Successful tool invocations","default":0},"failed":{"type":"integer","title":"Failed","description":"Failed tool invocations","default":0},"failure_rate":{"type":"number","title":"Failure Rate","description":"Tool failure rate 0.0 to 1.0","default":0.0}},"type":"object","title":"ToolSummary","description":"Tool usage statistics.\n\nFree-form residual on the raw ``tool_summary`` JSONB:\n``by_tool: list[{name, calls, succeeded, failed, avg_duration_ms}]``\n— per-tool breakdown. Not exposed via this typed shape."},"TopSource":{"properties":{"source":{"type":"string","title":"Source"},"fact_count":{"type":"integer","title":"Fact Count"},"entity_count":{"type":"integer","title":"Entity Count"}},"type":"object","required":["source","fact_count","entity_count"],"title":"TopSource"},"TraceAnalysisListItem":{"properties":{"call_sid":{"type":"string","maxLength":128,"minLength":1,"title":"Call Sid","description":"Call identifier"},"call_entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Call Entity Id","description":"Associated world.entities call row UUID"},"outcome":{"anyOf":[{"type":"string","enum":["succeeded","partially","failed","abandoned"]},{"type":"null"}],"title":"Outcome","description":"Overall call outcome"},"summary":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Summary","description":"Short call summary"},"emotional_arc":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Emotional Arc","description":"Caller emotional trajectory string"},"key_moment_count":{"type":"integer","minimum":0.0,"title":"Key Moment Count","description":"Number of key moments identified","default":0},"computed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Computed At","description":"When the analysis was produced"}},"type":"object","required":["call_sid"],"title":"TraceAnalysisListItem","description":"Compact summary of a trace analysis row for list views."},"TraceAnalysisListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TraceAnalysisListItem"},"type":"array","title":"Items","description":"Trace analysis summaries"},"has_more":{"type":"boolean","title":"Has More","description":"Whether more rows are available beyond this page","default":false},"continuation_token":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Continuation Token","description":"Token to pass as ``continuation_token`` for the next page (None when exhausted)"}},"type":"object","title":"TraceAnalysisListResponse","description":"Paginated list response for trace analyses."},"TraceAnalysisResponse":{"properties":{"call_sid":{"type":"string","maxLength":128,"minLength":1,"title":"Call Sid","description":"Call identifier (Twilio call SID or direct session ID)"},"status":{"type":"string","enum":["ready","pending","unavailable"],"title":"Status","description":"ready: analysis complete. pending: call completed, analysis processing. unavailable: analysis not possible for this call.","default":"ready"},"summary":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Summary","description":"2-3 sentence narrative of the call - the emotional story, not just what happened"},"outcome":{"anyOf":[{"type":"string","enum":["succeeded","partially","failed","abandoned"]},{"type":"null"}],"title":"Outcome","description":"Overall call outcome"},"key_moment_count":{"type":"integer","minimum":0.0,"title":"Key Moment Count","description":"Number of key decision moments identified (typically 3-8)","default":0},"key_moments":{"items":{"$ref":"#/components/schemas/TraceKeyMoment"},"type":"array","maxItems":100,"title":"Key Moments","description":"Key decision points with causal attribution to audio inputs"},"emotional_arc":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Emotional Arc","description":"Caller emotional trajectory as a readable sequence (e.g. 'curious -> confused -> frustrated -> relieved')"},"emotional_shifts":{"items":{"$ref":"#/components/schemas/EmotionalShift"},"type":"array","maxItems":100,"title":"Emotional Shifts","description":"Critical emotional state changes detected in the caller's voice"},"interaction_dynamics":{"anyOf":[{"$ref":"#/components/schemas/InteractionDynamics"},{"type":"null"}],"description":"System-level conversation flow analysis"},"coaching":{"items":{"$ref":"#/components/schemas/CoachingItem"},"type":"array","maxItems":50,"title":"Coaching","description":"Specific, actionable agent improvements tied to exact moments in this call"},"counterfactuals":{"items":{"$ref":"#/components/schemas/Counterfactual"},"type":"array","maxItems":50,"title":"Counterfactuals","description":"Alternative actions that would have meaningfully changed the outcome"},"deep_understanding":{"anyOf":[{"type":"string","maxLength":10000,"minLength":1},{"type":"null"}],"title":"Deep Understanding","description":"Synthesis of why this call went the way it did - combining audio perception with execution data"},"signal_response_alignment":{"items":{"$ref":"#/components/schemas/SignalResponseAlignment"},"type":"array","maxItems":50,"title":"Signal Response Alignment","description":"Per-signal alignment analysis: whether the agent's response matched each salient signal"},"missed_opportunities":{"items":{"type":"string","maxLength":2000,"minLength":1},"type":"array","maxItems":50,"title":"Missed Opportunities","description":"Moments where the agent could have taken a better action"},"emergent_patterns":{"items":{"type":"string","maxLength":2000,"minLength":1},"type":"array","maxItems":50,"title":"Emergent Patterns","description":"Cross-call or cross-turn patterns detected by the analysis"},"call_entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Call Entity Id","description":"UUID string of the associated world.entities call row (if resolved)"},"computed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Computed At","description":"When the analysis was produced by the pipeline"}},"type":"object","required":["call_sid"],"title":"TraceAnalysisResponse","description":"Deep call understanding produced by the Amigo intelligence pipeline.\n\nAnalyzes the raw call audio to identify emotional dynamics, key decision\nmoments, and actionable coaching - understanding that exceeds what either\nparticipant had during the call itself.\n\n**Latency note**: This endpoint reads from the analytics data warehouse.\nExpect 500ms-2s response time, not sub-10ms like transactional endpoints.","examples":[{"call_sid":"CA493e4610386f87f43b02102068eb6ad3","deep_understanding":"The call failed not because of agent behavior but because of environmental factors - the caller was pulled into a side conversation that the agent could not compete with.","emotional_arc":"neutral -> cooperative -> distracted -> disengaged","key_moment_count":2,"outcome":"abandoned","status":"ready","summary":"The caller initially cooperated with scheduling but became distracted by a nearby conversation, ultimately abandoning the call without booking."}]},"TraceKeyMoment":{"properties":{"timestamp_seconds":{"anyOf":[{"type":"number","maximum":86400.0,"minimum":0.0},{"type":"null"}],"title":"Timestamp Seconds","description":"Approximate position in the recording (seconds from start)"},"what_happened":{"type":"string","maxLength":2000,"minLength":1,"title":"What Happened","description":"Plain-English description of the agent's decision"},"quality":{"anyOf":[{"type":"string","enum":["optimal","adequate","suboptimal"]},{"type":"null"}],"title":"Quality","description":"Assessment of the decision quality"},"reasoning":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Reasoning","description":"Why this was the right or wrong choice given the audio context"},"decision_factors":{"items":{"$ref":"#/components/schemas/DecisionFactor"},"type":"array","maxItems":20,"title":"Decision Factors","description":"Specific audio inputs that drove this decision"},"alternative":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Alternative","description":"What else the agent could have done and the likely outcome"}},"type":"object","required":["what_happened"],"title":"TraceKeyMoment","description":"A key decision point identified from the call audio.","examples":[{"alternative":"Could have confirmed insurance first, but would have slowed the positive momentum","decision_factors":[{"factor":"Caller said 'yes, Thursday works'","source_type":"transcript"},{"factor":"Speech rate increased - eagerness to proceed","source_type":"speech_rate"}],"quality":"optimal","reasoning":"Caller's confident tone and direct 'Thursday works' indicated readiness to schedule","timestamp_seconds":23.4,"what_happened":"Agent transitioned to scheduling after caller confirmed availability"}]},"TranscriptSegment":{"properties":{"speaker_role":{"type":"string","title":"Speaker Role"},"transcript":{"type":"string","title":"Transcript"},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timestamp"},"escalation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Escalation Id"},"confidence":{"type":"number","title":"Confidence"}},"type":"object","required":["speaker_role","transcript","timestamp","escalation_id","confidence"],"title":"TranscriptSegment"},"TriggerFireResponse":{"properties":{"fired_event_id":{"type":"string","format":"uuid","title":"Fired Event Id"},"trigger_id":{"type":"string","format":"uuid","title":"Trigger Id"},"status":{"type":"string","const":"fired","title":"Status","default":"fired"}},"type":"object","required":["fired_event_id","trigger_id"],"title":"TriggerFireResponse"},"TriggerResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"name":{"type":"string","title":"Name","description":"Trigger display name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description","description":"Human-readable description"},"event_type":{"type":"string","title":"Event Type","description":"Event type pattern to match"},"event_filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Event Filter","description":"JSONPath filter on event data"},"action_id":{"type":"string","format":"uuid","title":"Action Id","description":"Action (skill) to invoke when fired"},"input_template":{"additionalProperties":true,"type":"object","title":"Input Template","description":"Input template merged with event data"},"schedule":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schedule","description":"Cron schedule expression (e.g. '0 9 * * 1-5')"},"timezone":{"type":"string","title":"Timezone","description":"IANA timezone for schedule evaluation"},"next_fire_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Fire At","description":"Next scheduled fire time"},"is_active":{"type":"boolean","title":"Is Active","description":"Whether the trigger is active"},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By","description":"Entity ID of the creator"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the trigger was created"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At","description":"When the trigger was last updated"}},"type":"object","required":["id","workspace_id","name","event_type","action_id","input_template","timezone","is_active"],"title":"TriggerResponse"},"TriggerRunResponse":{"properties":{"event_id":{"type":"string","format":"uuid","title":"Event Id"},"event_type":{"type":"string","title":"Event Type","description":"Event type of the run"},"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Run result data"},"effective_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Effective At","description":"When the run took effect"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the run was created"}},"type":"object","required":["event_id","event_type","data"],"title":"TriggerRunResponse"},"TriggerSyncConflictDetails":{"properties":{"last_poll_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Poll At"},"last_poll_duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Last Poll Duration Ms"}},"type":"object","title":"TriggerSyncConflictDetails","description":"Operational fields included in a 409 to power UI affordances like\n\"syncing for 30s\" — strict allowlist, never the whole status entry."},"TriggerSyncConflictResponse":{"properties":{"message":{"type":"string","title":"Message"},"details":{"$ref":"#/components/schemas/TriggerSyncConflictDetails"}},"type":"object","required":["message","details"],"title":"TriggerSyncConflictResponse","description":"Body shape for the 409 returned by POST /sync when the source is\nalready mid-poll. Documented in OpenAPI so SDK consumers get a typed\nAlreadySyncing error instead of an opaque blob."},"TriggerSyncResponse":{"properties":{"status":{"type":"string","const":"started","title":"Status"},"data_source_id":{"type":"string","format":"uuid","title":"Data Source Id"},"triggered_at":{"type":"string","format":"date-time","title":"Triggered At"}},"type":"object","required":["status","data_source_id","triggered_at"],"title":"TriggerSyncResponse"},"Turn":{"properties":{"id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string"},{"type":"null"}],"title":"Id"},"trigger":{"type":"string","title":"Trigger","default":""},"user_transcript":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Transcript","x-phi":true},"agent_transcript":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Transcript","x-phi":true},"agent_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Action"},"interrupted":{"type":"boolean","title":"Interrupted","default":false},"filler_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filler Type"},"speaker_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Speaker Id"},"speaker_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Speaker Role"},"emotion_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Emotion Label"},"emotion_valence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Emotion Valence"},"compound_emotions":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Compound Emotions"},"stt_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stt Confidence"},"eot_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Eot Confidence"},"state":{"type":"string","title":"State","default":""},"tool_calls":{"items":{"$ref":"#/components/schemas/ToolCall"},"type":"array","title":"Tool Calls","default":[]},"state_transitions":{"items":{"$ref":"#/components/schemas/StateTransition"},"type":"array","title":"State Transitions","default":[]},"inner_thoughts":{"items":{"type":"string"},"type":"array","title":"Inner Thoughts","default":[]},"timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Timestamp"},"engine_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Engine Ms"},"user_speech_start_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"User Speech Start Ms"},"user_speech_end_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"User Speech End Ms"},"agent_speech_start_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Agent Speech Start Ms"},"agent_speech_end_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Agent Speech End Ms"},"audio_window_start_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Window Start Ms"},"audio_window_end_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Window End Ms"},"nav_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nav Ms"},"render_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Render Ms"},"audio_ttfb_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Ttfb Ms"},"signal_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signal Kind"},"signal_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signal Source"},"state_before":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State Before"},"state_after":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State After"},"primary_effect_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Effect Kind"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"tool_succeeded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tool Succeeded"},"tool_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Tool Ms"},"modality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Modality"},"empathy_tier":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Empathy Tier"},"decision_bearing":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Decision Bearing"}},"type":"object","title":"Turn"},"TurnConversationSnapshot":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"type":"string","enum":["active","closed","completed","in-progress","failed"],"title":"Status"},"turn_count":{"type":"integer","title":"Turn Count","default":0},"updated_at":{"type":"string","title":"Updated At"},"context_graph_state":{"anyOf":[{"$ref":"#/components/schemas/ContextGraphState-Output"},{"type":"null"}]}},"type":"object","required":["id","status","updated_at"],"title":"TurnConversationSnapshot"},"TurnPolicy":{"properties":{"barge_in_enabled":{"type":"boolean","title":"Barge In Enabled","default":true},"greeting_shield_s":{"type":"number","title":"Greeting Shield S","default":0.0},"safety_response":{"type":"string","enum":["suspend_forward","stay_empathize","alert"],"title":"Safety Response","default":"stay_empathize"},"context_strategy":{"type":"string","enum":["full","summarize","compact"],"title":"Context Strategy","default":"full"},"degradation_threshold":{"type":"integer","minimum":-1.0,"title":"Degradation Threshold","default":-1},"block_forward_call":{"type":"boolean","title":"Block Forward Call","default":false},"block_forward_call_after_turns":{"type":"integer","minimum":-1.0,"title":"Block Forward Call After Turns","default":-1},"stt_eot_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stt Eot Threshold"},"stt_eager_eot_threshold":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Stt Eager Eot Threshold"},"stt_eot_timeout_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stt Eot Timeout Ms"}},"type":"object","title":"TurnPolicy","description":"Voice pipeline parameters declared per HSM state.\n\nLives on ActionState/DecisionState alongside guardrails, wait_for, and\nchannel_overrides.  The HSM state IS the policy — no shadow state machine.\nAll fields optional with safe defaults (production behavior unchanged\nwhen no turn_policy is set)."},"TurnRequest":{"properties":{"message":{"type":"string","maxLength":10000,"title":"Message","default":""},"content":{"anyOf":[{"items":{"$ref":"#/components/schemas/ContentPartPayload"},"type":"array","maxItems":20},{"type":"null"}],"title":"Content"},"media_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Media Url"},"media_type":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Media Type"},"context":{"anyOf":[{"type":"string","maxLength":100000},{"type":"null"}],"title":"Context","description":"Injected into the agent's prompt as caller/patient context for this turn."},"viewport_width":{"anyOf":[{"type":"integer","maximum":500.0,"minimum":20.0},{"type":"null"}],"title":"Viewport Width"},"viewport_height":{"anyOf":[{"type":"integer","maximum":500.0,"minimum":5.0},{"type":"null"}],"title":"Viewport Height"}},"type":"object","title":"TurnRequest"},"TurnResponse":{"properties":{"turn_id":{"type":"string","title":"Turn Id"},"input":{"$ref":"#/components/schemas/ConversationTurn"},"output":{"items":{"$ref":"#/components/schemas/ConversationTurn"},"type":"array","title":"Output"},"tool_calls":{"items":{"$ref":"#/components/schemas/ConversationToolCallDetail"},"type":"array","title":"Tool Calls","default":[]},"conversation":{"$ref":"#/components/schemas/TurnConversationSnapshot"}},"type":"object","required":["turn_id","input","output","conversation"],"title":"TurnResponse"},"TurnTimeline":{"properties":{"turn_index":{"type":"integer","title":"Turn Index"},"seek_to":{"type":"number","title":"Seek To"},"active_start":{"type":"number","title":"Active Start"},"active_end":{"type":"number","title":"Active End"}},"type":"object","required":["turn_index","seek_to","active_start","active_end"],"title":"TurnTimeline"},"UpdateAgentRequest":{"properties":{"name":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]}},"type":"object","title":"UpdateAgentRequest"},"UpdateConfigRequest":{"properties":{"strategy":{"anyOf":[{"type":"string","enum":["usage","outcome","custom"]},{"type":"null"}],"title":"Strategy"},"currency":{"anyOf":[{"type":"string","maxLength":3},{"type":"null"}],"title":"Currency"},"billing_cycle":{"anyOf":[{"type":"string","enum":["monthly","quarterly","annual"]},{"type":"null"}],"title":"Billing Cycle"},"billing_day":{"anyOf":[{"type":"integer","maximum":28.0,"minimum":1.0},{"type":"null"}],"title":"Billing Day"},"price_rules":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":100},{"type":"null"}],"title":"Price Rules"},"minimum_charge":{"anyOf":[{"type":"number","minimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Minimum Charge"},"effective_from":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Effective From"},"effective_to":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Effective To"}},"type":"object","title":"UpdateConfigRequest"},"UpdateContextGraphRequest":{"properties":{"name":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]}},"type":"object","title":"UpdateContextGraphRequest"},"UpdateCustomerRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":256,"minLength":1},{"type":"null"}],"title":"Name"},"billing_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Billing Email"},"billing_contact":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Billing Contact"},"mercury_memo":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Mercury Memo"},"address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Address"},"status":{"anyOf":[{"type":"string","enum":["active","archived"]},{"type":"null"}],"title":"Status"}},"type":"object","title":"UpdateCustomerRequest"},"UpdateDashboardRequest":{"properties":{"slug":{"anyOf":[{"type":"string","maxLength":128,"minLength":2,"pattern":"^[a-z0-9][a-z0-9\\-]*$"},{"type":"null"}],"title":"Slug"},"title":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"page_context":{"anyOf":[{"type":"string","enum":["home","patients","calls","data","analytics","pipeline","operators","surfaces","compliance","custom"]},{"type":"null"}],"title":"Page Context"},"panels":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":50},{"type":"null"}],"title":"Panels"},"filters":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array","maxItems":20},{"type":"null"}],"title":"Filters"},"refresh_interval":{"anyOf":[{"type":"integer","maximum":86400.0,"minimum":10.0},{"type":"null"}],"title":"Refresh Interval"}},"type":"object","title":"UpdateDashboardRequest"},"UpdateDataSourceRequest":{"properties":{"display_name":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"connection_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Connection Config"},"entity_types":{"anyOf":[{"items":{"type":"string","maxLength":64,"minLength":1},"type":"array","maxItems":100},{"type":"null"}],"title":"Entity Types"},"field_mappings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Field Mappings"},"sync_strategy":{"anyOf":[{"type":"string","enum":["manual","scheduled","webhook","continuous"]},{"type":"null"}],"title":"Sync Strategy"},"sync_schedule":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Sync Schedule"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"UpdateDataSourceRequest"},"UpdateOperatorRequest":{"properties":{"name":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"type":{"anyOf":[{"type":"string","enum":["clinical","administrative","crisis_counselor"]},{"type":"null"}],"title":"Type"},"skills":{"anyOf":[{"items":{"type":"string","maxLength":64,"minLength":1},"type":"array","maxItems":50},{"type":"null"}],"title":"Skills"},"connection_method":{"anyOf":[{"type":"string","enum":["browser","phone"]},{"type":"null"}],"title":"Connection Method"},"phone_number":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}]},"role":{"anyOf":[{"type":"string","enum":["operator","supervisor","admin"]},{"type":"null"}],"title":"Role"},"status":{"anyOf":[{"type":"string","enum":["online","busy","offline"]},{"type":"null"}],"title":"Status"}},"type":"object","title":"UpdateOperatorRequest"},"UpdateSchedulingRuleSetRequest":{"properties":{"params":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/ClinicOpenHoursParams"},{"$ref":"#/components/schemas/TMSMappingReleaseParams"},{"$ref":"#/components/schemas/TMSSessionGridParams"},{"$ref":"#/components/schemas/KetamineBlockOverlapParams"},{"$ref":"#/components/schemas/NinetyDayRollingParams"},{"$ref":"#/components/schemas/ConcurrentStartBlockParams"}],"discriminator":{"propertyName":"rule_kind","mapping":{"clinic_open_hours":"#/components/schemas/ClinicOpenHoursParams","concurrent_start_block":"#/components/schemas/ConcurrentStartBlockParams","ketamine_block_overlap":"#/components/schemas/KetamineBlockOverlapParams","ninety_day_rolling":"#/components/schemas/NinetyDayRollingParams","tms_mapping_release":"#/components/schemas/TMSMappingReleaseParams","tms_session_grid":"#/components/schemas/TMSSessionGridParams"}}},{"type":"null"}],"title":"Params"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"UpdateSchedulingRuleSetRequest","description":"Partial update — fields not provided are unchanged. ``params``\nmust be the full per-kind shape (no patch within params); send the\nwhole RuleParams or omit."},"UpdateServiceRequest":{"properties":{"name":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"agent_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Agent Id"},"context_graph_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Context Graph Id"},"keyterms":{"anyOf":[{"items":{"type":"string","maxLength":128,"minLength":1},"type":"array","maxItems":500},{"type":"null"}],"title":"Keyterms"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"version_sets":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/VersionSet-Input"},"type":"object"},{"type":"null"}],"title":"Version Sets"},"tags":{"anyOf":[{"items":{"$ref":"#/components/schemas/ServiceTag"},"type":"array","maxItems":50},{"type":"null"}],"title":"Tags"},"tool_capacity":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":1.0},{"type":"null"}],"title":"Tool Capacity"},"safety_filters_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Safety Filters Enabled"},"channel_type":{"anyOf":[{"type":"string","enum":["voice","text"]},{"type":"null"}],"title":"Channel Type"},"environment":{"anyOf":[{"type":"string","enum":["sandbox","production"]},{"type":"null"}],"title":"Environment"},"voice_config":{"anyOf":[{"$ref":"#/components/schemas/ServiceVoiceConfig-Input"},{"type":"null"}]},"escalation_policy":{"anyOf":[{"$ref":"#/components/schemas/EscalationPolicy"},{"type":"null"}]}},"type":"object","title":"UpdateServiceRequest"},"UpdateSimulationCaseRequest":{"properties":{"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"persona":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Persona"},"description":{"anyOf":[{"type":"string","maxLength":2000,"minLength":1},{"type":"null"}],"title":"Description"},"scenario":{"anyOf":[{"$ref":"#/components/schemas/SimulationCaseScenario"},{"type":"null"}]},"grounding":{"anyOf":[{"$ref":"#/components/schemas/SimulationCaseGrounding"},{"type":"null"}]},"evals":{"anyOf":[{"items":{"anyOf":[{"$ref":"#/components/schemas/SimulationCaseMetricEval"},{"$ref":"#/components/schemas/SimulationCaseAssertionEval"}]},"type":"array","maxItems":100},{"type":"null"}],"title":"Evals"},"tags":{"anyOf":[{"items":{"type":"string","maxLength":128},"type":"array","maxItems":20},{"type":"null"}],"title":"Tags"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"additionalProperties":false,"type":"object","title":"UpdateSimulationCaseRequest","description":"Partial update for one durable simulation case.\n\nMirrors the nested ``CreateSimulationCaseItem`` shape with every field\noptional so ``model_dump(exclude_unset=True)`` only emits the keys the\ncaller actually sent. Reuses the same nested submodels as create so the\ndurable fields (``scenario``, ``grounding``, ``evals``, ``metadata``) can\nbe PATCHed. ``extra=\"forbid\"`` rejects the retired pre-V192 flat fields\n(scenario_instructions, initial_message, temperament, fixtures,\nconstraints, target_spec, assertions, provenance) with 422 instead of\nsilently dropping them."},"UpdateSimulationSuiteRequest":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"case_ids":{"anyOf":[{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":500},{"type":"null"}],"title":"Case Ids"},"required_tags":{"anyOf":[{"items":{"type":"string","maxLength":128},"type":"array","maxItems":20},{"type":"null"}],"title":"Required Tags"},"tags":{"anyOf":[{"items":{"type":"string","maxLength":128},"type":"array","maxItems":20},{"type":"null"}],"title":"Tags"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"additionalProperties":false,"type":"object","title":"UpdateSimulationSuiteRequest"},"UpdateSkillRequest":{"properties":{"name":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"system_prompt":{"anyOf":[{"$ref":"#/components/schemas/BackgroundString"},{"type":"null"}]},"input_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Schema"},"result_schema":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Result Schema"},"model":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Model"},"max_tokens":{"anyOf":[{"type":"integer","maximum":200000.0,"minimum":1.0},{"type":"null"}],"title":"Max Tokens"},"max_result_chars":{"anyOf":[{"type":"integer","maximum":200000.0,"minimum":1.0},{"type":"null"}],"title":"Max Result Chars"},"max_input_tokens":{"anyOf":[{"type":"integer","maximum":2000000.0,"minimum":1.0},{"type":"null"}],"title":"Max Input Tokens"},"timeout_s":{"anyOf":[{"type":"number","maximum":900.0,"minimum":0.1},{"type":"null"}],"title":"Timeout S"},"thinking_effort":{"anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"null"}],"title":"Thinking Effort"},"enable_caching":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enable Caching"},"enable_citations":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enable Citations"},"use_structured_output":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Use Structured Output"},"integration_tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/IntegrationToolRef-Input"},"type":"array","maxItems":50},{"type":"null"}],"title":"Integration Tools"},"static_tools":{"anyOf":[{"items":{"$ref":"#/components/schemas/StaticToolDef-Input"},"type":"array","maxItems":50},{"type":"null"}],"title":"Static Tools"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"max_agent_turns":{"anyOf":[{"type":"integer","maximum":200.0,"minimum":1.0},{"type":"null"}],"title":"Max Agent Turns"},"checkpoint_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Checkpoint Enabled"},"approval_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Approval Required"}},"type":"object","title":"UpdateSkillRequest"},"UpdateSurfaceRequest":{"properties":{"title":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/SurfaceField"},"type":"array","maxItems":200,"minItems":1},{"type":"null"}],"title":"Fields"},"branding":{"anyOf":[{"$ref":"#/components/schemas/BrandingConfig"},{"type":"null"}]},"sections":{"anyOf":[{"items":{"$ref":"#/components/schemas/SurfaceSection"},"type":"array"},{"type":"null"}],"title":"Sections"},"completion_title":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Completion Title"},"completion_message":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Completion Message"},"completion_action_url":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Completion Action Url"},"submit_button_text":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Submit Button Text"},"channel":{"anyOf":[{"$ref":"#/components/schemas/ChannelType"},{"type":"null"}]},"resource_type":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Resource Type"}},"type":"object","title":"UpdateSurfaceRequest","description":"Partial update to an existing surface.\n\nAll fields are optional. Only provided fields are merged into the spec.\nOnly allowed while status is CREATED or DELIVERED."},"UpdateTriggerRequest":{"properties":{"name":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]},"event_type":{"anyOf":[{"$ref":"#/components/schemas/EventTypeString"},{"type":"null"}]},"event_filter":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Event Filter"},"action_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Action Id"},"input_template":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Template"},"schedule":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Schedule"},"timezone":{"anyOf":[{"type":"string","maxLength":64,"minLength":1},{"type":"null"}],"title":"Timezone"}},"type":"object","title":"UpdateTriggerRequest"},"UpdateWorkspaceRequest":{"properties":{"name":{"anyOf":[{"$ref":"#/components/schemas/StrippedNonemptyString"},{"type":"null"}]},"environment":{"anyOf":[{"type":"string","enum":["production","staging","development"]},{"type":"null"}],"title":"Environment"},"region":{"anyOf":[{"type":"string","enum":["us-east-1","ap-southeast-2","eu-central-1","ca-central-1"]},{"type":"null"}],"title":"Region"},"connector_type":{"anyOf":[{"type":"string","enum":["epic","cerner","allscripts","fhir_store","athenahealth","charmhealth","eclinicalworks","meditab"]},{"type":"null"}],"title":"Connector Type"}},"type":"object","title":"UpdateWorkspaceRequest"},"UploadDuplicateInfo":{"properties":{"id":{"type":"string","maxLength":64,"title":"Id","description":"UUID of the existing upload row."},"received_at":{"type":"string","maxLength":64,"title":"Received At","description":"ISO-8601 timestamp the original upload was received."}},"type":"object","required":["id","received_at"],"title":"UploadDuplicateInfo","description":"Pointer to an existing upload row when content-hash dedup fires."},"UploadFileResponse":{"properties":{"id":{"type":"string","maxLength":64,"title":"Id","description":"UUID of the newly created upload row."},"filename":{"type":"string","maxLength":256,"title":"Filename","description":"Stored filename."},"sha256":{"type":"string","maxLength":128,"title":"Sha256","description":"SHA-256 of the uploaded bytes (lowercase hex)."},"size_bytes":{"type":"integer","minimum":0.0,"title":"Size Bytes","description":"Stored size in bytes."},"scan_status":{"type":"string","maxLength":32,"title":"Scan Status","description":"Virus-scan status (e.g. ``clean``, ``skipped``)."},"duplicate_of":{"anyOf":[{"$ref":"#/components/schemas/UploadDuplicateInfo"},{"type":"null"}],"description":"Set when this upload's content hash matched a prior upload; otherwise null."}},"type":"object","required":["id","filename","sha256","size_bytes","scan_status"],"title":"UploadFileResponse","description":"Receipt for a successful upload via an intake link."},"UpsertVersionSetRequest":{"properties":{"version_set":{"$ref":"#/components/schemas/VersionSet-Input"}},"type":"object","required":["version_set"],"title":"UpsertVersionSetRequest"},"UsageBucket":{"properties":{"event_type":{"type":"string","title":"Event Type","description":"World event type"},"event_date":{"type":"string","format":"date","title":"Event Date","description":"Date of the usage bucket"},"count":{"type":"integer","title":"Count","description":"Number of events in this bucket"},"avg_duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Duration Seconds","description":"Average event duration in seconds"},"total_duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Duration Seconds","description":"Total event duration in seconds"}},"type":"object","required":["event_type","event_date","count"],"title":"UsageBucket"},"UsageSummaryResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id","description":"Workspace identifier"},"period_start":{"type":"string","format":"date","title":"Period Start","description":"Start of the reporting period"},"period_end":{"type":"string","format":"date","title":"Period End","description":"End of the reporting period"},"buckets":{"items":{"$ref":"#/components/schemas/UsageBucket"},"type":"array","title":"Buckets","description":"Usage data grouped by event type and date"},"total_events":{"type":"integer","title":"Total Events","description":"Total number of events in the period"}},"type":"object","required":["workspace_id","period_start","period_end","buckets","total_events"],"title":"UsageSummaryResponse"},"UsageTrendPoint":{"properties":{"period_start":{"type":"string","title":"Period Start","description":"Period start date (ISO-8601)"},"period_end":{"type":"string","title":"Period End","description":"Period end date (ISO-8601)"},"meter_key":{"type":"string","title":"Meter Key","description":"Meter identifier"},"metering_source":{"type":"string","enum":["production","simulation"],"title":"Metering Source","description":"Traffic class","default":"production"},"value":{"type":"number","title":"Value","description":"Metered value for this period"},"unit":{"type":"string","title":"Unit","description":"Unit of measurement"}},"type":"object","required":["period_start","period_end","meter_key","value","unit"],"title":"UsageTrendPoint"},"UseCaseListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UseCaseResponse"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"UseCaseListResponse"},"UseCaseResponse":{"properties":{"id":{"type":"string","title":"Id"},"channel":{"type":"string","title":"Channel"},"entity_name":{"type":"string","title":"Entity Name"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"setup_id":{"type":"string","title":"Setup Id"},"configuration_set_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Configuration Set Name"},"sender_email_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sender Email Address"},"email_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Type"},"tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tier"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","channel","entity_name","name","description","setup_id","created_at","updated_at"],"title":"UseCaseResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VersionSet-Input":{"properties":{"agent_version_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agent Version Number"},"context_graph_version_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Graph Version Number"},"llm_model_preferences":{"additionalProperties":{"$ref":"#/components/schemas/LLMConfig"},"type":"object","title":"Llm Model Preferences"}},"type":"object","title":"VersionSet","description":"Pins agent, state machine, and LLM model versions for a service."},"VersionSet-Output":{"properties":{"agent_version_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Agent Version Number"},"context_graph_version_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Context Graph Version Number"},"llm_model_preferences":{"additionalProperties":{"$ref":"#/components/schemas/LLMConfig"},"type":"object","title":"Llm Model Preferences"}},"type":"object","title":"VersionSet","description":"Pins agent, state machine, and LLM model versions for a service."},"VoiceConfig":{"properties":{"voice_id":{"type":"string","title":"Voice Id"},"stability":{"type":"number","title":"Stability","default":0},"similarity_boost":{"type":"number","title":"Similarity Boost","default":0},"style":{"type":"number","title":"Style","default":0},"tts_provider":{"anyOf":[{"type":"string","enum":["cartesia","elevenlabs","groq"]},{"type":"null"}],"title":"Tts Provider"},"tts_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tts Config"},"language_providers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/LanguageProviderEntry"},"type":"object","maxProperties":10},{"type":"null"}],"title":"Language Providers"}},"type":"object","required":["voice_id"],"title":"VoiceConfig"},"VoiceDetail":{"properties":{"recording_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Path"},"twilio_recording_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Twilio Recording Sid"},"twilio_recording_duration":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Twilio Recording Duration"},"has_recording":{"type":"boolean","title":"Has Recording","default":false},"verified_transcript":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Verified Transcript"},"transcript_accuracy":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Transcript Accuracy"},"emotional_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Emotional Summary"},"barge_in_events":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Barge In Events","default":[]},"states_visited":{"items":{"type":"string"},"type":"array","title":"States Visited","default":[]},"participants":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Participants","default":[]},"config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Config"},"call_analysis":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Call Analysis"},"forwarding":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Forwarding"},"escalation":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Escalation"},"safety":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Safety"},"quality_breakdown":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Quality Breakdown"},"risk_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Risk Summary"},"latency_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Latency Summary"},"conversation_metrics":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Conversation Metrics"},"tool_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tool Summary"},"safety_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Safety Summary"},"operator_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Operator Summary"}},"type":"object","title":"VoiceDetail"},"VoiceJudgeRecentResponse":{"properties":{"service_id":{"type":"string","format":"uuid","title":"Service Id"},"count":{"type":"integer","minimum":0.0,"title":"Count"},"items":{"items":{"$ref":"#/components/schemas/VoiceJudgeResultRow"},"type":"array","title":"Items"}},"type":"object","required":["service_id","count","items"],"title":"VoiceJudgeRecentResponse"},"VoiceJudgeResultRow":{"properties":{"call_sid":{"type":"string","maxLength":64,"title":"Call Sid"},"call_entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Call Entity Id"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"latency_dead_air_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency Dead Air Score"},"pronunciation_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pronunciation Score"},"clarity_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Clarity Score"},"filler_silence_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Filler Silence Score"},"interruption_handling_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Interruption Handling Score"},"audio_consistency_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Audio Consistency Score"},"pacing_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pacing Score"},"warmth_tone_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Warmth Tone Score"},"accent_quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Accent Quality Score"},"voice_identity_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Voice Identity Score"},"overall_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Overall Score"},"critical_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Critical Count"},"flag_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Flag Count"},"warning_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Warning Count"},"judge_json":{"anyOf":[{"type":"string","maxLength":32768},{"type":"null"}],"title":"Judge Json","description":"Raw Gemini judge output (evidence quotes, per-dim severity). Intended for UI drill-in; opaque string. Capped at 32KB."},"computed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Computed At"}},"type":"object","required":["call_sid"],"title":"VoiceJudgeResultRow","description":"One call's voice-judge scoring, as stored in the Delta output table."},"VoiceMetrics":{"properties":{"active_calls":{"type":"integer","title":"Active Calls","default":0},"active_escalated":{"type":"integer","title":"Active Escalated","default":0},"calls_today":{"type":"integer","title":"Calls Today","default":0},"avg_quality_score_today":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Quality Score Today"},"escalation_rate_today":{"type":"number","title":"Escalation Rate Today","default":0.0}},"type":"object","title":"VoiceMetrics"},"VoiceSettingsRequest":{"properties":{"voice_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Voice Id"},"tone":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Tone"},"speed":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speed"},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume"},"language":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Language"},"keyterms":{"anyOf":[{"items":{"type":"string","maxLength":128,"minLength":1},"type":"array","maxItems":200},{"type":"null"}],"title":"Keyterms"},"correction_categories":{"anyOf":[{"items":{"type":"string","maxLength":128,"minLength":1},"type":"array","maxItems":50},{"type":"null"}],"title":"Correction Categories"},"pronunciation_dict_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Pronunciation Dict Id"},"sensitive_topics":{"anyOf":[{"items":{"type":"string","maxLength":128,"minLength":1},"type":"array","maxItems":50},{"type":"null"}],"title":"Sensitive Topics"},"post_call_analysis_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Post Call Analysis Enabled"},"transcript_correction_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Transcript Correction Enabled"},"tts_provider":{"anyOf":[{"type":"string","enum":["cartesia","elevenlabs","groq"]},{"type":"null"}],"title":"Tts Provider"},"tts_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tts Config"},"language_providers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/LanguageProviderEntry"},"type":"object"},{"type":"null"}],"title":"Language Providers"}},"type":"object","title":"VoiceSettingsRequest","description":"Voice experience control plane — PM-facing, high-level controls.\n\nControls the caller experience without exposing engineering internals.\nEmotion detection, filler speech, model selection, and buffer tuning\nare always-on internals managed by engineering."},"VoiceSettingsResponse":{"properties":{"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id"},"tone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tone"},"speed":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Speed"},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume"},"language":{"type":"string","title":"Language"},"keyterms":{"items":{"type":"string"},"type":"array","title":"Keyterms"},"correction_categories":{"items":{"type":"string"},"type":"array","title":"Correction Categories"},"pronunciation_dict_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pronunciation Dict Id"},"sensitive_topics":{"items":{"type":"string"},"type":"array","title":"Sensitive Topics"},"post_call_analysis_enabled":{"type":"boolean","title":"Post Call Analysis Enabled"},"transcript_correction_enabled":{"type":"boolean","title":"Transcript Correction Enabled"},"tts_provider":{"anyOf":[{"type":"string","enum":["cartesia","elevenlabs","groq"]},{"type":"null"}],"title":"Tts Provider"},"tts_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Tts Config"},"language_providers":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/LanguageProviderEntry"},"type":"object"},{"type":"null"}],"title":"Language Providers"}},"type":"object","required":["voice_id","tone","speed","volume","language","keyterms","correction_categories","pronunciation_dict_id","sensitive_topics","post_call_analysis_enabled","transcript_correction_enabled","tts_provider","tts_config"],"title":"VoiceSettingsResponse","description":"Voice experience state — what the PM configured."},"VoiceUseCaseRequest":{"properties":{"channel":{"type":"string","enum":["outbound_voice","inbound_voice","ringless_voicemail"],"title":"Channel"},"entity_name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Entity Name"},"name":{"type":"string","maxLength":31,"minLength":1,"pattern":"^[A-Za-z\\- ]+$","title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Description"},"setup_id":{"type":"string","format":"uuid","title":"Setup Id"}},"type":"object","required":["channel","entity_name","name","setup_id"],"title":"VoiceUseCaseRequest"},"WorkspaceBenchmarks":{"properties":{"avg_quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Quality Score"},"p50_quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P50 Quality Score"},"p25_quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P25 Quality Score"},"p75_quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P75 Quality Score"},"total_calls":{"type":"integer","title":"Total Calls","default":0},"avg_duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Duration Seconds"},"escalation_rate":{"type":"number","title":"Escalation Rate","default":0.0},"quality_distribution":{"additionalProperties":{"type":"integer"},"type":"object","title":"Quality Distribution","default":{}}},"type":"object","title":"WorkspaceBenchmarks","description":"Workspace-level call quality benchmarks for contextual comparison."},"WorkspaceConnectorConfigResponse":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"connector_type":{"type":"string","title":"Connector Type"},"data_source_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Data Source Id"},"connection_config":{"additionalProperties":true,"type":"object","title":"Connection Config","default":{}},"outbound_entity_types":{"items":{"type":"string"},"type":"array","title":"Outbound Entity Types","default":[]}},"type":"object","required":["workspace_id","connector_type"],"title":"WorkspaceConnectorConfigResponse","description":"Connector configuration for a workspace."},"WorkspaceDataQueryItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"sql_template":{"type":"string","title":"Sql Template"},"parameters":{"items":{"$ref":"#/components/schemas/StoredParameter"},"type":"array","title":"Parameters"},"timeout_ms":{"type":"integer","title":"Timeout Ms"},"last_invoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Invoked At"},"deployed_at":{"type":"string","format":"date-time","title":"Deployed At"},"deployed_by":{"type":"string","format":"uuid","title":"Deployed By"}},"type":"object","required":["id","name","description","sql_template","parameters","timeout_ms","deployed_at","deployed_by"],"title":"WorkspaceDataQueryItem","description":"Wire shape for the response of every read + create/update handler.\n\n``id`` (UUID) is the stable handle — every URL except list takes it.\n``name`` is the workspace-visible label (UNIQUE per workspace) and is\nstill what the LLM tool registry keys on (``wsq_<name>``), but it is\nnot the route identifier.\n\n``input_schema`` is deliberately NOT exposed — it is fully derivable\nfrom ``parameters[]``. UI consumers can build the JSON Schema view\nlocally if they need it."},"WorkspaceResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"environment":{"type":"string","title":"Environment"},"backend_org_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Backend Org Id"},"region":{"type":"string","title":"Region"},"connector_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Connector Type"},"provisioned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Provisioned At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","slug","name","environment","backend_org_id","region","connector_type","provisioned_at","created_at","updated_at"],"title":"WorkspaceResponse"},"WorldDashboardResponse":{"properties":{"entity_counts":{"$ref":"#/components/schemas/EntityStatsSummary"},"events_24h":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Events 24H","description":"Event count from the Lakebase read model; null when the projection is empty or unavailable."},"events_7d":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Events 7D","description":"Event count from the Lakebase read model; null when the projection is empty or unavailable."},"avg_confidence":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Avg Confidence"},"event_read_model_status":{"type":"string","enum":["ready","empty","unavailable"],"title":"Event Read Model Status","description":"ready = Lakebase projection returned a row; empty = no summary row; unavailable = read failed.","default":"empty"},"event_read_model_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Event Read Model Synced At","description":"platform.event_velocity_summary synced_at for this workspace."},"sources":{"items":{"$ref":"#/components/schemas/SourceBreakdownItem"},"type":"array","maxItems":500,"title":"Sources"}},"type":"object","required":["entity_counts"],"title":"WorldDashboardResponse"},"WrapUpRequest":{"properties":{"call_sid":{"type":"string","maxLength":64,"minLength":1,"title":"Call Sid"},"outcome":{"type":"string","enum":["resolved","escalated","transferred"],"title":"Outcome"},"notes":{"type":"string","maxLength":2000,"title":"Notes","default":""}},"type":"object","required":["call_sid","outcome"],"title":"WrapUpRequest","description":"Request to record operator intervention wrap-up."},"WrapUpResponse":{"properties":{"success":{"type":"boolean","title":"Success"}},"type":"object","required":["success"],"title":"WrapUpResponse"},"_DayHours":{"properties":{"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","title":"Start"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$","title":"End"}},"type":"object","required":["start","end"],"title":"_DayHours","description":"Open-hours window for one weekday. Times in 24h ``HH:MM`` form,\ninterpreted in the rule set's ``timezone``."},"_SortField":{"type":"string","const":"deployed_at"},"_ToolMockKey":{"type":"string","maxLength":128,"minLength":1},"_ToolMockValue":{"type":"string","maxLength":16384},"platform_lib__platform_functions__models__Parameter":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Name"},"type":{"type":"string","enum":["string","integer","number","boolean"],"title":"Type"},"description":{"type":"string","maxLength":512,"minLength":1,"title":"Description"},"default":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"type":"null"}],"title":"Default"}},"additionalProperties":false,"type":"object","required":["name","type","description"],"title":"Parameter","description":"Typed declaration of one input parameter.\n\nFor SQL function types, ``name`` becomes the ``:name`` placeholder\nin the SQL template. For Python function types, ``name`` becomes\nthe positional argument name in ``def main(...)`` and the input\ncolumn name on the UC UDF signature.\n\nThe ``description`` propagates into the LLM tool spec (this is\nwhat Databricks' Agent Framework reads, and what Anthropic's\ntool-use spec exposes to the model). Missing descriptions\nsilently break tool selection — the registration layer rejects\nempty strings."},"src__models__IntegrationToolRef":{"properties":{"integration":{"type":"string","title":"Integration"},"endpoint":{"type":"string","title":"Endpoint"}},"type":"object","required":["integration","endpoint"],"title":"IntegrationToolRef","description":"Reference to an integration endpoint by integration + endpoint name."},"src__models__StaticToolDef":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema"}},"type":"object","required":["name","description","input_schema"],"title":"StaticToolDef","description":"A built-in tool available to companion agents."},"src__routes__audit__AuditEventResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Unique audit event identifier"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id","description":"Workspace that owns this audit event"},"timestamp":{"type":"string","title":"Timestamp","description":"ISO-8601 timestamp of the event"},"service":{"type":"string","title":"Service","description":"Service that produced the event"},"actor_entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Actor Entity Id","description":"Entity ID of the actor who performed the action"},"actor_credential_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Actor Credential Id","description":"Credential ID used by the actor"},"action":{"type":"string","title":"Action","description":"Action that was performed (e.g. 'entity.read')"},"resource_type":{"type":"string","title":"Resource Type","description":"Type of resource that was accessed"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id","description":"ID of the accessed resource"},"resource_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Name","description":"Human-readable name of the accessed resource"},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address","description":"IP address of the actor"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent","description":"User-Agent header from the request"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Additional event-specific metadata"},"phi_accessed":{"type":"boolean","title":"Phi Accessed","description":"Whether protected health information was accessed","default":false}},"type":"object","required":["id","workspace_id","timestamp","service","action","resource_type"],"title":"AuditEventResponse"},"src__routes__calls__ConversationSummary":{"properties":{"turn_count":{"type":"integer","title":"Turn Count","description":"Total turn count for the call","default":0},"states_visited_count":{"type":"integer","title":"States Visited Count","description":"Number of states visited (including repeats)","default":0},"unique_states":{"type":"integer","title":"Unique States","description":"Number of distinct states visited","default":0},"loop_count":{"type":"integer","title":"Loop Count","description":"Number of detected state loops","default":0},"barge_in_count":{"type":"integer","title":"Barge In Count","description":"Number of caller interruptions","default":0}},"type":"object","title":"ConversationSummary","description":"Conversation flow metrics.\n\nFree-form residual on the raw ``conversation_summary`` JSONB:\n``text_intelligence: dict`` (text-channel intelligence\nsub-payload), and on the simulation path ``transcript_text:\nstr`` (PHI), ``tool_calls: list``, ``score``,\n``score_rationale``, ``terminal_reached``, ``states_visited``.\nNot exposed via this typed shape."},"src__routes__conversations__ConversationSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"channel_kind":{"$ref":"#/components/schemas/ChannelKind"},"status":{"type":"string","enum":["active","closed","completed","in-progress","failed"],"title":"Status"},"lifecycle":{"type":"string","enum":["active","dormant","closed"],"title":"Lifecycle"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"},"turn_count":{"type":"integer","title":"Turn Count","default":0},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid"},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Id"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Quality Score"},"has_recording":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Has Recording"},"completion_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completion Reason"},"escalation_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Escalation Status"},"final_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final State"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"}},"type":"object","required":["id","channel_kind","status","lifecycle","created_at","updated_at"],"title":"ConversationSummary"},"src__routes__integrations__create_endpoint__Request":{"properties":{"name":{"type":"string","maxLength":128,"minLength":2,"pattern":"^[a-z0-9][a-z0-9_-]*[a-z0-9]$","title":"Name","description":"Slug-like identifier, immutable post-create."},"description":{"type":"string","maxLength":2048,"minLength":1,"title":"Description","description":"LLM-facing description shown in the tool definition."},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"],"title":"Method","description":"HTTP method.","default":"POST"},"path":{"type":"string","maxLength":2048,"minLength":1,"pattern":"^[^/]","title":"Path","description":"URL path appended to the integration's base_url. Must NOT start with `/` — the path is\njoined onto the base URL (which already carries the leading slash). Supports `{param}` substitution."},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema","description":"JSON Schema describing the tool's input arguments."},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers","description":"Static headers merged into every request."},"static_body_fields":{"additionalProperties":{"type":"string"},"type":"object","title":"Static Body Fields","description":"Static body fields merged into POST/PUT/PATCH bodies. Keys are RFC 6901 JSON Pointers\n(e.g. ``/meta/tool_name`` for nested, ``/foo`` for a root-level field)."},"body_format":{"type":"string","enum":["json","form"],"title":"Body Format","description":"Outbound body encoding for write methods.","default":"json"},"response_template":{"anyOf":[{"type":"string","maxLength":16384},{"type":"null"}],"title":"Response Template","description":"Jinja template (sandboxed, StrictUndefined) rendered against the parsed JSON response."},"max_response_length":{"type":"integer","maximum":1000000.0,"minimum":0.0,"title":"Max Response Length","description":"Truncate the rendered string to this many chars. 0 = no truncation.","default":0},"timeout_seconds":{"type":"number","maximum":600.0,"exclusiveMinimum":0.0,"title":"Timeout Seconds","description":"Per-request timeout.","default":30.0},"max_retries":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Max Retries","description":"Retry attempts on transient failures.","default":2},"retry_on_status":{"items":{"type":"integer"},"type":"array","maxItems":20,"uniqueItems":true,"title":"Retry On Status","description":"HTTP status codes that trigger a retry."}},"type":"object","required":["name","description","path"],"title":"Request","description":"Add a new endpoint to a REST integration (V186 flat shape)."},"src__routes__integrations__create_integration__Request":{"properties":{"name":{"type":"string","maxLength":128,"minLength":2,"pattern":"^[a-z0-9][a-z0-9_-]*[a-z0-9]$","title":"Name","description":"Slug-like identifier, lowercase alphanumeric + hyphens/underscores. Immutable post-create."},"display_name":{"$ref":"#/components/schemas/NameString","description":"Human-readable name."},"base_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Base Url","description":"Base URL for the upstream REST API."},"auth":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/StaticHeaderAuthRequest"},{"$ref":"#/components/schemas/OAuth2ClientCredentialsAuthRequest"},{"$ref":"#/components/schemas/OAuth2JwtBearerAuthRequest"},{"$ref":"#/components/schemas/CustomTokenExchangeAuthRequest"}],"discriminator":{"propertyName":"type","mapping":{"custom_token_exchange":"#/components/schemas/CustomTokenExchangeAuthRequest","oauth2_client_credentials":"#/components/schemas/OAuth2ClientCredentialsAuthRequest","oauth2_jwt_bearer":"#/components/schemas/OAuth2JwtBearerAuthRequest","static_header":"#/components/schemas/StaticHeaderAuthRequest"}}},{"type":"null"}],"title":"Auth","description":"Auth configuration. When set, ``secret_value`` is required."},"secret_value":{"anyOf":[{"type":"string","maxLength":8192,"minLength":1},{"type":"null"}],"title":"Secret Value","description":"Inline secret literal — auto-provisioned to the per-integration SSM path.\nRequired when ``auth`` is set. Bounded to fit a PEM RSA-4096 key + cert chain."},"enabled":{"type":"boolean","title":"Enabled","description":"Whether the integration is active on create.","default":true},"approval_policy":{"type":"string","enum":["none","writes","all"],"title":"Approval Policy","description":"Human-in-the-loop approval gate. ``none`` (default) = no approval\nrequired; ``writes`` = approval required for write-classified endpoints;\n``all`` = approval required for every endpoint.","default":"none"}},"type":"object","required":["name","display_name","base_url"],"title":"Request","description":"Create body — REST only."},"src__routes__integrations__list_endpoints__Response":{"properties":{"items":{"items":{"$ref":"#/components/schemas/EndpointResponse"},"type":"array","title":"Items","description":"The endpoints under this integration."},"has_more":{"type":"boolean","title":"Has More","description":"Whether there are more endpoints to retrieve."},"continuation_token":{"title":"Continuation Token","description":"Opaque token for the next page. Null when there are no more results."}},"type":"object","required":["items","has_more"],"title":"Response"},"src__routes__integrations__list_integrations__Response":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RestIntegrationResponse"},"type":"array","title":"Items","description":"The integrations matching the request filters."},"has_more":{"type":"boolean","title":"Has More","description":"Whether there are more integrations to retrieve."},"continuation_token":{"title":"Continuation Token","description":"Opaque token for the next page. Null when there are no more results."}},"type":"object","required":["items","has_more"],"title":"Response"},"src__routes__integrations__test_endpoint__Request":{"properties":{"params":{"additionalProperties":true,"type":"object","maxProperties":200,"title":"Params","description":"Tool arguments — the endpoint's ``input_schema``-declared inputs (path/query/body)."},"auth_params":{"additionalProperties":true,"type":"object","maxProperties":200,"title":"Auth Params","description":"Caller-supplied values for auth-routed params.\n\nA ``custom_token_exchange`` integration declares ``param_headers`` /\n``param_body_fields`` whose ``param_name`` placeholders are NOT part of the\nendpoint's ``input_schema`` (they feed the pre-flight token exchange, not the\nendpoint call). They never reach the auth renderer through ``params`` alone, so\nthe renderer raised before any HTTP call. Supply them here to exercise the\nexchange end-to-end. Keys here also override matching flat-``params`` keys."}},"type":"object","title":"Request","description":"Inputs to ``POST /{integration_id}/endpoints/{endpoint_id}/test``."},"src__routes__integrations__test_endpoint__Response":{"properties":{"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Status Code","description":"HTTP status code from the upstream call."},"duration_ms":{"type":"number","title":"Duration Ms","description":"Request duration in milliseconds.","default":0},"retries":{"type":"integer","title":"Retries","description":"Number of retry attempts.","default":0},"raw_response":{"title":"Raw Response","description":"Raw response body from the upstream call."},"rendered":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rendered","description":"Response after Jinja `response_template` rendering, pre-truncation."},"final_result":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Result","description":"Final processed result (rendered + truncated to max_response_length)."},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if the request failed."}},"type":"object","title":"Response","description":"Full breadcrumb returned by the test handler."},"src__routes__integrations__update_endpoint__Request":{"properties":{"description":{"type":"string","maxLength":2048,"minLength":1,"title":"Description"},"method":{"type":"string","enum":["GET","POST","PUT","PATCH","DELETE"],"title":"Method"},"path":{"type":"string","maxLength":2048,"minLength":1,"pattern":"^[^/]","title":"Path","description":"URL path appended to the integration's base_url. Must NOT start with `/`."},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema"},"headers":{"additionalProperties":{"type":"string"},"type":"object","title":"Headers"},"static_body_fields":{"additionalProperties":{"type":"string"},"type":"object","title":"Static Body Fields"},"body_format":{"type":"string","enum":["json","form"],"title":"Body Format"},"response_template":{"anyOf":[{"type":"string","maxLength":16384},{"type":"null"}],"title":"Response Template","description":"Jinja template; pass `null` to clear (the only DB-nullable column on this row)."},"max_response_length":{"type":"integer","maximum":1000000.0,"minimum":0.0,"title":"Max Response Length"},"timeout_seconds":{"type":"number","maximum":600.0,"exclusiveMinimum":0.0,"title":"Timeout Seconds"},"max_retries":{"type":"integer","maximum":10.0,"minimum":0.0,"title":"Max Retries"},"retry_on_status":{"items":{"type":"integer"},"type":"array","maxItems":20,"uniqueItems":true,"title":"Retry On Status"}},"type":"object","title":"Request","description":"Patch an existing endpoint (V186 flat shape). ``name`` is immutable."},"src__routes__integrations__update_integration__Request":{"properties":{"display_name":{"$ref":"#/components/schemas/NameString","title":"Display Name","description":"New display name."},"base_url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Base Url","description":"New base URL."},"auth":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/StaticHeaderAuthRequest"},{"$ref":"#/components/schemas/OAuth2ClientCredentialsAuthRequest"},{"$ref":"#/components/schemas/OAuth2JwtBearerAuthRequest"},{"$ref":"#/components/schemas/CustomTokenExchangeAuthRequest"}],"discriminator":{"propertyName":"type","mapping":{"custom_token_exchange":"#/components/schemas/CustomTokenExchangeAuthRequest","oauth2_client_credentials":"#/components/schemas/OAuth2ClientCredentialsAuthRequest","oauth2_jwt_bearer":"#/components/schemas/OAuth2JwtBearerAuthRequest","static_header":"#/components/schemas/StaticHeaderAuthRequest"}}},{"type":"null"}],"title":"Auth","description":"New auth config. Absent ⇒ untouched; null ⇒ clear; value ⇒ replace.\nIndependent of ``secret_value`` — updating ``auth`` alone reuses the\nexisting SSM secret."},"secret_value":{"type":"string","maxLength":8192,"minLength":1,"title":"Secret Value","description":"Rotate the per-integration SSM secret. Absent ⇒ existing secret\nuntouched; value ⇒ overwrite SSM at the canonical path. Explicit\n``null`` is rejected at validation — there is no \"clear the secret\"\noperation (clearing ``auth`` makes the secret unreachable; that's the\nintended clear path)."},"enabled":{"type":"boolean","title":"Enabled","description":"Toggle the integration on/off."},"approval_policy":{"type":"string","enum":["none","writes","all"],"title":"Approval Policy","description":"Change the human-in-the-loop approval gate. ``none`` = no approval\nrequired; ``writes`` = approval required for write-classified endpoints;\n``all`` = approval required for every endpoint. Absent ⇒ untouched."}},"type":"object","title":"Request","description":"PATCH body — each field is sentinel-defaulted; absent ≠ explicit-null."},"src__routes__internal_skills__IntegrationToolRef":{"properties":{"integration":{"type":"string","title":"Integration"},"endpoint":{"type":"string","title":"Endpoint"}},"type":"object","required":["integration","endpoint"],"title":"IntegrationToolRef"},"src__routes__internal_skills__StaticToolDef":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema"}},"type":"object","required":["name","description","input_schema"],"title":"StaticToolDef"},"src__routes__operators_models__AuditEventResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"event_type":{"type":"string","title":"Event Type","description":"Audit event type (e.g. operator.status_change)"},"data":{"additionalProperties":true,"type":"object","title":"Data","description":"Audit payload — shape varies by event_type"},"source":{"type":"string","title":"Source","description":"System that emitted the event"},"ingested_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ingested At","description":"When the event was ingested"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When the event occurred"}},"type":"object","required":["id","workspace_id","event_type","data","source"],"title":"AuditEventResponse"},"src__routes__workspace_data_queries__create_workspace_data_query__Request":{"properties":{"name":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Name"},"description":{"type":"string","maxLength":2048,"minLength":1,"title":"Description"},"sql_template":{"type":"string","maxLength":8192,"minLength":1,"title":"Sql Template"},"parameters":{"items":{"$ref":"#/components/schemas/src__routes__workspace_data_queries__create_workspace_data_query__Request__Parameter"},"type":"array","maxItems":32,"title":"Parameters"},"timeout_ms":{"type":"integer","maximum":30000.0,"minimum":100.0,"title":"Timeout Ms","default":5000}},"additionalProperties":false,"type":"object","required":["name","description","sql_template"],"title":"Request","description":"Create body — the authored shape of a new workspace data query.\n\nThe SQL template + parameters parity check + multi-statement /\nsession-state-command refusal runs inside :meth:`_validate_template`\nso a bad payload surfaces as a Pydantic 422 with the standard wire\nshape — no try/except in the handler."},"src__routes__workspace_data_queries__create_workspace_data_query__Request__Parameter":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Name"},"type":{"type":"string","enum":["string","integer","number","boolean"],"title":"Type"},"description":{"type":"string","maxLength":512,"minLength":1,"title":"Description"},"default":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"type":"null"}],"title":"Default"}},"additionalProperties":false,"type":"object","required":["name","type","description"],"title":"Parameter","description":"Strict write-side validator for one declared parameter."},"src__routes__workspace_data_queries__invoke_workspace_data_query__Request":{"properties":{"input":{"additionalProperties":true,"type":"object","title":"Input","description":"Caller arguments matching the declared parameters."}},"type":"object","title":"Request"},"src__routes__workspace_data_queries__invoke_workspace_data_query__Response":{"properties":{"result":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Result"},"duration_ms":{"type":"number","title":"Duration Ms","default":0.0},"row_count":{"type":"integer","title":"Row Count","default":0}},"type":"object","title":"Response"},"src__routes__workspace_data_queries__list_workspace_data_queries__Response":{"properties":{"items":{"items":{"$ref":"#/components/schemas/src__routes__workspace_data_queries__list_workspace_data_queries__Response__Item"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"Response"},"src__routes__workspace_data_queries__list_workspace_data_queries__Response__Item":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"sql_template":{"type":"string","title":"Sql Template"},"parameter_count":{"type":"integer","title":"Parameter Count"},"timeout_ms":{"type":"integer","title":"Timeout Ms"},"last_invoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Invoked At"},"deployed_at":{"type":"string","format":"date-time","title":"Deployed At"},"deployed_by":{"type":"string","format":"uuid","title":"Deployed By"}},"type":"object","required":["id","name","description","sql_template","parameter_count","timeout_ms","deployed_at","deployed_by"],"title":"Item"},"src__routes__workspace_data_queries__update_workspace_data_query__Request":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string","maxLength":2048,"minLength":1},{"type":"null"}],"title":"Description"},"sql_template":{"anyOf":[{"type":"string","maxLength":8192,"minLength":1},{"type":"null"}],"title":"Sql Template"},"parameters":{"anyOf":[{"items":{"$ref":"#/components/schemas/src__routes__workspace_data_queries__update_workspace_data_query__Request__Parameter"},"type":"array","maxItems":32},{"type":"null"}],"title":"Parameters"},"timeout_ms":{"anyOf":[{"type":"integer","maximum":30000.0,"minimum":100.0},{"type":"null"}],"title":"Timeout Ms"}},"additionalProperties":false,"type":"object","title":"Request","description":"PATCH body — every field optional. Present ⇒ overwrite; absent ⇒ keep."},"src__routes__workspace_data_queries__update_workspace_data_query__Request__Parameter":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9_]*$","title":"Name"},"type":{"type":"string","enum":["string","integer","number","boolean"],"title":"Type"},"description":{"type":"string","maxLength":512,"minLength":1,"title":"Description"},"default":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"number"},{"type":"boolean"},{"type":"null"}],"title":"Default"}},"additionalProperties":false,"type":"object","required":["name","type","description"],"title":"Parameter","description":"Strict write-side validator for one declared parameter."},"src__routes__workspace_tables__create_workspace_table__Request":{"properties":{"table_name":{"$ref":"#/components/schemas/IdentifierString"},"columns":{"items":{"$ref":"#/components/schemas/Column-Input"},"type":"array","maxItems":100,"minItems":1,"title":"Columns"},"primary_key":{"anyOf":[{"items":{"$ref":"#/components/schemas/IdentifierString"},"type":"array"},{"type":"null"}],"title":"Primary Key"},"unique":{"items":{"items":{"$ref":"#/components/schemas/IdentifierString"},"type":"array","maxItems":32,"minItems":1},"type":"array","title":"Unique"},"indexes":{"items":{"$ref":"#/components/schemas/Index-Input"},"type":"array","title":"Indexes"}},"type":"object","required":["table_name","columns"],"title":"Request"},"src__routes__workspace_tables__create_workspace_table__Response":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"table_name":{"type":"string","title":"Table Name"},"physical_name":{"type":"string","title":"Physical Name"}},"type":"object","required":["id","workspace_id","table_name","physical_name"],"title":"Response"},"src__routes__workspace_tables__execute_workspace_query__Request":{"properties":{"sql":{"type":"string","maxLength":16384,"minLength":1,"title":"Sql","description":"One SQL statement: SELECT / WITH ... SELECT / INSERT / UPDATE /\nDELETE. Multi-statement, DDL, and session-state commands (SET ROLE,\nRESET, SET SESSION AUTHORIZATION) reject with 422 at the Pydantic\nboundary. ``pg_*`` function calls reject with 400 at execute time\n(no grant)."}},"type":"object","required":["sql"],"title":"Request"},"src__routes__workspace_tables__execute_workspace_query__Response":{"properties":{"columns":{"items":{"type":"string"},"type":"array","title":"Columns"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows"},"row_count":{"type":"integer","title":"Row Count"}},"type":"object","required":["columns","rows","row_count"],"title":"Response"},"src__routes__workspace_tables__get_workspace_table__Response":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"table_name":{"type":"string","title":"Table Name"},"physical_name":{"type":"string","title":"Physical Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"columns":{"items":{"$ref":"#/components/schemas/Column-Output"},"type":"array","title":"Columns"},"indexes":{"items":{"$ref":"#/components/schemas/Index-Output"},"type":"array","title":"Indexes"},"constraints":{"items":{"$ref":"#/components/schemas/Constraint"},"type":"array","title":"Constraints"}},"type":"object","required":["id","workspace_id","table_name","physical_name","created_at","columns","indexes","constraints"],"title":"Response"},"src__routes__workspace_tables__list_workspace_tables__Response":{"properties":{"items":{"items":{"$ref":"#/components/schemas/src__routes__workspace_tables__list_workspace_tables__Response__Item"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"Response"},"src__routes__workspace_tables__list_workspace_tables__Response__Item":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"table_name":{"type":"string","title":"Table Name"},"physical_name":{"type":"string","title":"Physical Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","workspace_id","table_name","physical_name","created_at"],"title":"Item"},"src__routes__workspace_tables__update_workspace_table__Request":{"properties":{"actions":{"items":{"oneOf":[{"$ref":"#/components/schemas/AlterAction"}],"discriminator":{"propertyName":"op","mapping":{"add_column":"#/components/schemas/AlterAction","add_index":"#/components/schemas/AlterAction","add_unique":"#/components/schemas/AlterAction","change_column_type":"#/components/schemas/AlterAction","drop_column":"#/components/schemas/AlterAction","drop_column_default":"#/components/schemas/AlterAction","drop_constraint":"#/components/schemas/AlterAction","drop_index":"#/components/schemas/AlterAction","rename_column":"#/components/schemas/AlterAction","set_column_default":"#/components/schemas/AlterAction","set_column_nullable":"#/components/schemas/AlterAction"}}},"type":"array","maxItems":50,"minItems":1,"title":"Actions"}},"type":"object","required":["actions"],"title":"Request"},"src__routes__workspace_tables__update_workspace_table__Response":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"table_name":{"type":"string","title":"Table Name"},"physical_name":{"type":"string","title":"Physical Name"}},"type":"object","required":["id","workspace_id","table_name","physical_name"],"title":"Response"},"CallEndedEvent":{"properties":{"event_type":{"const":"call.ended","default":"call.ended","title":"Event Type","type":"string"},"call_sid":{"title":"Call Sid","type":"string"},"direction":{"enum":["inbound","outbound","playground","simulated","test"],"title":"Direction","type":"string"},"duration_seconds":{"title":"Duration Seconds","type":"number"},"completion_reason":{"enum":["completed","abandoned","escalated","transferred","timeout","error","voicemail","no_answer","caller_hangup","forwarded","terminal_state","warm_transfer_completed","no_inbound_audio","cancelled"],"title":"Completion Reason","type":"string"},"escalated":{"default":false,"title":"Escalated","type":"boolean"}},"required":["call_sid","direction","duration_seconds","completion_reason"],"title":"CallEndedEvent","type":"object"},"CallEscalatedEvent":{"properties":{"event_type":{"const":"call.escalated","default":"call.escalated","title":"Event Type","type":"string"},"call_sid":{"title":"Call Sid","type":"string"},"escalation_id":{"title":"Escalation Id","type":"string"},"trigger":{"enum":["caller","ai","operator"],"title":"Trigger","type":"string"},"reason":{"title":"Reason","type":"string"}},"required":["call_sid","escalation_id","trigger","reason"],"title":"CallEscalatedEvent","type":"object"},"CallStartedEvent":{"properties":{"event_type":{"const":"call.started","default":"call.started","title":"Event Type","type":"string"},"call_sid":{"title":"Call Sid","type":"string"},"direction":{"enum":["inbound","outbound","playground","simulated","test"],"title":"Direction","type":"string"},"service_id":{"format":"uuid","title":"Service Id","type":"string"},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Caller Id","x-phi":true}},"required":["call_sid","direction","service_id"],"title":"CallStartedEvent","type":"object"},"ChannelEmailBouncedEvent":{"properties":{"event_type":{"const":"channel.email_bounced","default":"channel.email_bounced","title":"Event Type","type":"string"},"email_id":{"title":"Email Id","type":"string"},"to_address":{"title":"To Address","type":"string","x-phi":true},"from_address":{"title":"From Address","type":"string"},"bounce_type":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Bounce Type"},"bounce_subtype":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Bounce Subtype"}},"required":["email_id","to_address","from_address"],"title":"ChannelEmailBouncedEvent","type":"object"},"ChannelEmailClickedEvent":{"properties":{"event_type":{"const":"channel.email_clicked","default":"channel.email_clicked","title":"Event Type","type":"string"},"email_id":{"title":"Email Id","type":"string"},"to_address":{"title":"To Address","type":"string","x-phi":true}},"required":["email_id","to_address"],"title":"ChannelEmailClickedEvent","type":"object"},"ChannelEmailComplainedEvent":{"properties":{"event_type":{"const":"channel.email_complained","default":"channel.email_complained","title":"Event Type","type":"string"},"email_id":{"title":"Email Id","type":"string"},"to_address":{"title":"To Address","type":"string","x-phi":true},"from_address":{"title":"From Address","type":"string"}},"required":["email_id","to_address","from_address"],"title":"ChannelEmailComplainedEvent","type":"object"},"ChannelEmailDelayedEvent":{"properties":{"event_type":{"const":"channel.email_delayed","default":"channel.email_delayed","title":"Event Type","type":"string"},"email_id":{"title":"Email Id","type":"string"},"to_address":{"title":"To Address","type":"string","x-phi":true},"from_address":{"title":"From Address","type":"string"}},"required":["email_id","to_address","from_address"],"title":"ChannelEmailDelayedEvent","type":"object"},"ChannelEmailDeliveredEvent":{"properties":{"event_type":{"const":"channel.email_delivered","default":"channel.email_delivered","title":"Event Type","type":"string"},"email_id":{"title":"Email Id","type":"string"},"to_address":{"title":"To Address","type":"string","x-phi":true},"from_address":{"title":"From Address","type":"string"}},"required":["email_id","to_address","from_address"],"title":"ChannelEmailDeliveredEvent","type":"object"},"ChannelEmailOpenedEvent":{"properties":{"event_type":{"const":"channel.email_opened","default":"channel.email_opened","title":"Event Type","type":"string"},"email_id":{"title":"Email Id","type":"string"},"to_address":{"title":"To Address","type":"string","x-phi":true}},"required":["email_id","to_address"],"title":"ChannelEmailOpenedEvent","type":"object"},"ChannelEmailReceivedEvent":{"description":"Inbound email persisted to channel.inbound_emails as a reply to one of\nour outbound sends. ``in_reply_to_email_id`` is the outbound row this\ninbound threads against.","properties":{"event_type":{"const":"channel.email_received","default":"channel.email_received","title":"Event Type","type":"string"},"inbound_email_id":{"title":"Inbound Email Id","type":"string"},"in_reply_to_email_id":{"title":"In Reply To Email Id","type":"string"},"from_address":{"title":"From Address","type":"string","x-phi":true},"to_address":{"title":"To Address","type":"string","x-phi":true},"subject":{"title":"Subject","type":"string"}},"required":["inbound_email_id","in_reply_to_email_id","from_address","to_address","subject"],"title":"ChannelEmailReceivedEvent","type":"object"},"ChannelEmailRejectedEvent":{"properties":{"event_type":{"const":"channel.email_rejected","default":"channel.email_rejected","title":"Event Type","type":"string"},"email_id":{"title":"Email Id","type":"string"},"to_address":{"title":"To Address","type":"string","x-phi":true},"from_address":{"title":"From Address","type":"string"}},"required":["email_id","to_address","from_address"],"title":"ChannelEmailRejectedEvent","type":"object"},"ChannelVoicemailStatusEvent":{"description":"Ringless voicemail status callback projected from VoiceDrop. ``status``\nmirrors the channel.voicedrop_ringless_voicemails enum: delivered,\nskipped, failed, or not_delivered (pending is the row's initial state and\nis never emitted as an event).","properties":{"event_type":{"const":"channel.voicemail_status","default":"channel.voicemail_status","title":"Event Type","type":"string"},"voicemail_id":{"format":"uuid","title":"Voicemail Id","type":"string"},"status":{"enum":["delivered","skipped","failed","not_delivered"],"title":"Status","type":"string"},"recipient_phone_number":{"title":"Recipient Phone Number","type":"string","x-phi":true}},"required":["voicemail_id","status","recipient_phone_number"],"title":"ChannelVoicemailStatusEvent","type":"object"},"EncounterUpdatedEvent":{"properties":{"event_type":{"const":"encounter.updated","default":"encounter.updated","title":"Event Type","type":"string"},"encounter_entity_id":{"format":"uuid","title":"Encounter Entity Id","type":"string"},"session_id":{"title":"Session Id","type":"string"}},"required":["encounter_entity_id","session_id"],"title":"EncounterUpdatedEvent","type":"object"},"IntegrationApprovalGrantedEvent":{"properties":{"event_type":{"const":"integration.approval_granted","default":"integration.approval_granted","title":"Event Type","type":"string"},"conversation_id":{"maxLength":256,"minLength":1,"title":"Conversation Id","type":"string"}},"required":["conversation_id"],"title":"IntegrationApprovalGrantedEvent","type":"object"},"IntegrationApprovalRejectedEvent":{"properties":{"event_type":{"const":"integration.approval_rejected","default":"integration.approval_rejected","title":"Event Type","type":"string"},"conversation_id":{"maxLength":256,"minLength":1,"title":"Conversation Id","type":"string"},"reason":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["conversation_id"],"title":"IntegrationApprovalRejectedEvent","type":"object"},"NarrativeUpdatedEvent":{"properties":{"event_type":{"const":"self_image.brief_generated","default":"self_image.brief_generated","title":"Event Type","type":"string"},"target_entity_id":{"format":"uuid","title":"Target Entity Id","type":"string"},"target_entity_type":{"title":"Target Entity Type","type":"string"},"event_id":{"format":"uuid","title":"Event Id","type":"string"},"version":{"title":"Version","type":"string"},"confidence":{"title":"Confidence","type":"number"},"event_count":{"title":"Event Count","type":"integer"}},"required":["target_entity_id","target_entity_type","event_id","version","confidence","event_count"],"title":"NarrativeUpdatedEvent","type":"object"},"OperatorJoinedCallEvent":{"properties":{"event_type":{"const":"operator.joined_call","default":"operator.joined_call","title":"Event Type","type":"string"},"call_sid":{"title":"Call Sid","type":"string"},"operator_id":{"format":"uuid","title":"Operator Id","type":"string"},"mode":{"enum":["listen","takeover"],"title":"Mode","type":"string"}},"required":["call_sid","operator_id","mode"],"title":"OperatorJoinedCallEvent","type":"object"},"OperatorLeftCallEvent":{"properties":{"event_type":{"const":"operator.left_call","default":"operator.left_call","title":"Event Type","type":"string"},"call_sid":{"title":"Call Sid","type":"string"},"operator_id":{"format":"uuid","title":"Operator Id","type":"string"},"human_segment_turn_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Human Segment Turn Count"}},"required":["call_sid","operator_id"],"title":"OperatorLeftCallEvent","type":"object"},"OperatorModeChangedEvent":{"properties":{"event_type":{"const":"operator.mode_changed","default":"operator.mode_changed","title":"Event Type","type":"string"},"call_sid":{"title":"Call Sid","type":"string"},"operator_id":{"format":"uuid","title":"Operator Id","type":"string"},"mode":{"enum":["listen","takeover"],"title":"Mode","type":"string"}},"required":["call_sid","operator_id","mode"],"title":"OperatorModeChangedEvent","type":"object"},"OperatorProfileUpdatedEvent":{"properties":{"event_type":{"const":"operator.profile_updated","default":"operator.profile_updated","title":"Event Type","type":"string"},"operator_id":{"format":"uuid","title":"Operator Id","type":"string"},"changes":{"anyOf":[{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object"},{"type":"null"}],"default":null,"title":"Changes"}},"required":["operator_id"],"title":"OperatorProfileUpdatedEvent","type":"object"},"OperatorRegisteredEvent":{"properties":{"event_type":{"const":"operator.registered","default":"operator.registered","title":"Event Type","type":"string"},"operator_id":{"format":"uuid","title":"Operator Id","type":"string"},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Timestamp"}},"required":["operator_id"],"title":"OperatorRegisteredEvent","type":"object"},"OperatorStatusChangedEvent":{"properties":{"event_type":{"const":"operator.status_changed","default":"operator.status_changed","title":"Event Type","type":"string"},"operator_id":{"format":"uuid","title":"Operator Id","type":"string"},"status":{"enum":["online","busy","offline"],"title":"Status","type":"string"}},"required":["operator_id","status"],"title":"OperatorStatusChangedEvent","type":"object"},"OperatorWrapUpEvent":{"properties":{"event_type":{"const":"operator.wrap_up","default":"operator.wrap_up","title":"Event Type","type":"string"},"call_sid":{"title":"Call Sid","type":"string"},"wrap_up_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Wrap Up Reason"}},"required":["call_sid"],"title":"OperatorWrapUpEvent","type":"object"},"PipelineErrorEvent":{"properties":{"event_type":{"const":"pipeline.error","default":"pipeline.error","title":"Event Type","type":"string"},"data_source_id":{"format":"uuid","title":"Data Source Id","type":"string"},"error":{"title":"Error","type":"string"}},"required":["data_source_id","error"],"title":"PipelineErrorEvent","type":"object"},"PipelineSyncCompletedEvent":{"properties":{"event_type":{"const":"pipeline.sync_completed","default":"pipeline.sync_completed","title":"Event Type","type":"string"},"data_source_id":{"format":"uuid","title":"Data Source Id","type":"string"},"event_count":{"title":"Event Count","type":"integer"},"duration_ms":{"title":"Duration Ms","type":"integer"}},"required":["data_source_id","event_count","duration_ms"],"title":"PipelineSyncCompletedEvent","type":"object"},"ReviewSubmittedEvent":{"properties":{"event_type":{"const":"review.submitted","default":"review.submitted","title":"Event Type","type":"string"},"action":{"enum":["approve","reject","correct","batch_approve","batch_reject"],"title":"Action","type":"string"},"item_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Item Id"},"entity_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"default":null,"title":"Entity Id"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Entity Type"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Count"}},"required":["action"],"title":"ReviewSubmittedEvent","type":"object"},"SimulationTurnStoredEvent":{"properties":{"event_type":{"const":"simulation.turn_stored","default":"simulation.turn_stored","title":"Event Type","type":"string"},"service_id":{"format":"uuid","title":"Service Id","type":"string"},"run_id":{"title":"Run Id","type":"string"},"session_id":{"title":"Session Id","type":"string"},"turn_index":{"title":"Turn Index","type":"integer"},"state_before":{"title":"State Before","type":"string"},"state_after":{"title":"State After","type":"string"},"is_terminal":{"title":"Is Terminal","type":"boolean"}},"required":["service_id","run_id","session_id","turn_index","state_before","state_after","is_terminal"],"title":"SimulationTurnStoredEvent","type":"object"},"SurfaceArchivedEvent":{"properties":{"event_type":{"const":"surface.archived","default":"surface.archived","title":"Event Type","type":"string"},"surface_id":{"format":"uuid","title":"Surface Id","type":"string"}},"required":["surface_id"],"title":"SurfaceArchivedEvent","type":"object"},"SurfaceCreatedEvent":{"properties":{"event_type":{"const":"surface.created","default":"surface.created","title":"Event Type","type":"string"},"surface_id":{"format":"uuid","title":"Surface Id","type":"string"},"entity_id":{"format":"uuid","title":"Entity Id","type":"string"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Channel"},"fields_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Fields Count"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Source"},"form_template_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"default":null,"title":"Form Template Id"},"review_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Review Required"}},"required":["surface_id","entity_id"],"title":"SurfaceCreatedEvent","type":"object"},"SurfaceDeliveredEvent":{"properties":{"event_type":{"const":"surface.delivered","default":"surface.delivered","title":"Event Type","type":"string"},"surface_id":{"format":"uuid","title":"Surface Id","type":"string"},"entity_id":{"format":"uuid","title":"Entity Id","type":"string"},"channel":{"title":"Channel","type":"string"},"channel_address":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Channel Address","x-phi":true},"delivery_status":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Delivery Status"},"message_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Message Id"},"short_url":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Short Url"}},"required":["surface_id","entity_id","channel"],"title":"SurfaceDeliveredEvent","type":"object"},"SurfaceFieldSavedEvent":{"properties":{"event_type":{"const":"surface.field_saved","default":"surface.field_saved","title":"Event Type","type":"string"},"surface_id":{"format":"uuid","title":"Surface Id","type":"string"},"entity_id":{"format":"uuid","title":"Entity Id","type":"string"},"field_key":{"title":"Field Key","type":"string"}},"required":["surface_id","entity_id","field_key"],"title":"SurfaceFieldSavedEvent","type":"object"},"SurfaceOpenedEvent":{"properties":{"event_type":{"const":"surface.opened","default":"surface.opened","title":"Event Type","type":"string"},"surface_id":{"format":"uuid","title":"Surface Id","type":"string"},"entity_id":{"format":"uuid","title":"Entity Id","type":"string"}},"required":["surface_id","entity_id"],"title":"SurfaceOpenedEvent","type":"object"},"SurfacePendingReviewEvent":{"properties":{"event_type":{"const":"surface.pending_review","default":"surface.pending_review","title":"Event Type","type":"string"},"surface_id":{"format":"uuid","title":"Surface Id","type":"string"},"entity_id":{"format":"uuid","title":"Entity Id","type":"string"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Source"},"form_template_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"default":null,"title":"Form Template Id"},"review_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Review Required"}},"required":["surface_id","entity_id"],"title":"SurfacePendingReviewEvent","type":"object"},"SurfaceReshapedEvent":{"properties":{"event_type":{"const":"surface.reshaped","default":"surface.reshaped","title":"Event Type","type":"string"},"surface_id":{"format":"uuid","title":"Surface Id","type":"string"},"original_surface_id":{"format":"uuid","title":"Original Surface Id","type":"string"}},"required":["surface_id","original_surface_id"],"title":"SurfaceReshapedEvent","type":"object"},"SurfaceReviewApprovedEvent":{"properties":{"event_type":{"const":"surface.review_approved","default":"surface.review_approved","title":"Event Type","type":"string"},"surface_id":{"format":"uuid","title":"Surface Id","type":"string"}},"required":["surface_id"],"title":"SurfaceReviewApprovedEvent","type":"object"},"SurfaceReviewRejectedEvent":{"properties":{"event_type":{"const":"surface.review_rejected","default":"surface.review_rejected","title":"Event Type","type":"string"},"surface_id":{"format":"uuid","title":"Surface Id","type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Reason"}},"required":["surface_id"],"title":"SurfaceReviewRejectedEvent","type":"object"},"SurfaceSubmittedEvent":{"properties":{"event_type":{"const":"surface.submitted","default":"surface.submitted","title":"Event Type","type":"string"},"surface_id":{"format":"uuid","title":"Surface Id","type":"string"},"entity_id":{"format":"uuid","title":"Entity Id","type":"string"},"submitted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Submitted At"},"fields_submitted":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"title":"Fields Submitted"}},"required":["surface_id","entity_id"],"title":"SurfaceSubmittedEvent","type":"object"},"SurfaceUpdatedEvent":{"properties":{"event_type":{"const":"surface.updated","default":"surface.updated","title":"Event Type","type":"string"},"surface_id":{"format":"uuid","title":"Surface Id","type":"string"}},"required":["surface_id"],"title":"SurfaceUpdatedEvent","type":"object"},"TextBackgroundResultEvent":{"description":"A background (``execution=\"background\"``) tool finished for a web text\nconversation. Pushed live the instant the completion lands so a subscribed\nclient renders the result without polling or sending another message.\n\n``call_id`` is ``bg:<task_id>`` to match the card identity the next-turn drain\nsurfaces (``build_background_completion_effect``), so a client that receives\nboth the live push and the eventual drained card sees one consistent card.\nWeb-only: ``conversation_id`` is the durable conversation UUID (non-web\nchannels route by a composite key and deliver via their own transport).","properties":{"event_type":{"const":"text.background_result","default":"text.background_result","title":"Event Type","type":"string"},"conversation_id":{"format":"uuid","title":"Conversation Id","type":"string"},"tool_name":{"title":"Tool Name","type":"string"},"call_id":{"title":"Call Id","type":"string"},"succeeded":{"title":"Succeeded","type":"boolean"},"result":{"title":"Result","type":"string"},"depth":{"title":"Depth","type":"integer"},"duration_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Duration Ms"}},"required":["conversation_id","tool_name","call_id","succeeded","result","depth"],"title":"TextBackgroundResultEvent","type":"object"},"TextCompletedEvent":{"properties":{"event_type":{"const":"text.completed","default":"text.completed","title":"Event Type","type":"string"},"session_id":{"title":"Session Id","type":"string"},"duration_seconds":{"title":"Duration Seconds","type":"number"},"turn_count":{"title":"Turn Count","type":"integer"},"completion_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Completion Reason"},"final_state":{"title":"Final State","type":"string"},"channel_kind":{"title":"Channel Kind","type":"string"}},"required":["session_id","duration_seconds","turn_count","final_state","channel_kind"],"title":"TextCompletedEvent","type":"object"},"TextStartedEvent":{"properties":{"event_type":{"const":"text.started","default":"text.started","title":"Event Type","type":"string"},"session_id":{"title":"Session Id","type":"string"},"service_id":{"format":"uuid","title":"Service Id","type":"string"},"channel_kind":{"title":"Channel Kind","type":"string"},"entity_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"default":null,"title":"Entity Id"}},"required":["session_id","service_id","channel_kind"],"title":"TextStartedEvent","type":"object"},"TriggerCompletedEvent":{"properties":{"event_type":{"const":"trigger.completed","default":"trigger.completed","title":"Event Type","type":"string"},"trigger_id":{"format":"uuid","title":"Trigger Id","type":"string"},"trigger_name":{"title":"Trigger Name","type":"string"},"status":{"title":"Status","type":"string"}},"required":["trigger_id","trigger_name","status"],"title":"TriggerCompletedEvent","type":"object"},"TriggerFailedEvent":{"properties":{"event_type":{"const":"trigger.failed","default":"trigger.failed","title":"Event Type","type":"string"},"trigger_id":{"format":"uuid","title":"Trigger Id","type":"string"},"trigger_name":{"title":"Trigger Name","type":"string"},"status":{"title":"Status","type":"string"}},"required":["trigger_id","trigger_name","status"],"title":"TriggerFailedEvent","type":"object"},"TriggerFiredEvent":{"properties":{"event_type":{"const":"trigger.fired","default":"trigger.fired","title":"Event Type","type":"string"},"trigger_id":{"format":"uuid","title":"Trigger Id","type":"string"},"trigger_name":{"title":"Trigger Name","type":"string"},"manual":{"default":false,"title":"Manual","type":"boolean"}},"required":["trigger_id","trigger_name"],"title":"TriggerFiredEvent","type":"object"},"WorkspaceInvitationAcceptedEvent":{"properties":{"event_type":{"const":"workspace.invitation_accepted","default":"workspace.invitation_accepted","title":"Event Type","type":"string"},"entity_id":{"format":"uuid","title":"Entity Id","type":"string"},"role":{"title":"Role","type":"string"}},"required":["entity_id","role"],"title":"WorkspaceInvitationAcceptedEvent","type":"object"},"WorkspaceInvitationSentEvent":{"properties":{"event_type":{"const":"workspace.invitation_sent","default":"workspace.invitation_sent","title":"Event Type","type":"string"},"invitation_id":{"title":"Invitation Id","type":"string"},"role":{"title":"Role","type":"string"},"resent":{"default":false,"title":"Resent","type":"boolean"}},"required":["invitation_id","role"],"title":"WorkspaceInvitationSentEvent","type":"object"},"WorkspaceMemberAddedEvent":{"properties":{"event_type":{"const":"workspace.member_added","default":"workspace.member_added","title":"Event Type","type":"string"},"entity_id":{"format":"uuid","title":"Entity Id","type":"string"},"role":{"title":"Role","type":"string"}},"required":["entity_id","role"],"title":"WorkspaceMemberAddedEvent","type":"object"},"WorkspaceMemberRoleUpdatedEvent":{"properties":{"event_type":{"const":"workspace.member_role_updated","default":"workspace.member_role_updated","title":"Event Type","type":"string"},"entity_id":{"format":"uuid","title":"Entity Id","type":"string"},"role":{"title":"Role","type":"string"},"previous_role":{"title":"Previous Role","type":"string"}},"required":["entity_id","role","previous_role"],"title":"WorkspaceMemberRoleUpdatedEvent","type":"object"},"WorkspaceSSEEvent":{"discriminator":{"mapping":{"call.ended":"#/components/schemas/CallEndedEvent","call.escalated":"#/components/schemas/CallEscalatedEvent","call.started":"#/components/schemas/CallStartedEvent","channel.email_bounced":"#/components/schemas/ChannelEmailBouncedEvent","channel.email_clicked":"#/components/schemas/ChannelEmailClickedEvent","channel.email_complained":"#/components/schemas/ChannelEmailComplainedEvent","channel.email_delayed":"#/components/schemas/ChannelEmailDelayedEvent","channel.email_delivered":"#/components/schemas/ChannelEmailDeliveredEvent","channel.email_opened":"#/components/schemas/ChannelEmailOpenedEvent","channel.email_received":"#/components/schemas/ChannelEmailReceivedEvent","channel.email_rejected":"#/components/schemas/ChannelEmailRejectedEvent","channel.voicemail_status":"#/components/schemas/ChannelVoicemailStatusEvent","encounter.updated":"#/components/schemas/EncounterUpdatedEvent","integration.approval_granted":"#/components/schemas/IntegrationApprovalGrantedEvent","integration.approval_rejected":"#/components/schemas/IntegrationApprovalRejectedEvent","operator.joined_call":"#/components/schemas/OperatorJoinedCallEvent","operator.left_call":"#/components/schemas/OperatorLeftCallEvent","operator.mode_changed":"#/components/schemas/OperatorModeChangedEvent","operator.profile_updated":"#/components/schemas/OperatorProfileUpdatedEvent","operator.registered":"#/components/schemas/OperatorRegisteredEvent","operator.status_changed":"#/components/schemas/OperatorStatusChangedEvent","operator.wrap_up":"#/components/schemas/OperatorWrapUpEvent","pipeline.error":"#/components/schemas/PipelineErrorEvent","pipeline.sync_completed":"#/components/schemas/PipelineSyncCompletedEvent","review.submitted":"#/components/schemas/ReviewSubmittedEvent","self_image.brief_generated":"#/components/schemas/NarrativeUpdatedEvent","simulation.turn_stored":"#/components/schemas/SimulationTurnStoredEvent","surface.archived":"#/components/schemas/SurfaceArchivedEvent","surface.created":"#/components/schemas/SurfaceCreatedEvent","surface.delivered":"#/components/schemas/SurfaceDeliveredEvent","surface.field_saved":"#/components/schemas/SurfaceFieldSavedEvent","surface.opened":"#/components/schemas/SurfaceOpenedEvent","surface.pending_review":"#/components/schemas/SurfacePendingReviewEvent","surface.reshaped":"#/components/schemas/SurfaceReshapedEvent","surface.review_approved":"#/components/schemas/SurfaceReviewApprovedEvent","surface.review_rejected":"#/components/schemas/SurfaceReviewRejectedEvent","surface.submitted":"#/components/schemas/SurfaceSubmittedEvent","surface.updated":"#/components/schemas/SurfaceUpdatedEvent","text.background_result":"#/components/schemas/TextBackgroundResultEvent","text.completed":"#/components/schemas/TextCompletedEvent","text.started":"#/components/schemas/TextStartedEvent","trigger.completed":"#/components/schemas/TriggerCompletedEvent","trigger.failed":"#/components/schemas/TriggerFailedEvent","trigger.fired":"#/components/schemas/TriggerFiredEvent","workspace.invitation_accepted":"#/components/schemas/WorkspaceInvitationAcceptedEvent","workspace.invitation_sent":"#/components/schemas/WorkspaceInvitationSentEvent","workspace.member_added":"#/components/schemas/WorkspaceMemberAddedEvent","workspace.member_role_updated":"#/components/schemas/WorkspaceMemberRoleUpdatedEvent"},"propertyName":"event_type"},"oneOf":[{"$ref":"#/components/schemas/CallStartedEvent"},{"$ref":"#/components/schemas/CallEndedEvent"},{"$ref":"#/components/schemas/CallEscalatedEvent"},{"$ref":"#/components/schemas/EncounterUpdatedEvent"},{"$ref":"#/components/schemas/NarrativeUpdatedEvent"},{"$ref":"#/components/schemas/ReviewSubmittedEvent"},{"$ref":"#/components/schemas/SimulationTurnStoredEvent"},{"$ref":"#/components/schemas/SurfaceCreatedEvent"},{"$ref":"#/components/schemas/SurfaceDeliveredEvent"},{"$ref":"#/components/schemas/SurfaceUpdatedEvent"},{"$ref":"#/components/schemas/SurfaceArchivedEvent"},{"$ref":"#/components/schemas/SurfaceReshapedEvent"},{"$ref":"#/components/schemas/SurfaceSubmittedEvent"},{"$ref":"#/components/schemas/SurfaceFieldSavedEvent"},{"$ref":"#/components/schemas/SurfaceOpenedEvent"},{"$ref":"#/components/schemas/SurfacePendingReviewEvent"},{"$ref":"#/components/schemas/SurfaceReviewApprovedEvent"},{"$ref":"#/components/schemas/SurfaceReviewRejectedEvent"},{"$ref":"#/components/schemas/IntegrationApprovalGrantedEvent"},{"$ref":"#/components/schemas/IntegrationApprovalRejectedEvent"},{"$ref":"#/components/schemas/TextStartedEvent"},{"$ref":"#/components/schemas/TextCompletedEvent"},{"$ref":"#/components/schemas/TextBackgroundResultEvent"},{"$ref":"#/components/schemas/TriggerFiredEvent"},{"$ref":"#/components/schemas/TriggerCompletedEvent"},{"$ref":"#/components/schemas/TriggerFailedEvent"},{"$ref":"#/components/schemas/PipelineSyncCompletedEvent"},{"$ref":"#/components/schemas/PipelineErrorEvent"},{"$ref":"#/components/schemas/OperatorRegisteredEvent"},{"$ref":"#/components/schemas/OperatorStatusChangedEvent"},{"$ref":"#/components/schemas/OperatorProfileUpdatedEvent"},{"$ref":"#/components/schemas/OperatorJoinedCallEvent"},{"$ref":"#/components/schemas/OperatorLeftCallEvent"},{"$ref":"#/components/schemas/OperatorModeChangedEvent"},{"$ref":"#/components/schemas/OperatorWrapUpEvent"},{"$ref":"#/components/schemas/WorkspaceMemberAddedEvent"},{"$ref":"#/components/schemas/WorkspaceMemberRoleUpdatedEvent"},{"$ref":"#/components/schemas/WorkspaceInvitationSentEvent"},{"$ref":"#/components/schemas/WorkspaceInvitationAcceptedEvent"},{"$ref":"#/components/schemas/ChannelEmailDeliveredEvent"},{"$ref":"#/components/schemas/ChannelEmailBouncedEvent"},{"$ref":"#/components/schemas/ChannelEmailComplainedEvent"},{"$ref":"#/components/schemas/ChannelEmailRejectedEvent"},{"$ref":"#/components/schemas/ChannelEmailDelayedEvent"},{"$ref":"#/components/schemas/ChannelEmailOpenedEvent"},{"$ref":"#/components/schemas/ChannelEmailClickedEvent"},{"$ref":"#/components/schemas/ChannelEmailReceivedEvent"},{"$ref":"#/components/schemas/ChannelVoicemailStatusEvent"}]},"AgentTranscriptDeltaEvent":{"properties":{"type":{"const":"agent_transcript_delta","default":"agent_transcript_delta","title":"Type","type":"string"},"delta":{"title":"Delta","type":"string","x-phi":true}},"required":["delta"],"title":"AgentTranscriptDeltaEvent","type":"object"},"AgentTranscriptEvent":{"properties":{"type":{"const":"agent_transcript","default":"agent_transcript","title":"Type","type":"string"},"transcript":{"title":"Transcript","type":"string","x-phi":true},"action":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Action"},"interrupted":{"default":false,"title":"Interrupted","type":"boolean"},"filler_type":{"anyOf":[{"enum":["empathy","receipt","working"],"type":"string"},{"type":"null"}],"default":null,"title":"Filler Type"},"speaker_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Speaker Id"},"speaker_role":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Speaker Role"},"streaming":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Streaming"}},"required":["transcript"],"title":"AgentTranscriptEvent","type":"object"},"CompoundEmotionEvent":{"properties":{"type":{"const":"compound_emotion","default":"compound_emotion","title":"Type","type":"string"},"compounds":{"items":{"$ref":"#/components/schemas/EmotionScore"},"title":"Compounds","type":"array"},"turn_index":{"title":"Turn Index","type":"integer"}},"required":["compounds","turn_index"],"title":"CompoundEmotionEvent","type":"object"},"EmotionEvent":{"properties":{"type":{"const":"emotion","default":"emotion","title":"Type","type":"string"},"dominant":{"title":"Dominant","type":"string"},"valence":{"title":"Valence","type":"number"},"arousal":{"title":"Arousal","type":"number"},"barge_in_count":{"default":0,"title":"Barge In Count","type":"integer"},"trend":{"anyOf":[{"enum":["improving","stable","deteriorating"],"type":"string"},{"type":"null"}],"default":null,"title":"Trend"},"coherence":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Coherence"},"segment_dominant":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Segment Dominant"},"segment_valence":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Segment Valence"},"segment_arousal":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Segment Arousal"},"dominance":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Dominance"},"scores":{"anyOf":[{"items":{"$ref":"#/components/schemas/EmotionScore"},"type":"array"},{"type":"null"}],"default":null,"title":"Scores"},"language_sentiment":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Language Sentiment"},"language_toxicity":{"anyOf":[{"additionalProperties":{"type":"number"},"type":"object"},{"type":"null"}],"default":null,"title":"Language Toxicity"},"speaker":{"anyOf":[{"$ref":"#/components/schemas/SpeakerAcoustics"},{"type":"null"}],"default":null},"total_segments":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Total Segments"},"emotional_shifts":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Emotional Shifts"},"call_duration_s":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Call Duration S"},"turn_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Turn Count"},"verified_speaker_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Verified Speaker Id","x-phi":true},"speaker_similarity":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Speaker Similarity"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Provider"}},"required":["dominant","valence","arousal"],"title":"EmotionEvent","type":"object"},"EmotionScore":{"properties":{"name":{"title":"Name","type":"string"},"score":{"title":"Score","type":"number"}},"required":["name","score"],"title":"EmotionScore","type":"object"},"EmpathyClassifiedEvent":{"properties":{"type":{"const":"empathy_classified","default":"empathy_classified","title":"Type","type":"string"},"tier":{"title":"Tier","type":"integer"},"tier_name":{"enum":["FUNCTIONAL","LIGHT_TOUCH","FULL_EMPATHY","HOLD_SPACE"],"title":"Tier Name","type":"string"},"should_pause":{"title":"Should Pause","type":"boolean"},"suppress_filler":{"title":"Suppress Filler","type":"boolean"},"filler_type":{"enum":["empathy","receipt","working"],"title":"Filler Type","type":"string"},"empathy_baseline":{"title":"Empathy Baseline","type":"number"}},"required":["tier","tier_name","should_pause","suppress_filler","filler_type","empathy_baseline"],"title":"EmpathyClassifiedEvent","type":"object"},"ForwardCallResolvedEvent":{"properties":{"type":{"const":"forward_call_resolved","default":"forward_call_resolved","title":"Type","type":"string"},"target_number":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Target Number","x-phi":true},"location_name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Location Name"},"result":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Error"}},"title":"ForwardCallResolvedEvent","type":"object"},"LatencyEvent":{"properties":{"type":{"const":"latency","default":"latency","title":"Type","type":"string"},"e2e_ttfb_ms":{"title":"E2E Ttfb Ms","type":"number"},"engine_ms":{"title":"Engine Ms","type":"number"},"nav_ms":{"title":"Nav Ms","type":"number"},"render_ms":{"title":"Render Ms","type":"number"},"audio_ttfb_ms":{"title":"Audio Ttfb Ms","type":"number"},"continuation":{"title":"Continuation","type":"boolean"},"is_greeting":{"default":false,"title":"Is Greeting","type":"boolean"}},"required":["e2e_ttfb_ms","engine_ms","nav_ms","render_ms","audio_ttfb_ms","continuation"],"title":"LatencyEvent","type":"object"},"NavTimingEvent":{"properties":{"type":{"const":"nav_timing","default":"nav_timing","title":"Type","type":"string"},"nav_ms":{"title":"Nav Ms","type":"number"},"render_ms":{"title":"Render Ms","type":"number"},"total_ms":{"title":"Total Ms","type":"number"},"input_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Input Tokens"},"output_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Output Tokens"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Model"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"State"},"retry_attempts":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Retry Attempts"},"used_fallback":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Used Fallback"},"selected_action":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Selected Action"}},"required":["nav_ms","render_ms","total_ms"],"title":"NavTimingEvent","type":"object"},"ParticipantJoinedEvent":{"properties":{"type":{"const":"participant_joined","default":"participant_joined","title":"Type","type":"string"},"participant_id":{"title":"Participant Id","type":"string"},"participant_role":{"enum":["caller","agent","operator"],"title":"Participant Role","type":"string"},"conference_sid":{"title":"Conference Sid","type":"string"},"participant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Participant Name","x-phi":true},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Display Name","x-phi":true},"operator_entity_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"default":null,"title":"Operator Entity Id"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Phone Number","x-phi":true}},"required":["participant_id","participant_role","conference_sid"],"title":"ParticipantJoinedEvent","type":"object"},"ParticipantLeftEvent":{"properties":{"type":{"const":"participant_left","default":"participant_left","title":"Type","type":"string"},"participant_id":{"title":"Participant Id","type":"string"},"participant_role":{"enum":["caller","agent","operator"],"title":"Participant Role","type":"string"},"conference_sid":{"title":"Conference Sid","type":"string"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Display Name","x-phi":true},"operator_entity_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"default":null,"title":"Operator Entity Id"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Phone Number","x-phi":true}},"required":["participant_id","participant_role","conference_sid"],"title":"ParticipantLeftEvent","type":"object"},"SessionEndEvent":{"properties":{"type":{"const":"session_end","default":"session_end","title":"Type","type":"string"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Call Sid"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Session Id"},"duration_s":{"default":0.0,"title":"Duration S","type":"number"},"turns":{"default":0,"title":"Turns","type":"integer"},"completion_reason":{"default":"","title":"Completion Reason","type":"string"},"final_state":{"default":"","title":"Final State","type":"string"},"trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Trace Id"},"has_recording":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Has Recording"},"emotional_summary":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"default":null,"title":"Emotional Summary"}},"title":"SessionEndEvent","type":"object"},"SessionInfoEvent":{"properties":{"type":{"const":"session_info","default":"session_info","title":"Type","type":"string"},"call_sid":{"title":"Call Sid","type":"string"},"service_id":{"default":"","title":"Service Id","type":"string"},"workspace_id":{"default":"","title":"Workspace Id","type":"string"},"caller_id":{"default":"","title":"Caller Id","type":"string","x-phi":true},"start_time":{"default":0.0,"title":"Start Time","type":"number"},"current_state":{"default":"","title":"Current State","type":"string"},"direction":{"default":"inbound","enum":["inbound","outbound","playground","simulated","test"],"title":"Direction","type":"string"},"duration_seconds":{"default":0.0,"title":"Duration Seconds","type":"number"}},"required":["call_sid"],"title":"SessionInfoEvent","type":"object"},"SessionStartEvent":{"properties":{"type":{"const":"session_start","default":"session_start","title":"Type","type":"string"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Call Sid"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Session Id"},"service_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"default":null,"title":"Service Id"},"workspace_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"default":null,"title":"Workspace Id"},"initial_state":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Initial State"},"trace_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Trace Id"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Mode"}},"title":"SessionStartEvent","type":"object"},"SpeakerAcoustics":{"properties":{"energy_delta":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Energy Delta"},"pitch_delta":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Pitch Delta"},"zcr_delta":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Zcr Delta"},"energy_trend":{"anyOf":[{"enum":["rising","falling","stable"],"type":"string"},{"type":"null"}],"default":null,"title":"Energy Trend"},"normalized":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Normalized"}},"title":"SpeakerAcoustics","type":"object"},"SpeakerMutedEvent":{"properties":{"type":{"const":"speaker_muted","default":"speaker_muted","title":"Type","type":"string"},"muted":{"title":"Muted","type":"boolean"}},"required":["muted"],"title":"SpeakerMutedEvent","type":"object"},"StateTransitionEvent":{"properties":{"type":{"const":"state_transition","default":"state_transition","title":"Type","type":"string"},"previous_state":{"title":"Previous State","type":"string"},"next_state":{"title":"Next State","type":"string"},"transition_type":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Transition Type"},"annotation":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Annotation"}},"required":["previous_state","next_state"],"title":"StateTransitionEvent","type":"object"},"ToolCallCompletedEvent":{"properties":{"type":{"const":"tool_call_completed","default":"tool_call_completed","title":"Type","type":"string"},"tool_name":{"maxLength":256,"title":"Tool Name","type":"string"},"call_id":{"maxLength":256,"title":"Call Id","type":"string"},"output":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Output","x-phi":true},"succeeded":{"default":true,"title":"Succeeded","type":"boolean"},"duration_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Duration Ms"},"error_message":{"anyOf":[{"maxLength":2048,"type":"string"},{"type":"null"}],"default":null,"title":"Error Message"},"parent_call_id":{"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}],"default":null,"title":"Parent Call Id"},"integration_name":{"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}],"default":null,"title":"Integration Name"},"endpoint_name":{"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}],"default":null,"title":"Endpoint Name"},"protocol":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"title":"Protocol"}},"required":["tool_name","call_id"],"title":"ToolCallCompletedEvent","type":"object"},"ToolCallStartedEvent":{"properties":{"type":{"const":"tool_call_started","default":"tool_call_started","title":"Type","type":"string"},"tool_name":{"maxLength":256,"title":"Tool Name","type":"string"},"call_id":{"maxLength":256,"title":"Call Id","type":"string"},"input":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"string"},{"type":"null"}],"default":null,"title":"Input","x-phi":true},"parent_call_id":{"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}],"default":null,"title":"Parent Call Id"},"integration_name":{"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}],"default":null,"title":"Integration Name"},"endpoint_name":{"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}],"default":null,"title":"Endpoint Name"},"protocol":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"title":"Protocol"}},"required":["tool_name","call_id"],"title":"ToolCallStartedEvent","type":"object"},"UserTranscriptEvent":{"properties":{"type":{"const":"user_transcript","default":"user_transcript","title":"Type","type":"string"},"transcript":{"title":"Transcript","type":"string","x-phi":true},"state":{"default":"","title":"State","type":"string"},"speaker_id":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Speaker Id"},"speaker_role":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Speaker Role"},"stt_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Stt Confidence"},"eot_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Eot Confidence"},"is_barge_in":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Is Barge In"}},"required":["transcript"],"title":"UserTranscriptEvent","type":"object"},"VoiceContextAppliedEvent":{"properties":{"type":{"const":"voice_context_applied","default":"voice_context_applied","title":"Type","type":"string"},"tts_emotion":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null,"title":"Tts Emotion"},"tts_speed":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Tts Speed"},"tts_volume":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Tts Volume"},"filler_enabled":{"title":"Filler Enabled","type":"boolean"},"emotion_detection_enabled":{"title":"Emotion Detection Enabled","type":"boolean"},"reasoning":{"title":"Reasoning","type":"string"}},"required":["filler_enabled","emotion_detection_enabled","reasoning"],"title":"VoiceContextAppliedEvent","type":"object"},"ObserverSSEEvent":{"discriminator":{"mapping":{"agent_transcript":"#/components/schemas/AgentTranscriptEvent","agent_transcript_delta":"#/components/schemas/AgentTranscriptDeltaEvent","barge_in":"#/components/schemas/BargeInEvent","compound_emotion":"#/components/schemas/CompoundEmotionEvent","emotion":"#/components/schemas/EmotionEvent","empathy_classified":"#/components/schemas/EmpathyClassifiedEvent","forward_call_resolved":"#/components/schemas/ForwardCallResolvedEvent","latency":"#/components/schemas/LatencyEvent","nav_timing":"#/components/schemas/NavTimingEvent","participant_joined":"#/components/schemas/ParticipantJoinedEvent","participant_left":"#/components/schemas/ParticipantLeftEvent","session_end":"#/components/schemas/SessionEndEvent","session_info":"#/components/schemas/SessionInfoEvent","session_start":"#/components/schemas/SessionStartEvent","speaker_muted":"#/components/schemas/SpeakerMutedEvent","state_transition":"#/components/schemas/StateTransitionEvent","tool_call_completed":"#/components/schemas/ToolCallCompletedEvent","tool_call_started":"#/components/schemas/ToolCallStartedEvent","user_transcript":"#/components/schemas/UserTranscriptEvent","voice_context_applied":"#/components/schemas/VoiceContextAppliedEvent"},"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/AgentTranscriptDeltaEvent"},{"$ref":"#/components/schemas/AgentTranscriptEvent"},{"$ref":"#/components/schemas/BargeInEvent"},{"$ref":"#/components/schemas/CompoundEmotionEvent"},{"$ref":"#/components/schemas/EmotionEvent"},{"$ref":"#/components/schemas/EmpathyClassifiedEvent"},{"$ref":"#/components/schemas/ForwardCallResolvedEvent"},{"$ref":"#/components/schemas/LatencyEvent"},{"$ref":"#/components/schemas/NavTimingEvent"},{"$ref":"#/components/schemas/ParticipantJoinedEvent"},{"$ref":"#/components/schemas/ParticipantLeftEvent"},{"$ref":"#/components/schemas/SessionEndEvent"},{"$ref":"#/components/schemas/SessionInfoEvent"},{"$ref":"#/components/schemas/SessionStartEvent"},{"$ref":"#/components/schemas/SpeakerMutedEvent"},{"$ref":"#/components/schemas/StateTransitionEvent"},{"$ref":"#/components/schemas/ToolCallCompletedEvent"},{"$ref":"#/components/schemas/ToolCallStartedEvent"},{"$ref":"#/components/schemas/UserTranscriptEvent"},{"$ref":"#/components/schemas/VoiceContextAppliedEvent"}]},"TurnDoneEvent":{"properties":{"event":{"const":"done","default":"done","title":"Event","type":"string"},"conversation_id":{"format":"uuid","title":"Conversation Id","type":"string"},"status":{"title":"Status","type":"string"},"turn_count":{"title":"Turn Count","type":"integer"}},"required":["conversation_id","status","turn_count"],"title":"TurnDoneEvent","type":"object"},"TurnErrorEvent":{"description":"Terminal error frame on the turn stream.\n\nCarries a stable ``code`` so SDK consumers can branch deterministically\nwithout parsing free-form ``message`` text. ``retryable`` tells the\nconsumer whether issuing the same turn again is likely to succeed.\n``status_code`` is the upstream HTTP status when the error originated\nfrom a downstream service (agent-engine), and is otherwise omitted.","properties":{"event":{"const":"error","default":"error","title":"Event","type":"string"},"message":{"title":"Message","type":"string"},"code":{"default":"unknown","enum":["upstream_error","stream_interrupted","client_error","unknown"],"title":"Code","type":"string"},"retryable":{"default":false,"title":"Retryable","type":"boolean"},"status_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Status Code"}},"required":["message"],"title":"TurnErrorEvent","type":"object"},"TurnMessageEvent":{"properties":{"event":{"const":"message","default":"message","title":"Event","type":"string"},"role":{"title":"Role","type":"string"},"text":{"title":"Text","type":"string"}},"required":["role","text"],"title":"TurnMessageEvent","type":"object"},"TurnThinkingEvent":{"properties":{"event":{"const":"thinking","default":"thinking","title":"Event","type":"string"},"tier":{"title":"Tier","type":"integer"},"tier_name":{"title":"Tier Name","type":"string"}},"required":["tier","tier_name"],"title":"TurnThinkingEvent","type":"object"},"TurnTokenEvent":{"properties":{"event":{"const":"token","default":"token","title":"Event","type":"string"},"text":{"title":"Text","type":"string"}},"required":["text"],"title":"TurnTokenEvent","type":"object"},"TurnToolCallCompletedEvent":{"properties":{"event":{"const":"tool_call_completed","default":"tool_call_completed","title":"Event","type":"string"},"tool_name":{"maxLength":256,"title":"Tool Name","type":"string"},"call_id":{"maxLength":256,"title":"Call Id","type":"string"},"result":{"title":"Result","type":"string"},"succeeded":{"title":"Succeeded","type":"boolean"},"duration_ms":{"anyOf":[{"maximum":3600000.0,"minimum":0.0,"type":"number"},{"type":"null"}],"default":null,"description":"Wall-clock tool execution time in milliseconds, measured at the engage_step call site. Null when the upstream did not report timing (legacy/test paths).","title":"Duration Ms"}},"required":["tool_name","call_id","result","succeeded"],"title":"TurnToolCallCompletedEvent","type":"object"},"TurnToolCallStartedEvent":{"properties":{"event":{"const":"tool_call_started","default":"tool_call_started","title":"Event","type":"string"},"tool_name":{"maxLength":256,"title":"Tool Name","type":"string"},"call_id":{"maxLength":256,"title":"Call Id","type":"string"},"input":{"title":"Input","type":"string"}},"required":["tool_name","call_id","input"],"title":"TurnToolCallStartedEvent","type":"object"},"TurnStreamEvent":{"discriminator":{"mapping":{"done":"#/components/schemas/TurnDoneEvent","error":"#/components/schemas/TurnErrorEvent","message":"#/components/schemas/TurnMessageEvent","thinking":"#/components/schemas/TurnThinkingEvent","token":"#/components/schemas/TurnTokenEvent","tool_call_completed":"#/components/schemas/TurnToolCallCompletedEvent","tool_call_started":"#/components/schemas/TurnToolCallStartedEvent"},"propertyName":"event"},"oneOf":[{"$ref":"#/components/schemas/TurnTokenEvent"},{"$ref":"#/components/schemas/TurnToolCallStartedEvent"},{"$ref":"#/components/schemas/TurnToolCallCompletedEvent"},{"$ref":"#/components/schemas/TurnThinkingEvent"},{"$ref":"#/components/schemas/TurnMessageEvent"},{"$ref":"#/components/schemas/TurnDoneEvent"},{"$ref":"#/components/schemas/TurnErrorEvent"}]}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key issued via `POST /v1/{workspace_id}/api-keys`. Pass the returned `api_key` value as a Bearer token."}}},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}]}