{"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."},"503":{"description":"Revocation could not be queued; retry the request."}},"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":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceListResponse"}}}},"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}/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 are tagged source='test' and excluded from billing, scores, analytics, outbound EHR sync, and entity views.","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/workspaces/{workspace_id}/test-credential-ids":{"get":{"tags":["Workspaces"],"summary":"Get test credential IDs","description":"Get the credential IDs configured as test principals for this workspace's text channel.","operationId":"get-test-credential-ids","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCredentialIdsResponse"}}}}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]},"put":{"tags":["Workspaces"],"summary":"Update test credential IDs","description":"Set credential IDs to be treated as test principals. Text turns from these credentials are tagged source='test' and excluded from billing, scores, analytics, outbound EHR sync, and entity views.","operationId":"update-test-credential-ids","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCredentialIdsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCredentialIdsResponse"}}}},"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."},"503":{"description":"Canonical API key role configuration unavailable."},"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":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"mine_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Mine Only"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyListResponse"}}}},"403":{"description":"Insufficient permissions."},"503":{"description":"Canonical API key role configuration unavailable."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/api-keys/permission-catalog":{"get":{"tags":["API Keys"],"summary":"Get the API-key role/permission catalog","description":"Return the authoritative role→permission model: each role's default permission set (what an API key of that role may carry) plus the full permission universe. Clients use this to build the create-key form instead of hard-coding the matrix. Requires `ApiKey.view` permission.","operationId":"get-api-key-permission-catalog","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermissionCatalogResponse"}}}},"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/{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":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"default":[],"title":"Sort By"}},{"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":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListResponse"}}}},"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."},"409":{"description":"Managed integration mutation blocked."},"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 is managed or 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":"Integration is managed or endpoint name already exists."},"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."},"409":{"description":"Managed integration endpoint mutation blocked."},"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."},"409":{"description":"Managed integration endpoint mutation blocked."},"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":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SearchString"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalIntegrationListResponse"}}}},"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 or start a conversation (web inbound, or outbound on a channel)","operationId":"create_conversation_v1__workspace_id__conversations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateConversationRequest"}}},"required":true},"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"}}]}},"/v1/{workspace_id}/conversations/{conversation_id}/channel":{"post":{"tags":["conversations"],"summary":"Switch a conversation to another channel","description":"Move an active conversation onto a different channel (sms/imessage today). The durable conversation id is preserved — the same conversation continues; only its routing changes. Optionally dispatch a first agent turn on the new channel.","operationId":"switch_conversation_channel_v1__workspace_id__conversations__conversation_id__channel_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"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitchChannelRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{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 a background result without sending a user message. Protocol v2 claims at most one ready answer and returns an opaque delivery receipt; render or durably persist the answer, then acknowledge that receipt. Returns empty output when nothing is ready. Must NOT be combined with a request-body ``message`` (422) or SSE streaming (422). Poll no more than once every ~5s per conversation.","default":false,"title":"Poll"},"description":"Poll for a background result without sending a user message. Protocol v2 claims at most one ready answer and returns an opaque delivery receipt; render or durably persist the answer, then acknowledge that receipt. Returns empty output when nothing is ready. Must NOT be combined with a request-body ``message`` (422) or SSE streaming (422). Poll no more than once every ~5s per conversation."},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Stable UUID for replaying the same logical send or poll after an ambiguous failure. Reuse the same value only for that operation. Omission is backward-compatible but cannot provide client-controlled response-loss replay.","title":"Idempotency-Key"},"description":"Stable UUID for replaying the same logical send or poll after an ambiguous failure. Reuse the same value only for that operation. Omission is backward-compatible but cannot provide client-controlled response-loss replay."}],"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/{delivery_id}/ack":{"post":{"tags":["conversations"],"summary":"Acknowledge a rendered background turn delivery","operationId":"acknowledge_turn_delivery_v1__workspace_id__conversations__conversation_id__turns__delivery_id__ack_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":"delivery_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Delivery Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TurnDeliveryAckRequest"}}}},"responses":{"204":{"description":"Successful Response"},"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"},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Stable UUID for replaying the same logical streamed user-input turn.","title":"Idempotency-Key"},"description":"Stable UUID for replaying the same logical streamed user-input turn."}],"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}/conversations/{conversation_id}/approval":{"post":{"tags":["conversations"],"summary":"Approve or reject a parked write in your own conversation (external-user self-approval)","description":"Lets the external user who owns a conversation approve or reject a write that the agent paused for their confirmation. Only the conversation's own external user may call this; it requires the `conversations:approve_own` scope.","operationId":"decide_conversation_approval_v1__workspace_id__conversations__conversation_id__approval_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"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationApprovalRequest"}}}},"responses":{"204":{"description":"Successful Response"},"403":{"description":"Not an external_user token, or missing conversations:approve_own scope"},"404":{"description":"Conversation not found or not owned by the caller"},"503":{"description":"Decision store temporarily unavailable — safe to retry"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/agent-runs/harness-context":{"get":{"tags":["Agent Runs"],"summary":"Fetch the neutral session-bootstrap context for a service","description":"The retrievable CONTEXT edge of the world-model harness: identity + reference instructions, world scope, tool descriptors, guardrails, and an MCP write-policy summary. It shares the HarnessContext schema with the hosted harness but is not byte-identical to a hosted render. PHI-free (the API-run projection carries no scoped entities or rendered caller prose).","operationId":"get_harness_context_v1__workspace_id__agent_runs_harness_context_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"service_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Service Id"}},{"name":"version_set","in":"query","required":false,"schema":{"type":"string","maxLength":255,"default":"release","title":"Version Set"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HarnessContext"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/runs":{"get":{"tags":["Runs"],"summary":"List runs (framework + conversation)","description":"Paginated, newest-first list of runs for the workspace behind the unified ``Run`` contract. Federates framework runs (Delta ``world.runs`` MV) and conversation runs (Lakebase ``world.conversations``) at read time. Filter by ``kind`` (conversation / framework), ``channel`` (voice/text/sms/email/web — conversation runs only), and ``status`` (``live`` expands to running + paused). ``continuation_token`` is an opaque page cursor.","operationId":"list_runs_v1__workspace_id__runs_get","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"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"status","in":"query","required":false,"schema":{"type":"array","items":{"enum":["live","running","paused","completed","failed","timed_out"],"type":"string"},"default":[],"title":"Status"}},{"name":"kind","in":"query","required":false,"schema":{"type":"array","items":{"enum":["conversation","framework"],"type":"string"},"default":[],"title":"Kind"}},{"name":"channel","in":"query","required":false,"schema":{"type":"array","items":{"enum":["voice","text","sms","email","web"],"type":"string"},"default":[],"title":"Channel"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/runs/summary":{"get":{"tags":["Runs"],"summary":"Run counts (framework + conversation)","description":"Aggregate counts for the workspace's runs behind the unified ``Run`` contract: ``total``, ``live`` (running + paused), each canonical status, a full ``by_status`` map, and ``by_kind`` (conversation vs framework). Federates the Delta ``world.runs`` MV and Lakebase ``world.conversations`` with a cheap GROUP BY. Optional ``kind`` / ``channel`` filters mirror the list; a ``channel`` filter restricts to conversation runs.","operationId":"runs_summary_v1__workspace_id__runs_summary_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"kind","in":"query","required":false,"schema":{"type":"array","items":{"enum":["conversation","framework"],"type":"string"},"title":"Kind"}},{"name":"channel","in":"query","required":false,"schema":{"type":"array","items":{"enum":["voice","text","sms","email","web"],"type":"string"},"title":"Channel"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunsSummaryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/runs/{run_id}":{"get":{"tags":["Runs"],"summary":"Get one run (framework or conversation) by run_id","description":"Resolve a single run by its channel-neutral ``run_id`` and return the canonical ``Run`` — at any status (live, completed, failed, timed out). Federates the Delta ``world.runs`` MV (framework runs), Lakebase ``world.conversations`` (conversation runs), and the live-voice registry, matched by ``run_id`` and scoped to the workspace. Use the returned ``kind`` / ``channel`` / ``source_*`` fields to open the channel-appropriate detail (voice call, text conversation, framework trace). 404 if the run does not exist in this workspace.","operationId":"get_run_v1__workspace_id__runs__run_id__get","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/Run"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/runs/{run_id}/trajectory":{"get":{"tags":["Runs"],"summary":"Get a framework run's step-by-step trajectory","description":"Ordered structural steps (perception / decision / tool / completion) of a FRAMEWORK run, read from the durable Delta trace source by the run's correlation id. 404 if the run does not exist in this workspace; 409 if the run is a conversation run (use ``/conversations/{id}`` for per-turn detail).","operationId":"get_run_trajectory_v1__workspace_id__runs__run_id__trajectory_get","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/RunTrajectoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/runs/{run_id}/guidance":{"post":{"tags":["Runs"],"summary":"Send operator guidance to a live run","description":"Send text guidance to the agent handling a LIVE run, addressed by the channel-neutral ``run_id``. The agent incorporates it into its next response without the operator taking over. Requires ``admin`` (Operator:Update) and is bound to the caller's own operator identity (no impersonation). 404 if the run is not a live run in this workspace; 409 if its channel has no live guidance transport yet.","operationId":"send_run_guidance_v1__workspace_id__runs__run_id__guidance_post","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/RunGuidanceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunGuidanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/runs/{run_id}/takeover":{"post":{"tags":["Runs"],"summary":"Take over a live run as operator","description":"Register the caller's operator identity on a LIVE run and (in ``takeover`` mode) suspend the agent so the human drives; ``listen`` mode monitors without driving. Addressed by the channel-neutral ``run_id``. Requires ``admin`` (Operator:Update), bound to the caller's own operator identity (no impersonation). 404 if the run is not live in this workspace; 409 if its channel does not support live takeover yet, or if the operator has no phone number configured. For voice, Twilio dials the operator's phone and the response carries the resulting conference/participant SIDs.","operationId":"take_over_run_v1__workspace_id__runs__run_id__takeover_post","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/RunTakeoverRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunTakeoverResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/runs/{run_id}/handback":{"post":{"tags":["Runs"],"summary":"Hand a taken-over run back to the agent","description":"Release the caller's operator from a run they took over — the agent resumes. Addressed by ``run_id``. Requires ``admin`` (Operator:Update), bound to the caller's own operator identity. 404 if the run is not live in this workspace; 409 if its channel does not support live takeover yet.","operationId":"hand_back_run_v1__workspace_id__runs__run_id__handback_post","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/RunHandbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunHandbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/runs/{run_id}/authored-turn":{"post":{"tags":["Runs"],"summary":"Author the next turn on a non-voice run under takeover","description":"Stage an operator-authored reply for a NON-voice run (text/sms/email/web) the caller has taken over. The agent-engine send-gate substitutes it for the agent's next outbound (exactly-once), so the caller receives the operator's words while the agent stays suspended. Repeatable — each call stages the next turn. Addressed by the channel-neutral ``run_id``. Requires ``admin`` (Operator:Update), bound to the caller's own operator identity (no impersonation). 404 if the run is not live in this workspace; 409 for voice (voice takeover drives the live audio leg — use the conference, not an authored turn).","operationId":"author_run_turn_v1__workspace_id__runs__run_id__authored_turn_post","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/RunAuthoredTurnRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunAuthoredTurnResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/runs/{run_id}/switch-mode":{"post":{"tags":["Runs"],"summary":"Switch an operator between listen and takeover on a live run","description":"Toggle the operator between ``listen`` (monitor) and ``takeover`` (drive) on a run they have already joined, addressed by the channel-neutral ``run_id``. For voice this mutes/unmutes the operator's conference participant. Requires ``admin`` (Operator:Update), bound to the caller's own operator identity (no impersonation). 404 if the run is not live in this workspace; 409 if its channel does not support live takeover yet.","operationId":"switch_run_mode_v1__workspace_id__runs__run_id__switch_mode_post","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/RunSwitchModeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSwitchModeResponse"}}}},"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, or if this use case is bound in another workspace. 404 if the service or use case is missing or the service 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, or the use case is bound in another workspace."},"422":{"description":"Unsupported use case channel."},"403":{"description":"Insufficient permissions."}}},"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. 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}/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}/external-roles":{"get":{"tags":["External Roles"],"summary":"List External Roles","operationId":"list-external-roles","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"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__external_roles__ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["External Roles"],"summary":"Create External Role","operationId":"create-external-role","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__external_roles__CreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalRoleItem"}}}},"409":{"description":"An external role with the given name already exists"},"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}/external-roles/{role_id}":{"get":{"tags":["External Roles"],"summary":"Get External Role","operationId":"get-external-role","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"role_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Role Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalRoleItem"}}}},"404":{"description":"External role not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["External Roles"],"summary":"Delete External Role","operationId":"delete-external-role","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"role_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Role Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"External role not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/external-role-assignments":{"get":{"tags":["External Role Assignments"],"summary":"List External Role Assignments","operationId":"list-external-role-assignments","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"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__external_role_assignments__ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["External Role Assignments"],"summary":"Upsert External Role Assignment","operationId":"upsert-external-role-assignment","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalRoleAssignmentItem"}}}},"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}/external-role-assignments/{assignment_id}":{"get":{"tags":["External Role Assignments"],"summary":"Get External Role Assignment","operationId":"get-external-role-assignment","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"assignment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Assignment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalRoleAssignmentItem"}}}},"404":{"description":"Assignment not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["External Role Assignments"],"summary":"Delete External Role Assignment","operationId":"delete-external-role-assignment","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"assignment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Assignment Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Assignment not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/external-identity-bindings":{"put":{"tags":["External Identity Bindings"],"summary":"Upsert External Identity Binding","operationId":"upsert-external-identity-binding","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingUpsertRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalIdentityBindingUpsertResponse"}}}},"404":{"description":"entity_id or active external integration not found in workspace"},"409":{"description":"consumer subject already bound to another entity, or entity_id is a principal"},"502":{"description":"Identity rejected the binding request"},"503":{"description":"Identity 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"}}]},"get":{"tags":["External Identity Bindings"],"summary":"List External Identity Bindings","operationId":"list-external-identity-bindings","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"},"deprecated":true,"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"external_integration_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"External Integration Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalIdentityBindingListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/external-identity-bindings/{binding_id}":{"get":{"tags":["External Identity Bindings"],"summary":"Get External Identity Binding","operationId":"get-external-identity-binding","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"binding_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Binding Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalIdentityBindingItem"}}}},"404":{"description":"Binding not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["External Identity Bindings"],"summary":"Delete External Identity Binding","operationId":"delete-external-identity-binding","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"binding_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Binding Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Binding not found"},"502":{"description":"Identity rejected the clear request"},"503":{"description":"Identity service unavailable"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/role-grants":{"get":{"tags":["Role Grants"],"summary":"List Role Grants","operationId":"list-role-grants","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"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["active","superseded"],"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__role_grants__ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Role Grants"],"summary":"Create Role Grant","operationId":"create-role-grant","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__role_grants__CreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleGrantItem"}}}},"409":{"description":"An active grant for this (role, resource, access) already exists"},"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}/role-grants/{grant_id}":{"get":{"tags":["Role Grants"],"summary":"Get Role Grant","operationId":"get-role-grant","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"grant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Grant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleGrantItem"}}}},"404":{"description":"Role grant not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Role Grants"],"summary":"Delete Role Grant","description":"Supersede an active grant (immutable history) — never a physical delete.","operationId":"supersede-role-grant","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"grant_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Grant Id"}}],"responses":{"204":{"description":"Successful Response"},"404":{"description":"Active role grant not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/external-auth-claim-mappings":{"get":{"tags":["External Auth Claim Mappings"],"summary":"List Claim Mappings","operationId":"list-external-auth-claim-mappings","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"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["active","superseded"],"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__external_auth_claim_mappings__ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["External Auth Claim Mappings"],"summary":"Create Claim Mapping","operationId":"create-external-auth-claim-mapping","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routes__external_auth_claim_mappings__CreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimMappingItem"}}}},"409":{"description":"An active mapping for this claim tuple already exists"},"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}/external-auth-claim-mappings/resolve-preview":{"post":{"tags":["External Auth Claim Mappings"],"summary":"Resolve Preview Claim Mappings","description":"Dry-run the SAME resolver the per-turn path uses — read-only, never writes.\n\nReturns the mapped internal roles (id + name), the effective unioned active role\ngrants, and the count of unmapped input atoms. Requires ``Workspace.view``.","operationId":"resolve-preview-external-auth-claim-mappings","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolvePreviewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolvePreviewResponse"}}}},"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}/external-auth-claim-mappings/{mapping_id}":{"get":{"tags":["External Auth Claim Mappings"],"summary":"Get Claim Mapping","operationId":"get-external-auth-claim-mapping","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"mapping_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Mapping Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimMappingItem"}}}},"404":{"description":"External auth claim mapping not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/external-auth-claim-mappings/{mapping_id}/supersede":{"post":{"tags":["External Auth Claim Mappings"],"summary":"Supersede Claim Mapping","description":"Supersede an active mapping (immutable history) — flip active → superseded.\n\nPOST verb (not DELETE): the row persists and the superseded item is returned so\nthe caller sees the final state. 404 if there is no active row for the id.","operationId":"supersede-external-auth-claim-mapping","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"mapping_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Mapping Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimMappingItem"}}}},"404":{"description":"Active external auth claim mapping not found"},"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":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SearchString"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentListResponse"}}}},"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":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionListResponse"}}}},"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":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SearchString"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextGraphListResponse"}}}},"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":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContextGraphVersionListResponse"}}}},"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":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/SearchString"},{"type":"null"}],"title":"Search"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceListResponse"}}}},"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 — or WAV\nPCM16 when the ``Accept`` header prefers ``audio/wav``.","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"}},{"name":"accept","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accept"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_voice-turn"}}}},"responses":{"200":{"description":"Agent spoken reply — OGG Opus by default, WAV PCM16 (16 kHz mono) when the request's Accept header prefers audio/wav","content":{"application/json":{"schema":{}},"audio/ogg":{},"audio/wav":{}}},"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}/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/build-bundle":{"post":{"tags":["FHIR"],"summary":"Build a FHIR Patient Bundle from user records","description":"Expand a flat list of user records (external_id / email / name) into a FHIR collection Bundle, ready to POST to /fhir/import under its `bundle` field. Pure transformation — does NOT import; no entities or events are created. Every Patient gets an MR identifier (external_id when present, else a deterministic derived id — never the raw email) so a later import resolves a stable canonical_id and re-imports stay idempotent at the entity level; external_id also becomes the resource id when spec-valid.","operationId":"fhir-build-user-bundle","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirBuildBundleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FhirBundleResponse"}}}},"422":{"description":"Invalid user list."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/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":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"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":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"include_in_schema":false,"title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceListResponse"}}}},"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/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. channel-manager selects the optimal number for the given use_case_id. 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"},"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` = analysis started on first request (typically ready in 2-5 minutes; poll again), `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}/production-eval-definitions":{"post":{"tags":["Evaluations"],"summary":"Create Production Eval Definition","operationId":"create-production-eval-definition","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductionEvalDefinitionRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductionEvalDefinition"}}}},"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":["Evaluations"],"summary":"List Production Eval Definitions","operationId":"list-production-eval-definitions","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"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"service_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"}},{"name":"active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductionEvalDefinitionListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/production-eval-definitions/{definition_id}":{"patch":{"tags":["Evaluations"],"summary":"Update Production Eval Definition","operationId":"update-production-eval-definition","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Definition Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProductionEvalDefinitionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductionEvalDefinition"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Evaluations"],"summary":"Delete Production Eval Definition","operationId":"delete-production-eval-definition","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"definition_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Definition Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/calls/{conversation_id}/evaluate":{"post":{"tags":["Evaluations"],"summary":"Evaluate Call","description":"Run the workspace's active eval definitions against one completed call and\npersist the verdicts. Synchronous (the caller waits on the judge); the eager\npost-call trigger is a separate change.","operationId":"evaluate-call","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/CallEvalResultsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/calls/{conversation_id}/eval-results":{"get":{"tags":["Evaluations"],"summary":"Get Call Eval Results","operationId":"get-call-eval-results","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/CallEvalResultsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/external-write-proposals":{"get":{"tags":["Review Queue"],"summary":"List External Write Proposals","operationId":"list-external-write-proposals","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"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["proposed","approved","rejected","pushing","pushed","failed","superseded"],"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalWriteProposalListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/external-write-proposals/{proposal_id}/approve":{"post":{"tags":["Review Queue"],"summary":"Approve External Write Proposal","operationId":"approve-external-write-proposal","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proposal Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalWriteProposal"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/external-write-proposals/{proposal_id}/reject":{"post":{"tags":["Review Queue"],"summary":"Reject External Write Proposal","operationId":"reject-external-write-proposal","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectProposalRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExternalWriteProposal"}}}},"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/fleet-status":{"get":{"tags":["Sessions"],"summary":"Agones fleet capacity status","description":"Live Agones fleet capacity for the per-call voice fleet: Ready/Allocated/total GameServers plus headroom against the maxReplicas ceiling. Workspace-GLOBAL — one fleet serves every workspace, so the path workspace_id is only the auth anchor, never a data filter. Operator-only.","operationId":"get_fleet_status_v1__workspace_id__sessions_fleet_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FleetStatusResponse"}}}}},"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}/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":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActiveEscalationListResponse"}}}},"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":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EscalationEventListResponse"}}}},"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":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"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."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogListResponse"}}}},"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}/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":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperatorListResponse"}}}},"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. same_as edges are historical merge edges (written by the pre-SDP resolver; merge detection now lives in the Databricks pipeline — new edges are not produced).","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 (historical same_as edges from the pre-SDP resolver — new edges are not produced).","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 — historical same_as merge edges sorted by confidence (written by the pre-SDP resolver; merge detection now lives in the Databricks pipeline — new edges are not produced).","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","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityStatsSummary"}}}},"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/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/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"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Stable UUID so a retry after an ambiguous failure re-emits the same logical event (deduped downstream) instead of a duplicate. Used only on the synchronous-overlay write path; auto-generated when omitted.","title":"Idempotency-Key"},"description":"Stable UUID so a retry after an ambiguous failure re-emits the same logical event (deduped downstream) instead of a duplicate. Used only on the synchronous-overlay write path; auto-generated when omitted."}],"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.enrichment_synced (Synced-Table-populated view of SDP's enrichment_current_v3). 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/migration/conversations":{"post":{"tags":["World"],"summary":"Bulk-import v1 conversation envelopes for migrated patients","description":"Writes one terminal world.conversations row per v1 conversation (real dates, provider='v1-migration'), giving the returning-user greeting and the real conversation list. Admin-only, idempotent + correctable per (workspace, v1 conversation id), memory-safe (no world events emitted → the memory extractor never re-derives from these). Transcript content (turns) is a separate follow-up. Batch size <= 500.","operationId":"bulk-import-migration-conversations","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MigrationConversationsBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MigrationConversationsResponse"}}}},"400":{"description":"Naive/future timestamps, bad window, or non-person entity_id."},"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"}}]}},"/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. Tag a person key with 'memory_extract' (description required) to make it a workspace-custom memory dimension the conversation extractor infers from transcripts.","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, is_pii, or tags. 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``. Served from the SDP serving surfaces: entity rows from ``world.entities_synced``; canonical_id and external_id resolve through ``world.canonical_entity_map_synced`` point reads. Returns matches ranked by confidence + number of identifiers matched. Summary narrowing: ``external_ids`` is always ``{}``, ``tags`` is always ``[]``, and ``canonical_id`` is the canonical-map value or the entity's MRN.","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 — historical merge edges where different data sources refer to the same real-world entity (written by the pre-SDP resolver; merge detection now lives in the Databricks pipeline — new edges are not produced).","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"}}],"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":{"type":"array","items":{"type":"string"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"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"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceEventListResponse"}}}},"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":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["pending","synced","failed"],"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundLogListResponse"}}}},"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":"Historical same_as merge-edge counts (written by the pre-SDP resolver; merge detection now lives in the Databricks pipeline — new edges are not produced) 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":{"$ref":"#/components/schemas/AnalyticsDashboardResponse"}}}},"429":{"description":"Rate limit exceeded"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/analytics/eval-quality":{"get":{"tags":["Analytics"],"summary":"Eval Quality Analytics","description":"Production-eval pass-rate and score trends (channel-agnostic — voice, text, SMS, email).","operationId":"get-eval-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":"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/EvalQualityResponse"}}}},"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":{"$ref":"#/components/schemas/CallQualityAnalyticsResponse"}}}},"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}/traces:export":{"post":{"tags":["Traces"],"summary":"Export gen_ai.* + voice.* traces as OTLP/JSON","description":"Export the workspace's durable trace spans over a time window as OpenTelemetry Protocol (OTLP/HTTP JSON) spans: ``gen_ai.*`` tool-call spans and the per-call voice-isolation ``voice.*`` infra spans (allocate / media-attach / reap). Read-only; `Audit:View` permission required; dark behind ``OTEL_TRACE_EXPORT_ENABLED`` (404 when off). Paginated PULL API — extract ``.resourceSpans`` before forwarding to an OTLP collector. Attributes are an allowlist of tool-call + infra metadata; the raw tool-result ``error`` text is NOT exported (PHI-safe by construction).","operationId":"export_traces_v1__workspace_id__traces_export_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TracesExportRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TracesExportResponse"}}}},"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/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/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}/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 (``Audit.view``)","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 (``Audit.view``)","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 (``Audit.view``)","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 (``Audit.view``)","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":"Submit an async audit-events export.\n\nRuns the filtered query on the SQL warehouse with results staged to\npresigned CSV EXTERNAL_LINKS, and returns a Databricks ``statement_id``.\nPoll ``GET /export/{statement_id}`` for the download links. Nothing is\nmaterialized in platform-api, so the export scales to large date windows.\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/AuditExportSubmitResponse"}}}},"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/export/{statement_id}":{"get":{"tags":["Audit"],"summary":"Get Audit Export","description":"Poll a submitted audit export and return presigned CSV download links.\n\n``status`` is ``pending`` until the statement finishes, then ``ready`` with\n``chunks`` carrying short-lived presigned URLs the client downloads\ndirectly from object storage. The links expire quickly (~15 min) — re-poll\nto refresh. The workspace scope was fixed into the statement at submit\ntime; ``statement_id`` is an unguessable, short-lived capability.\n\nPermissions: admin, owner (``Audit.export`` — same gate as create).","operationId":"get-audit-export","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"statement_id","in":"path","required":true,"schema":{"type":"string","title":"Statement Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditExportResultResponse"}}}},"422":{"description":"Invalid statement_id"},"429":{"description":"Rate limited"}}}},"/v1/audit-log/me":{"get":{"tags":["Audit"],"summary":"List My Audit Events","description":"List the authenticated caller's own audit events across every workspace.\n\nAny authenticated caller may read their OWN trail — deliberately no\n``Audit.view`` gate. ``actor_entity_id`` is server-set to the caller's entity\nand is NEVER accepted from the client, so the ``workspace_id=None`` query can\nonly ever return the caller's own events (safe cross-workspace).","operationId":"list-my-audit-events","parameters":[{"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":"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":"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"}}}},"403":{"description":"Credential has no associated actor entity"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/audit-log/platform":{"get":{"tags":["Audit"],"summary":"List Platform Audit Events","description":"Cross-workspace + null-workspace audit read — platform administrators only.\n\nThe surface for cross-workspace and null-workspace events (login /\ntoken-theft events carry no workspace). Gated strictly on the global\n``platform:admin`` scope carried by an identity JWT; every other caller —\nincluding a workspace owner/admin — is rejected with 403.","operationId":"list-audit-events-platform","parameters":[{"name":"workspace_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter by workspace; omit for all workspaces","title":"Workspace Id"},"description":"Filter by workspace; omit for all workspaces"},{"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"}}}},"403":{"description":"platform:admin scope required"},"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 (``Workspace.update``).","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 (enforced via ``Workspace.update``, matching\nthe outreach-settings sibling).","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 (enforced via ``Workspace.update``).","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 (enforced via ``Workspace.update`` — this\ncreates patient-facing surfaces, so it must not be reachable below\nadmin tier).","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/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":"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":"latest_only","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Latest Only"}},{"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}/cost-to-serve/llm-inference":{"get":{"tags":["Metrics"],"summary":"Get LLM inference cost by model for a closed month","description":"LLM inference cost to serve this workspace in a closed month, by model.\n\n**This is what Amigo pays LLM vendors to serve this workspace — not an amount owed\nand not a contracted price.** Direct spend: the workspace's own tokens, priced per\ncall against vendor rates. Available once the month's close job has run.\n\n``cost_usd`` is null for a model with no rate card entry. That usage is real, so it\nis reported with its token counts and excluded from ``total_cost_usd``, and\n``has_unpriced_usage`` flags that the total understates actual spend.\n\nPermissions: **Amigo staff only** (``require_amigo_admin``). Not available to\ncustomer admins — this is Amigo's cost structure, not the customer's bill.","operationId":"get-llm-inference-cost","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"close_month","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Any date within the closed month to report, e.g. 2026-07-01","title":"Close Month"},"description":"Any date within the closed month to report, e.g. 2026-07-01"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LlmInferenceCostResponse"}}}},"403":{"description":"Requires an Amigo administrator identity"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/cost-to-serve/infrastructure":{"get":{"tags":["Metrics"],"summary":"Get apportioned infrastructure cost by component for a closed month","description":"Infrastructure cost to serve this workspace for a closed month.\n\n**This is what Amigo pays Databricks to serve this workspace — not an amount owed\nand not a contracted price.** Databricks compute and storage are pooled, so these\nare usage-weighted **shares**\nrather than metered quantities — a weaker claim than the LLM inference endpoint,\nwhose figures are this workspace's own tokens priced directly. Kept separate so\nneither number inherits the other's caveats.\n\nSourced from the monthly cost-allocation ledger, which reconciles 100% of the\nDatabricks bill to zero residual. Available once the month's close job has run\n(T+3). Components with no spend are omitted (no ``$0.00`` rows), and account-level\noverhead is never attributed to a workspace.\n\nPermissions: **Amigo staff only** (``require_amigo_admin``). Not available to\ncustomer admins — this is Amigo's cost structure, not the customer's bill.","operationId":"get-infrastructure-cost","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"close_month","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Any date within the closed month to report, e.g. 2026-07-01","title":"Close Month"},"description":"Any date within the closed month to report, e.g. 2026-07-01"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InfrastructureCostResponse"}}}},"403":{"description":"Requires an Amigo administrator identity"},"429":{"description":"Rate limited"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/metric-store/setup":{"post":{"tags":["Metric Store"],"summary":"Setup Metric Store","description":"Trigger the fixed Metric Store setup job through the platform control plane.","operationId":"setup_metric_store_v1_metric_store_setup_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricStoreRunResponse"}}}}}}},"/v1/metric-store/refresh":{"post":{"tags":["Metric Store"],"summary":"Refresh Metric Store","description":"Trigger an on-demand canonical Metric Store refresh.","operationId":"refresh_metric_store_v1_metric_store_refresh_post","responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricStoreRunResponse"}}}}}}},"/v1/metric-store/runs/{run_id}":{"get":{"tags":["Metric Store"],"summary":"Get Metric Store Run","description":"Read the Databricks status for a Metric Store setup or refresh run.","operationId":"get_metric_store_run_v1_metric_store_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"integer","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricStoreRunStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/metric-store/setup":{"post":{"tags":["Metric Store"],"summary":"Setup Metric Store Legacy","description":"Deprecated workspace-shaped alias for the environment-level setup route.","operationId":"setup_metric_store_v1__workspace_id__metric_store_setup_post","deprecated":true,"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricStoreRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/metric-store/refresh":{"post":{"tags":["Metric Store"],"summary":"Refresh Metric Store Legacy","description":"Deprecated workspace-shaped alias for the environment-level refresh route.","operationId":"refresh_metric_store_v1__workspace_id__metric_store_refresh_post","deprecated":true,"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricStoreRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/metric-store/runs/{run_id}":{"get":{"tags":["Metric Store"],"summary":"Get Metric Store Run Legacy","description":"Deprecated workspace-shaped alias for the environment-level run route.","operationId":"get_metric_store_run_v1__workspace_id__metric_store_runs__run_id__get","deprecated":true,"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":"integer","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricStoreRunStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/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}/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}/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":"sort_by","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"default":[],"title":"Sort By"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchedulingRuleSetListResponse"}}}},"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**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 (``Audit.view``).","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 (``Audit.view``).","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 (``Audit.view``).","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":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationCaseListResponse"}}}},"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/performance":{"get":{"tags":["Simulations"],"summary":"Get Simulation Performance","description":"Aggregate recent graded (case/suite) runs into the Simulations overview:\noverall pass rate, per-metric trend series, and per-case / per-suite rollups\n(each with its per-conversation verdicts).\n\n``limit`` bounds how many recent runs are read (capped at 50). One request\nreplaces the console's former one-fetch-per-run fan-out.","operationId":"get-simulation-performance","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":15,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationPerformanceResponse"}}}},"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/sessions/{session_id}/promote":{"post":{"tags":["Simulations"],"summary":"Promote Simulation Session","description":"Promote a run-less (interactive playground) session into a coverage run.\n\nInteractive text sessions are created run-less, so ``fork`` — which requires\na ``run_id`` — 404s on them. This creates a coverage run, binds the existing\nagent-engine session to it (``adopt-run``, a Valkey meta update — the session\nitself is not recreated), and writes the platform-api ``SimulationCoverageSession``\nrecord that ``get_session_metadata`` returns, unblocking fork/score.\n\nIdempotent: a session that already has a coverage record returns its existing\nrun with ``already_bound=True``.","operationId":"promote-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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PromoteSessionResponse"}}}},"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"}}}},"404":{"description":"Simulation session or configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"422":{"description":"Request validation or simulation configuration error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"503":{"description":"Voice agent not reachable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}}}}},"/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"}}}},"404":{"description":"Simulation session or configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"422":{"description":"Request validation or simulation configuration error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"503":{"description":"Voice agent not reachable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}}}}},"/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"}}}},"404":{"description":"Simulation session or configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"422":{"description":"Request validation or simulation configuration error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"503":{"description":"Voice agent not reachable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}}}}},"/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"}}}},"404":{"description":"Simulation session or configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"422":{"description":"Request validation or simulation configuration error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"503":{"description":"Voice agent not reachable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}}},"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"}}}},"404":{"description":"Simulation session or configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"422":{"description":"Request validation or simulation configuration error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"503":{"description":"Voice agent not reachable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}}},"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"}}}},"404":{"description":"Simulation session or configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"422":{"description":"Request validation or simulation configuration error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"503":{"description":"Voice agent not reachable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}}},"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"}}}},"404":{"description":"Simulation session or configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"422":{"description":"Request validation or simulation configuration error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"503":{"description":"Voice agent not reachable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}}}},"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"}}}},"404":{"description":"Simulation session or configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"422":{"description":"Request validation or simulation configuration error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}},"503":{"description":"Voice agent not reachable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulationProxyErrorResponse"}}}}}}},"/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}/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":{"get":{"tags":["Intake"],"summary":"List Intake Files","operationId":"list_intake_files_v1__workspace_id__intake_files_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":"continuation_token","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Continuation Token"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","maxLength":64,"default":"-ingested_at","title":"Sort By"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/_FileStatus"},{"type":"null"}],"title":"Status"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Search"}},{"name":"include_withdrawn","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Withdrawn"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_IntakeFileRow_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Intake"],"summary":"Upload Intake File","operationId":"upload_intake_file_v1__workspace_id__intake_files_post","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_intake_file_v1__workspace_id__intake_files_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntakeFileRow"}}}},"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}/intake/files/{file_id}/download":{"get":{"tags":["Intake"],"summary":"Download Intake File","operationId":"download_intake_file_v1__workspace_id__intake_files__file_id__download_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File 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}/intake/datasets":{"get":{"tags":["Intake"],"summary":"List Intake Datasets","operationId":"list_intake_datasets_v1__workspace_id__intake_datasets_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":"continuation_token","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Continuation Token"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","maxLength":64,"default":"name","title":"Sort By"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_DatasetRow_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/sources":{"post":{"tags":["Intake"],"summary":"Register Intake Source","operationId":"register_intake_source_v1__workspace_id__intake_sources_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterSourceRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntakeSourceRow"}}}},"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 Intake Sources","operationId":"list_intake_sources_v1__workspace_id__intake_sources_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":"continuation_token","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Continuation Token"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","maxLength":64,"default":"-created_ts","title":"Sort By"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_IntakeSourceRow_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/sources/{source_id}/sync":{"post":{"tags":["Intake"],"summary":"Sync Intake Source","operationId":"sync_intake_source_v1__workspace_id__intake_sources__source_id__sync_post","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":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SourceSyncResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/schema/register":{"post":{"tags":["Intake"],"summary":"Register Intake Schema","operationId":"register_intake_schema_v1__workspace_id__intake_schema_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterSchemaRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetRow"}}}},"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}/intake/batches":{"get":{"tags":["Intake"],"summary":"List Intake Batches","operationId":"list_intake_batches_v1__workspace_id__intake_batches_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":"continuation_token","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Continuation Token"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","maxLength":64,"default":"-created_ts","title":"Sort By"}},{"name":"source_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_BatchRow_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/batches/{batch_id}":{"get":{"tags":["Intake"],"summary":"Get Intake Batch","operationId":"get_intake_batch_v1__workspace_id__intake_batches__batch_id__get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/batches/{batch_id}/processing-manifest":{"get":{"tags":["Intake"],"summary":"Get Batch Processing Manifest","description":"The per-file params the batch-extract job needs to process every still-\n``received`` file in one run. Same workspace-scoped auth as the write-back\n(the job holds the batch's agent-session token). Documents only — snapshot/CSV\nbatches process in version order via the chained per-file path, not here.","operationId":"get_batch_processing_manifest_v1__workspace_id__intake_batches__batch_id__processing_manifest_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Batch Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchProcessingManifest"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/batches/{batch_id}/process":{"post":{"tags":["Intake"],"summary":"Process Intake Batch","operationId":"process_intake_batch_v1__workspace_id__intake_batches__batch_id__process_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"batch_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Batch Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/materialize":{"post":{"tags":["Intake"],"summary":"Materialize Intake","description":"Trigger the intake → customer-data materializer for this workspace.\n\nFires the materializer Databricks job (run-now); it rescans the workspace's\ncurated intake files and (re)materializes each snapshot dataset into\n``customer_data_<env>.<workspace_id>.<dataset>``. Every write is an idempotent\nkeyed MERGE / full overwrite, so a re-click is safe. Optionally scope to one\n``dataset``; omit for all curated snapshot datasets. Returns ``202`` with the\njob ``run_id`` (``null`` when the job is not configured in this environment).\nSame auth gate as ``POST /batches/{batch_id}/process``.","operationId":"materialize_intake_v1__workspace_id__intake_materialize_post","requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/MaterializeRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaterializeResponse"}}}},"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}/intake/datasets/{dataset}/update":{"post":{"tags":["Intake"],"summary":"Update Intake Dataset","description":"Run the customer-facing dataset update flow.\n\nThis is the one-click orchestration path for the console: check mapped Drive\nfolders, prepare any newly landed files, and publish immediately when no\npreparation is needed. If preparation is async, the run remains durable and\nis advanced by file write-backs or by refresh.","operationId":"update_intake_dataset_v1__workspace_id__intake_datasets__dataset__update_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"dataset","in":"path","required":true,"schema":{"type":"string","minLength":2,"maxLength":63,"pattern":"^[a-z0-9][a-z0-9_-]*[a-z0-9]$","title":"Dataset"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatasetUpdateRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/update-runs/{run_id}":{"get":{"tags":["Intake"],"summary":"Get Intake Update Run","operationId":"get_intake_update_run_v1__workspace_id__intake_update_runs__run_id__get","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/DatasetUpdateRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/materializations":{"get":{"tags":["Intake"],"summary":"List Intake Materializations","description":"Per-dataset materialization status for the workspace's Destinations tab.\n\nLists each registered dataset alongside its customer-data destination table's\nstatus — ``materialized`` (with row count + last-write time) or\n``not_materialized`` (no table yet). The dataset list + pagination mirror\n``GET /datasets`` (the contracts registry); the destination status is read\nfrom the ``customer_data_<env>`` catalog via the SQL warehouse. Member read.","operationId":"list_intake_materializations_v1__workspace_id__intake_materializations_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":"continuation_token","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Continuation Token"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","maxLength":64,"default":"name","title":"Sort By"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedResponse_MaterializationRow_"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/{workspace_id}/intake/files/{file_id}/status":{"post":{"tags":["Intake"],"summary":"Write Back Intake File Status","description":"Advance a file's status from the async CDC/extraction job (P4).\n\nThe job authenticates with the workspace's API key (Bearer) over the\nstandard Databricks→platform-api path — so RLS scopes the update to\nthat workspace. Moves the row to its terminal verdict and records the\ncurated/cdc paths. For a batch-sourced file, advances its batch (chain the\nnext snapshot version + roll up) once the verdict is terminal.","operationId":"write_back_intake_file_status_v1__workspace_id__intake_files__file_id__status_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}},{"name":"file_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"File Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusWriteBackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntakeFileRow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/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":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"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"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurfaceListResponse"}}}},"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":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewQueueListResponse"}}}},"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. Also mints the\npatient-facing ``url`` so operators can copy/share the link from the read\nview (the token isn't stored, so it's re-minted on each read).\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/`` (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_synced that are free\nand within 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}":{"get":{"tags":["Recordings"],"summary":"Get call recording","description":"Presigned S3 URLs for the inbound (caller) and outbound (agent) recording WAVs.","operationId":"get-recording","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"}}}},"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}/tools/catalog":{"get":{"tags":["Tool Testing"],"summary":"List built-in tool catalog","description":"List the platform's built-in world + surface tools (workspace-independent).","operationId":"list-tool-catalog","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolCatalogResponse"}}}},"403":{"description":"Insufficient permissions."},"401":{"description":"Missing or invalid credentials."},"503":{"description":"Voice agent service unavailable."}},"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Workspace Id"}}]}},"/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":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerListResponse"}}}},"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 durable trigger run table.","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":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TriggerRunListResponse"}}}},"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":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"exclusiveMinimum":0,"default":50,"title":"Limit"}},{"name":"continuation_token","in":"query","required":false,"schema":{"title":"Continuation Token"}},{"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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardListResponse"}}}},"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}/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**: `Audit:View` permission 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"},"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":[]},"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":[]},"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."},"ActiveEscalationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ActiveEscalationItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ActiveEscalationListResponse"},"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"},"AgentIdentity":{"properties":{"entry_actor_name":{"type":"string","title":"Entry Actor Name","default":""},"name":{"type":"string","title":"Name","default":""},"role":{"type":"string","title":"Role","default":""},"developed_by":{"type":"string","title":"Developed By","default":""},"instructions":{"type":"string","title":"Instructions","default":""},"initial_state":{"type":"string","title":"Initial State","default":""}},"type":"object","title":"AgentIdentity","description":"Who the agent IS — platform-authored only; ``None`` for native runs\n(a customer's own definition carries its own identity). Named\n``AgentIdentity`` (not ``Identity``) to avoid colliding with the existing\n``config.models.Identity`` OpenAPI schema (a same-name collision would\nforce-rename that shipped schema — a breaking spec change)."},"AgentListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AgentResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"AgentListResponse"},"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."},"AgentVersionListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AgentVersionResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"AgentVersionListResponse"},"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"}]},"AnalyticsDashboardResponse":{"properties":{"call_volume":{"$ref":"#/components/schemas/AnalyticsKpi","description":"Total calls in the period"},"avg_quality":{"$ref":"#/components/schemas/AnalyticsKpi","description":"Average quality score (0-100); higher is better"},"avg_ttfb_ms":{"$ref":"#/components/schemas/AnalyticsKpi","description":"Average audio time-to-first-byte in ms; lower is better"},"escalation_rate":{"$ref":"#/components/schemas/AnalyticsKpi","description":"Fraction of calls escalated; lower is better"},"tool_success_rate":{"$ref":"#/components/schemas/AnalyticsKpi","description":"Fraction of tool calls that succeeded; higher is better"},"avg_duration_s":{"$ref":"#/components/schemas/AnalyticsKpi","description":"Average call duration in seconds"},"period_days":{"type":"integer","title":"Period Days","description":"Length of the reporting period in days"}},"type":"object","required":["call_volume","avg_quality","avg_ttfb_ms","escalation_rate","tool_success_rate","avg_duration_s","period_days"],"title":"AnalyticsDashboardResponse","description":"Composite dashboard — six headline KPIs, each with a delta, plus the period length.\n\nHigher-is-better for ``call_volume``, ``avg_quality``, ``tool_success_rate``;\nhigher-is-worse for ``escalation_rate``, ``avg_ttfb_ms``, ``avg_duration_s``.\nConsumers must color deltas by that per-KPI polarity, not by delta sign alone."},"AnalyticsKpi":{"properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value","description":"Current-period value (None when no data)"},"delta_pct":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Delta Pct","description":"Percent change vs the previous period, or None"}},"type":"object","title":"AnalyticsKpi","description":"A single headline KPI with its period-over-period change.\n\n``value`` is left broad (int for counts, float for rates/scores/durations,\n``None`` when the metric has no data for the period). ``delta_pct`` is the\nsigned percent change vs the previous equal-length period, or ``None`` when\na prior-period comparison is unavailable."},"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)."},"AnyValue":{"additionalProperties":true,"type":"object"},"ApiKeyListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ApiKeyResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ApiKeyListResponse"},"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"},"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"},"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"},"AuditExportChunk":{"properties":{"chunk_index":{"type":"integer","title":"Chunk Index"},"row_count":{"type":"integer","title":"Row Count"},"byte_count":{"type":"integer","title":"Byte Count"},"external_link":{"type":"string","title":"External Link","description":"Short-lived presigned URL — download directly, do not proxy."},"expiration":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expiration","description":"ISO-8601 expiry of the presigned link."}},"type":"object","required":["chunk_index","row_count","byte_count","external_link"],"title":"AuditExportChunk"},"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"},"AuditExportResultResponse":{"properties":{"statement_id":{"type":"string","title":"Statement Id"},"status":{"type":"string","enum":["pending","ready"],"title":"Status"},"result_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result Format","description":"Result file format (CSV)."},"total_row_count":{"type":"integer","title":"Total Row Count","default":0},"chunks":{"items":{"$ref":"#/components/schemas/AuditExportChunk"},"type":"array","title":"Chunks"}},"type":"object","required":["statement_id","status"],"title":"AuditExportResultResponse"},"AuditExportSubmitResponse":{"properties":{"statement_id":{"type":"string","title":"Statement Id","description":"Databricks statement handle — poll GET /export/{statement_id} for links."},"status":{"type":"string","enum":["pending","ready"],"title":"Status","description":"pending: still running. ready: links available immediately."}},"type":"object","required":["statement_id","status"],"title":"AuditExportSubmitResponse"},"AuditLogListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/src__routes__operators_models__AuditEventResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"AuditLogListResponse"},"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"},"BatchDetail":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"batch_id."},"source_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Source Id"},"dataset":{"type":"string","title":"Dataset"},"status":{"type":"string","title":"Status","description":"discovered | ready | processing | completed | failed."},"files_found":{"type":"integer","title":"Files Found"},"created_ts":{"type":"string","title":"Created Ts"},"files":{"items":{"$ref":"#/components/schemas/IntakeFileRow"},"type":"array","title":"Files","default":[]}},"type":"object","required":["id","dataset","status","files_found","created_ts"],"title":"BatchDetail"},"BatchProcessingManifest":{"properties":{"document_processing":{"additionalProperties":true,"type":"object","title":"Document Processing"},"files":{"items":{"$ref":"#/components/schemas/FileEntry"},"type":"array","title":"Files"}},"type":"object","required":["document_processing","files"],"title":"BatchProcessingManifest","description":"Per-file extraction params for a document batch's still-``received`` files —\nconsumed by the batch-extract job, which runs ONCE per batch and extracts\nevery file (instead of one run-now per file, which blows the request/gateway\ntimeout for large batches). Authenticated by the same short-lived\nworkspace-scoped token as the status write-back. ``document_processing`` is\ndataset-wide (the contract); ``file_type`` is per-file (V265 multi-type).\n\nSource provenance mirrors the single-file path (resolve_source_identity, PHI\ngate): source_file_id/source_url (opaque ids) always populate; source_folder_path\n+ filename (operator-named free text) populate ONLY for contains_phi=false\ndatasets — otherwise they stay None, so PHI never leaves the Lakebase row."},"BatchRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"batch_id."},"source_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Source Id"},"dataset":{"type":"string","title":"Dataset"},"status":{"type":"string","title":"Status","description":"discovered | ready | processing | completed | failed."},"files_found":{"type":"integer","title":"Files Found"},"created_ts":{"type":"string","title":"Created Ts"}},"type":"object","required":["id","dataset","status","files_found","created_ts"],"title":"BatchRow","description":"A source-sync batch (Batches list / detail)."},"BindingUpsertRequest":{"properties":{"external_integration_id":{"type":"string","format":"uuid","title":"External Integration Id"},"external_subject_key":{"type":"string","maxLength":512,"minLength":1,"title":"External Subject Key"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"source":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Source","deprecated":true},"display_name":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Display Name"}},"additionalProperties":false,"type":"object","required":["external_integration_id","external_subject_key","entity_id"],"title":"BindingUpsertRequest"},"Body_upload_intake_file_v1__workspace_id__intake_files_post":{"properties":{"dataset":{"type":"string","maxLength":63,"minLength":2,"pattern":"^[a-z0-9][a-z0-9_-]*[a-z0-9]$","title":"Dataset"},"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"document_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Document Id"}},"type":"object","required":["dataset","file"],"title":"Body_upload_intake_file_v1__workspace_id__intake_files_post"},"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"},"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."},"CallEvalResult":{"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"},"conversation_id":{"type":"string","format":"uuid","title":"Conversation Id"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid"},"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":{"title":"Expected"},"actual":{"title":"Actual"},"rationale":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"justification":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Justification"},"cited_turns":{"items":{},"type":"array","title":"Cited Turns"},"computed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Computed At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["workspace_id","conversation_id","eval_key","eval_type","status"],"title":"CallEvalResult","description":"One eval verdict for one production call, keyed by ``conversation_id``.\nMirrors the sim eval-result shape. ``justification`` and ``cited_turns`` come\nfrom the justified ai_query metric compute. PHI: ``justification`` / ``actual``\ncan echo live transcript content; never log them."},"CallEvalResultsResponse":{"properties":{"conversation_id":{"type":"string","format":"uuid","title":"Conversation Id"},"results":{"items":{"$ref":"#/components/schemas/CallEvalResult"},"type":"array","title":"Results"}},"type":"object","required":["conversation_id","results"],"title":"CallEvalResultsResponse"},"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/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"},"CallQualityAnalyticsResponse":{"properties":{"summary":{"$ref":"#/components/schemas/CallQualitySummary","description":"Aggregate call-quality metrics for the period"},"trend":{"items":{"$ref":"#/components/schemas/CallQualityTrendPoint"},"type":"array","maxItems":2200,"title":"Trend","description":"Time series of call-quality metrics per interval bucket"},"quality_distribution":{"$ref":"#/components/schemas/CallQualityDistribution","description":"Call counts bucketed by quality-score band"}},"type":"object","required":["summary","trend","quality_distribution"],"title":"CallQualityAnalyticsResponse","description":"Call quality score trends, distribution, and summary over time.\n\nServed from the live Delta projection ``analytics.source_call_intelligence``."},"CallQualityDistribution":{"properties":{"excellent_90_100":{"type":"integer","title":"Excellent 90 100","description":"Calls with quality score 90-100"},"good_70_89":{"type":"integer","title":"Good 70 89","description":"Calls with quality score 70-89"},"fair_50_69":{"type":"integer","title":"Fair 50 69","description":"Calls with quality score 50-69"},"poor_0_49":{"type":"integer","title":"Poor 0 49","description":"Calls with quality score 0-49"}},"type":"object","required":["excellent_90_100","good_70_89","fair_50_69","poor_0_49"],"title":"CallQualityDistribution","description":"Call counts bucketed by quality-score band."},"CallQualitySummary":{"properties":{"avg_quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Quality Score","description":"Mean quality score across calls (0-100)"},"p50_quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P50 Quality Score","description":"Median quality score (0-100)"},"p95_quality_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P95 Quality Score","description":"95th-percentile quality score (0-100)"},"total_calls":{"type":"integer","title":"Total Calls","description":"Total number of calls in the period"},"escalation_rate":{"type":"number","title":"Escalation Rate","description":"Fraction of calls escalated to an operator (0.0-1.0)"},"avg_duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Duration Seconds","description":"Average call duration in seconds"}},"type":"object","required":["total_calls","escalation_rate"],"title":"CallQualitySummary","description":"Aggregate call-quality stats for the period."},"CallQualityTrendPoint":{"properties":{"date":{"type":"string","title":"Date","description":"Time bucket as an ISO-8601 timestamp string (granularity follows `interval`)"},"avg_quality":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Quality","description":"Average quality score in this bucket (0-100)"},"call_count":{"type":"integer","title":"Call Count","description":"Number of calls in this bucket"},"escalation_count":{"type":"integer","title":"Escalation Count","description":"Number of escalated calls in this bucket"}},"type":"object","required":["date","call_count","escalation_count"],"title":"CallQualityTrendPoint","description":"Single time-bucket data point in the call-quality trend series."},"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._-]+$"},"CanonicalInboundEnvelopePayload":{"properties":{"channel_kind":{"$ref":"#/components/schemas/ChannelKind"},"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id"},"inbound_message_ref":{"type":"string","maxLength":256,"minLength":1,"title":"Inbound Message Ref"},"caller_ref":{"type":"string","maxLength":320,"title":"Caller Ref","default":""},"content_parts":{"items":{"$ref":"#/components/schemas/ContentPartPayload"},"type":"array","maxItems":100,"minItems":1,"title":"Content Parts"},"parent_outbound_ref":{"type":"string","maxLength":256,"title":"Parent Outbound Ref","default":""},"subject":{"anyOf":[{"type":"string","maxLength":998},{"type":"null"}],"title":"Subject"},"authenticated":{"type":"boolean","title":"Authenticated","default":false},"idempotency_key":{"type":"string","maxLength":256,"title":"Idempotency Key","default":""},"occurred_at":{"type":"number","title":"Occurred At","default":0.0}},"type":"object","required":["channel_kind","use_case_id","inbound_message_ref","content_parts"],"title":"CanonicalInboundEnvelopePayload","description":"HTTP wire shape for :class:`CanonicalInboundEnvelope` (channel service → platform-api).\n\nFrozen — it is parsed once and immediately converted to the frozen in-core\ndataclass, so between-parse mutation is a bug."},"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"},"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."},"ChannelTurnResponse":{"properties":{"status":{"type":"string","enum":["accepted","skipped","duplicate"],"title":"Status"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"event_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Event Id"},"is_new_session":{"type":"boolean","title":"Is New Session","default":false}},"type":"object","required":["status"],"title":"ChannelTurnResponse"},"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"},"ClaimMappingItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"claim_namespace":{"type":"string","title":"Claim Namespace"},"claim_key":{"type":"string","title":"Claim Key"},"external_value":{"type":"string","title":"External Value"},"external_role_id":{"type":"string","format":"uuid","title":"External Role Id"},"status":{"type":"string","enum":["active","superseded"],"title":"Status"},"changed_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Changed By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","claim_namespace","claim_key","external_value","external_role_id","status","created_at"],"title":"ClaimMappingItem"},"ClientArtifact":{"properties":{"type":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","title":"Type"},"schema_version":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","title":"Schema Version"},"payload":{"$ref":"#/components/schemas/ClientArtifactPayload"}},"type":"object","required":["type","schema_version","payload"],"title":"ClientArtifact","description":"A versioned JSON payload that a client can render as a product component."},"ClientArtifactPayload":{"anyOf":[{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"items":{"$ref":"#/components/schemas/JsonValue"},"type":"array"}]},"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."},"ClientOutputConfig":{"properties":{"type":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","title":"Type"},"schema_version":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","title":"Schema Version"},"json_schema":{"additionalProperties":true,"type":"object","title":"Json Schema"},"max_bytes":{"type":"integer","maximum":262144.0,"minimum":1.0,"title":"Max Bytes","default":262144},"external_user_enabled":{"type":"boolean","title":"External User Enabled","default":false}},"type":"object","required":["type","schema_version","json_schema"],"title":"ClientOutputConfig","description":"External-user-safe projection contract for a direct integration endpoint.\n\nThe endpoint's existing ``response_template`` performs the projection. With no\ntemplate, the parsed upstream JSON body is emitted unchanged."},"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":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","const":"labs"}],"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"},"ColumnType":{"type":"string","enum":["text","int","bigint","numeric","boolean","uuid","timestamptz","date","time","jsonb","bytea"]},"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."},"Component":{"properties":{"component":{"type":"string","title":"Component","description":"Infrastructure component: jobs_pipelines, model_serving, warehouse, lakebase, storage_egress, or other"},"allocation":{"type":"string","title":"Allocation","description":"How the cost was determined: 'shared' (this workspace's usage-weighted share of a pooled resource) or 'direct' (spend tagged to it outright)"},"cost_usd":{"type":"number","title":"Cost Usd","description":"Cost in USD for this component"}},"type":"object","required":["component","allocation","cost_usd"],"title":"Component"},"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"},"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."},"ContextGraphListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ContextGraphResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ContextGraphListResponse"},"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)."},"ContextGraphVersionListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ContextGraphVersionResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ContextGraphVersionListResponse"},"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"},"ContextKeySpec":{"properties":{"key":{"$ref":"#/components/schemas/SlugString"},"type":{"type":"string","enum":["string","number"],"title":"Type"},"description":{"$ref":"#/components/schemas/DescriptionString"},"required":{"type":"boolean","title":"Required"}},"type":"object","required":["key","type","description","required"],"title":"ContextKeySpec","description":"One key a conversation may supply as start-time context for a service.\n\nThe value is validated against ``type`` at conversation start; a tool can then\nbind the key to one of its parameters (injected, hidden from the model)."},"ConversationApprovalRequest":{"properties":{"decision":{"type":"string","enum":["approve","reject"],"title":"Decision"},"reason":{"anyOf":[{"type":"string","maxLength":512,"minLength":1},{"type":"null"}],"title":"Reason"}},"additionalProperties":false,"type":"object","required":["decision"],"title":"ConversationApprovalRequest","description":"An external user's decision on a parked, approval-gated write in their own conversation."},"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","paused"],"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"},"ConversationStatusTransitionRequest":{"properties":{"status":{"type":"string","enum":["completed","closed"],"title":"Status"},"reason":{"type":"string","maxLength":64,"minLength":1,"title":"Reason","description":"Low-cardinality transition tag (e.g. hsm_terminal, use_case_rebind) recorded on the audit event and the conversation world event."}},"type":"object","required":["status","reason"],"title":"ConversationStatusTransitionRequest"},"ConversationStatusTransitionResponse":{"properties":{"conversation_id":{"type":"string","format":"uuid","title":"Conversation Id"},"status":{"type":"string","enum":["completed","closed"],"title":"Status"}},"type":"object","required":["conversation_id","status"],"title":"ConversationStatusTransitionResponse"},"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."},"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"},"turn_count":{"type":"integer","minimum":0.0,"title":"Turn Count","default":0}},"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":{"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"Stable identifier of the user exchange this message belongs to, derived deterministically from (conversation_id, turn_index) — identical across ``POST /turns`` responses and re-reads of the conversation history. User and agent messages from the same exchange share this value. Null on messages that precede the first user turn (proactive greetings, channel-event preludes)."},"turn_index":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Turn Index","description":"Zero-based ordinal of the user exchange this message belongs to (0 = first user turn). Derived server-side from the conversation's user-turn count — never stored. Null exactly when ``turn_id`` is null."},"role":{"type":"string","enum":["agent","user","system"],"title":"Role"},"text":{"type":"string","title":"Text"},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timestamp"},"channel":{"anyOf":[{"$ref":"#/components/schemas/ChannelKind"},{"type":"null"}],"description":"Channel this turn occurred on. A conversation that switched channels has a self-describing per-turn history; null on turns written before per-turn attribution or on channel-less internal turns."},"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":[]},"artifacts":{"items":{"$ref":"#/components/schemas/ClientArtifact"},"type":"array","title":"Artifacts","description":"Validated client-safe outputs produced during this agent turn.","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"},"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"},"channel":{"$ref":"#/components/schemas/ChannelKind","default":"web"},"recipient":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}],"description":"Destination address for an outbound conversation (E.164 for sms/imessage). Required for non-web."},"use_case_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Use Case Id","description":"Channel-manager use case the outbound conversation is sent through. Required for non-web; channel-manager resolves the sender (FROM) from it (never caller-supplied). Must be owned by this workspace."},"instruction":{"anyOf":[{"$ref":"#/components/schemas/BackgroundString"},{"type":"null"}],"description":"Optional context steering what the agent opens with on an outbound conversation."},"force_new":{"type":"boolean","title":"Force New","description":"Outbound thread-keyed channels (sms/imessage) only: close any existing ACTIVE conversation on the computed provider thread (recipient + use case) before dispatching, so the opener materializes a brand-new conversation instead of continuing the old thread. Rejected with 422 on channel=web — every web create already starts a new conversation, so force_new is meaningless there.","default":false},"context":{"additionalProperties":{"anyOf":[{"type":"integer"},{"type":"number"},{"type":"string","maxLength":8192}]},"type":"object","maxProperties":50,"title":"Context","description":"Start-time context (key-value pairs) for the conversation. Validated against the owning service's accepted_context schema: unknown keys, missing required keys, or type mismatches are rejected with 422. Tools may bind individual keys to their parameters."}},"type":"object","required":["service_id"],"title":"CreateConversationRequest"},"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":["ehr","fhir_store","snowflake"],"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"},"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":"phone"},"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."},"use_case_id":{"type":"string","format":"uuid","title":"Use Case Id","description":"Channel-manager use case ID. channel-manager selects the optimal outbound phone number bound to 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_synced.canonical_id. Resolved against the SDP-projected world.entities_synced 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","use_case_id","reason"],"title":"CreateOutboundCallRequest","description":"Request body for creating an outbound call.\n\n``use_case_id`` is required: channel-manager selects the optimal outbound\nphone number bound to that use case (the sole caller-ID resolution path)."},"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."},"CreateProductionEvalDefinitionRequest":{"properties":{"eval_key":{"type":"string","maxLength":128,"minLength":1,"title":"Eval Key"},"eval_type":{"$ref":"#/components/schemas/ProductionEvalType"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"metric_key":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Metric Key"},"expected":{"title":"Expected"},"params":{"additionalProperties":true,"type":"object","title":"Params"},"active":{"type":"boolean","title":"Active","default":true}},"type":"object","required":["eval_key","eval_type"],"title":"CreateProductionEvalDefinitionRequest"},"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},"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"}]},"accepted_context":{"items":{"$ref":"#/components/schemas/ContextKeySpec"},"type":"array","maxItems":100,"title":"Accepted Context"}},"type":"object","required":["name","agent_id","context_graph_id"],"title":"CreateServiceRequest"},"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-5"},"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":[{"$ref":"#/components/schemas/ThinkingEffort"},{"type":"null"}]},"temperature":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Temperature","description":"Anthropic sampling temperature (0-1). Ignored on models that reject sampling params (Opus 4.7+/Fable, which 400 otherwise). Set at most one of temperature/top_p -- Claude 4+ rejects both; the runtime keeps temperature and drops top_p."},"top_p":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Top P","description":"Anthropic nucleus sampling (0-1). Ignored on sampling-param-rejecting models; see temperature."},"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/TriggerableEvent"},"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"},"backend_org_id":{"anyOf":[{"$ref":"#/components/schemas/StrippedNonemptyString"},{"type":"null"}]}},"type":"object","required":["slug","name"],"title":"CreateWorkspaceRequest","description":"Request body for ``POST /v1/me/workspaces``."},"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"},"identity_bindings":{"additionalProperties":{"type":"string"},"type":"object","title":"Identity Bindings"},"identity_binding_test_values":{"additionalProperties":{"type":"string"},"type":"object","title":"Identity Binding Test Values"}},"type":"object","required":["type","exchange_url","body_encoding","static_headers","static_body_fields","param_headers","param_body_fields","response_token_path","identity_bindings"],"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":{}},"identity_bindings":{"additionalProperties":{"type":"string","enum":["principal.subject_key","principal.subject_id","external_user.subject_key"]},"type":"object","maxProperties":50,"title":"Identity Bindings","description":"Maps a declared ``param_name`` to the verified identity attribute that supplies it\nat dispatch. A bound param is dropped from the LLM-facing tool schema and injected from the\nverified session context (never model-supplied), closing the per-user-identity impersonation hole.\nKeys MUST reference a ``param_name`` declared on ``param_headers`` / ``param_body_fields``.","default":{}},"identity_binding_test_values":{"additionalProperties":{"type":"string"},"type":"object","title":"Identity Binding Test Values","description":"Author-configured test values for identity-bound params.\n\nOnly ``external_user.subject_key`` bindings may carry test values. Runtime\ndispatch uses them only when a backend execution path explicitly opts in.","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."},"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"},"DashboardListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DashboardDefinitionResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"DashboardListResponse"},"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"},"DataSourceListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DataSourceResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"DataSourceListResponse"},"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":["ehr","fhir_store","snowflake"],"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."},"DatasetRow":{"properties":{"name":{"type":"string","title":"Name","description":"Dataset slug (UI label \"Schema\")."},"schema_version":{"type":"string","title":"Schema Version"},"field_count":{"type":"integer","title":"Field Count"},"file_type":{"type":"string","title":"File Type","description":"Primary/representative file type (the first accepted type)."},"accepted_file_types":{"items":{"type":"string"},"type":"array","title":"Accepted File Types","description":"Document datasets: the full accepted-type set (V265). Empty for snapshot\nor legacy single-type documents (the UI falls back to ``file_type``).","default":[]},"ingestion_mode":{"type":"string","title":"Ingestion Mode","description":"`snapshot` (CSV/Excel → CDC) or `document` (PDF/docx → extraction)."},"limits":{"$ref":"#/components/schemas/Limits"}},"type":"object","required":["name","schema_version","field_count","file_type","ingestion_mode","limits"],"title":"DatasetRow","description":"A registered schema in the Schemas list (intake-ui-mvp-design.md §5.3)."},"DatasetUpdateRunResponse":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"dataset":{"type":"string","title":"Dataset"},"status":{"$ref":"#/components/schemas/_DatasetUpdateStatus"},"source_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Source Ids"},"batch_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Batch Ids"},"materialize_run_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Materialize Run Id"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"}},"type":"object","required":["run_id","dataset","status","source_ids","batch_ids","created_at","updated_at"],"title":"DatasetUpdateRunResponse","description":"Durable status for one dataset update action."},"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"},"DocumentProcessingSpec":{"properties":{"retain_source":{"type":"boolean","title":"Retain Source","default":true},"extraction_mode":{"type":"string","enum":["text_extract","OCR","hybrid"],"title":"Extraction Mode","default":"text_extract"}},"type":"object","title":"DocumentProcessingSpec","description":"Processing config for a document dataset (``ingestion_mode=document``).\n\nDocuments have no schema/primary-key/CDC; this is what the contract carries\ninstead (docs/plans/intake_file_processing_pipeline.md §5.9). Page-split /\noutput-metadata rules are stored in the same jsonb and may be added later\nwithout a migration."},"DriveFolderMapping":{"properties":{"folder_id":{"type":"string","maxLength":256,"minLength":1,"pattern":"^[A-Za-z0-9_-]+$","title":"Folder Id"},"dataset":{"type":"string","maxLength":63,"minLength":2,"pattern":"^[a-z0-9][a-z0-9_-]*[a-z0-9]$","title":"Dataset"},"contains_phi":{"type":"boolean","title":"Contains Phi","default":true}},"type":"object","required":["folder_id","dataset"],"title":"DriveFolderMapping","description":"One Google Drive folder ↔ one intake dataset.\n\n``folder_id`` is the Drive folder id (the identity — never the folder name,\nwhich can be renamed/moved). One folder maps to exactly one dataset."},"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"},"EagerEvalResponse":{"properties":{"status":{"type":"string","enum":["evaluated","skipped_over_cap"],"title":"Status"},"eval_count":{"type":"integer","title":"Eval Count"}},"type":"object","required":["status","eval_count"],"title":"EagerEvalResponse"},"EffectiveGrant":{"properties":{"resource_type":{"$ref":"#/components/schemas/_ResourceType"},"resource_key":{"type":"string","title":"Resource Key"},"access":{"$ref":"#/components/schemas/_Access"}},"type":"object","required":["resource_type","resource_key","access"],"title":"EffectiveGrant"},"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"},"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."},"client_output":{"anyOf":[{"$ref":"#/components/schemas/ClientOutputConfig"},{"type":"null"}],"description":"Opt-in typed artifact contract for external-user conversation delivery."},"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},"tags":{"items":{"type":"string","const":"memory_extract"},"type":"array","title":"Tags","description":"Routing tags. 'memory_extract' opts this key into memory extraction — the conversation extractor will infer it from transcripts as a workspace-custom memory dimension (person keys with a description only)."}},"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"},"tags":{"anyOf":[{"items":{"type":"string","const":"memory_extract"},"type":"array"},{"type":"null"}],"title":"Tags","description":"Replaces the full tags list when set. Pass [] to remove all tags."}},"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"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags","default":[]},"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"},"overlay_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Overlay Status"}},"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"}},"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``, …). Resolution probes the canonical entity map\n(``world.canonical_entity_map_synced``) with the candidate key forms\n``{system}:{ResourceType}:{value}`` (Patient / Practitioner /\nOrganization / Appointment) plus the bare ``value`` — so ``system``\nconstrains the probe keys, and the request's ``entity_type``\nconstrains the map slice. External aliases that were never minted as\ncanonical keys (the legacy ``external_ids`` JSONB junk-drawer\nentries) are no longer resolvable."},"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 identifier as carried by the canonical entity map (e.g. 'charm:Patient:42'; a raw MRN resolves only when a producer minted it as the canonical_id)."},"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","description":"Canonical-map value when resolved through the map, else the entity's MRN."},"external_ids":{"additionalProperties":true,"type":"object","title":"External Ids","description":"Always {} — external aliases live in the canonical entity map, not on the serving row."},"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","description":"Always [] — no tags column on the synced serving table."}},"type":"object","title":"EntityResolveSummary","description":"Compact identity card returned for each match.\n\nExcludes full entity state — fetch via\n``GET /v1/{ws}/entities/{entity_id}`` if needed. The fields here are\nthe ones a UI / agent needs to confirm \"yes, that's the right\nperson\" before paying for the full state read.\n\nStage-7 narrowing (resolver serves from ``entities_synced`` +\nthe canonical entity map; fields retained for wire compatibility):\n``external_ids`` is always ``{}`` and ``tags`` is always ``[]`` —\nneither survives on the synced serving table. ``canonical_id`` is\nthe canonical-map value when the row resolved through the map, else\nthe entity's MRN."},"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"}},"type":"object","required":["total_entities","total_events","sync_pending","sync_synced","sync_failed"],"title":"EntityStatsSummary"},"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"},"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"},"EscalationEventListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/EscalationEventResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"EscalationEventListResponse"},"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"},"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"},"EvalQualityResponse":{"properties":{"summary":{"$ref":"#/components/schemas/EvalQualitySummary","description":"Workspace-wide aggregate for the period"},"by_eval_key":{"items":{"$ref":"#/components/schemas/EvalQualitySummary"},"type":"array","maxItems":200,"title":"By Eval Key","description":"Per-eval-key aggregates, most-evaluated first"},"trend":{"items":{"$ref":"#/components/schemas/EvalQualityTrendPoint"},"type":"array","maxItems":2200,"title":"Trend","description":"Time series of eval pass-rate/score per interval bucket"}},"type":"object","required":["summary","by_eval_key","trend"],"title":"EvalQualityResponse","description":"Production-eval quality: overall pass-rate/score, per-eval-key breakdown, and a trend.\n\nThe channel-agnostic quality surface. Returns zeroed shapes (empty ``by_eval_key``\nand ``trend``, null rates) when no verdicts exist for the workspace/window — the\nconsole renders an empty-state rather than erroring, so this ships safely ahead of\nthe eager-eval trigger being enabled in production."},"EvalQualitySummary":{"properties":{"eval_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eval Key","description":"Eval key for a per-key row; null for the overall summary"},"total_evals":{"type":"integer","title":"Total Evals","description":"Total verdicts recorded (any status, incl. errored)"},"judged":{"type":"integer","title":"Judged","description":"Verdicts with a non-null pass/fail outcome (denominator for pass_rate)"},"pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pass Rate","description":"Fraction of judged verdicts that passed (0.0-1.0)"},"avg_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Score","description":"Mean numeric judge score across scored verdicts"}},"type":"object","required":["total_evals","judged"],"title":"EvalQualitySummary","description":"Aggregate production-eval verdict stats, overall or for one eval_key.\n\nSourced from ``call_eval_results`` (LLM-judge + assertion verdicts), which is\nkeyed by ``conversation_id`` and therefore CHANNEL-AGNOSTIC — voice, text,\nSMS, email all contribute equally, unlike the voice-shaped call-quality score."},"EvalQualityTrendPoint":{"properties":{"date":{"type":"string","format":"date","title":"Date","description":"Date bucket (granularity follows `interval`)"},"total_evals":{"type":"integer","title":"Total Evals","description":"Total verdicts in this bucket"},"judged":{"type":"integer","title":"Judged","description":"Verdicts with a non-null pass/fail outcome in this bucket"},"pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pass Rate","description":"Fraction of judged verdicts that passed in this bucket"},"avg_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Score","description":"Mean numeric judge score in this bucket"}},"type":"object","required":["date","total_evals","judged"],"title":"EvalQualityTrendPoint","description":"Single date-bucket data point in the eval-quality trend series."},"EvaluationResultView":{"properties":{"source_type":{"type":"string","enum":["metric","assertion"],"title":"Source Type"},"key":{"type":"string","maxLength":128,"title":"Key"},"label":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Label"},"value_type":{"anyOf":[{"type":"string","enum":["numeric","boolean","categorical","text","structured"]},{"type":"null"}],"title":"Value Type"},"evaluation_method":{"anyOf":[{"type":"string","enum":["threshold","equals","contains","regex","tool_called","llm_judge","custom"]},{"type":"null"}],"title":"Evaluation Method"},"expected":{"anyOf":[{},{"type":"null"}],"title":"Expected"},"actual":{"anyOf":[{},{"type":"null"}],"title":"Actual"},"expected_display":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Expected Display"},"actual_display":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Actual Display"},"verdict":{"type":"string","enum":["passed","failed","pending","skipped","error"],"title":"Verdict"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"score_label":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Score Label"},"rationale":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Rationale"},"references":{"items":{"type":"integer"},"type":"array","maxItems":100,"title":"References"},"run_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Run Id"},"case_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Case Id"},"session_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Session Id"},"trace_id":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Trace Id"}},"type":"object","required":["source_type","key","verdict"],"title":"EvaluationResultView","description":"One check as the console renders it, derived from a single eval result.\n\nBoth metric and assertion verdicts normalize to this shape so the frontend\nrenders a check without knowing where the value was stored."},"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},"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"},"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"},"ExternalAuthClaim":{"properties":{"namespace":{"type":"string","maxLength":64,"pattern":"^[a-z][a-z0-9_.:-]{0,63}$","title":"Namespace"},"key":{"type":"string","maxLength":64,"pattern":"^[a-z][a-z0-9_.:-]{0,63}$","title":"Key"},"value":{"type":"string","maxLength":256,"minLength":1,"title":"Value"}},"additionalProperties":false,"type":"object","required":["namespace","key","value"],"title":"ExternalAuthClaim","description":"One normalized customer assertion: the exact tuple ``(namespace, key, value)``.\n\n``value`` is preserved byte-for-byte (bounded length only) — Amigo does not\nlowercase, alias, or rewrite it. ``namespace`` and ``key`` are bounded canonical\nidentifiers. Arrays, objects, numbers, booleans, and null are rejected for every\nfield (v1 values are non-empty strings)."},"ExternalIdentityBindingItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"external_integration_id":{"type":"string","format":"uuid","title":"External Integration Id"},"subject_type":{"type":"string","const":"user","title":"Subject Type"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","deprecated":true},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"status":{"type":"string","enum":["active","revoked"],"title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","external_integration_id","subject_type","entity_id","status","created_at","updated_at"],"title":"ExternalIdentityBindingItem"},"ExternalIdentityBindingListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ExternalIdentityBindingItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ExternalIdentityBindingListResponse"},"ExternalIdentityBindingUpsertResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"external_integration_id":{"type":"string","format":"uuid","title":"External Integration Id"},"subject_type":{"type":"string","const":"user","title":"Subject Type"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","deprecated":true},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"status":{"type":"string","enum":["active","revoked"],"title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"upsert_outcome":{"type":"string","enum":["created","materialized","unchanged"],"title":"Upsert Outcome"}},"type":"object","required":["id","external_integration_id","subject_type","entity_id","status","created_at","updated_at","upsert_outcome"],"title":"ExternalIdentityBindingUpsertResponse"},"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"},"ExternalIntegrationListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ExternalIntegrationResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ExternalIntegrationListResponse"},"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"},"ExternalRoleAssignmentItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"source":{"type":"string","title":"Source"},"external_subject_key":{"type":"string","title":"External Subject Key"},"external_subject_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Subject Id"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"roles":{"items":{"type":"string"},"type":"array","title":"Roles"},"roles_verified":{"type":"boolean","title":"Roles Verified"},"status":{"type":"string","enum":["active","suspended","revoked"],"title":"Status"},"provisioned_via":{"type":"string","enum":["roster_sync","jit"],"title":"Provisioned Via"},"last_verified_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Verified 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","source","external_subject_key","entity_id","roles","roles_verified","status","provisioned_via","created_at","updated_at"],"title":"ExternalRoleAssignmentItem"},"ExternalRoleItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"external_name":{"type":"string","title":"External Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","external_name","created_at","updated_at"],"title":"ExternalRoleItem","description":"Wire shape for read + create responses."},"ExternalSystemString":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z0-9_\\-]+$"},"ExternalValueString":{"type":"string","maxLength":256,"minLength":1},"ExternalWriteProposal":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"connector_type":{"type":"string","title":"Connector Type"},"data_source_id":{"type":"string","format":"uuid","title":"Data Source Id"},"fhir_resource_type":{"type":"string","title":"Fhir Resource Type"},"fhir_resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Fhir Resource Id"},"proposed_payload":{"additionalProperties":true,"type":"object","title":"Proposed Payload"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"origin_run_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin Run Id"},"origin_run_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Origin Run Kind"},"origin_event_id":{"type":"string","format":"uuid","title":"Origin Event Id"},"event_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"status":{"type":"string","enum":["proposed","approved","rejected","pushing","pushed","failed","superseded"],"title":"Status"},"decided_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Decided By"},"decided_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Decided At"},"reject_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reject Reason"},"push_attempt_count":{"type":"integer","title":"Push Attempt Count","default":0},"vendor_resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor Resource Id"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"},"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","connector_type","data_source_id","fhir_resource_type","origin_event_id","status"],"title":"ExternalWriteProposal","description":"A human-review proposal for an external (EHR) write-back — the Review Queue.\n\nStaged by connector-runner when a `review_required` sink would otherwise\nauto-push (world.external_write_proposals); a reviewer approves/rejects, and the\negress drain delivers approved ones. ``proposed_payload`` is the full FHIR write\nbody and MAY contain PHI — this surface is workspace-scoped (FORCE-RLS) and\npermission-gated (ReviewQueue); never log it. ``connector_type``/``fhir_*``/\n``status``/``idempotency_key`` are opaque strings; the ids are uuid."},"ExternalWriteProposalListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ExternalWriteProposal"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ExternalWriteProposalListResponse"},"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."},"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"},"FhirBuildBundleRequest":{"properties":{"users":{"items":{"$ref":"#/components/schemas/FhirPatientUser"},"type":"array","maxItems":1000,"minItems":1,"title":"Users"}},"type":"object","required":["users"],"title":"FhirBuildBundleRequest","description":"Request body for ``POST /fhir/build-bundle``.\n\nBundle building is a pure transformation, so this carries only the user\nrows — provenance/dedup options (``source``, ``dedup``, …) belong to the\ndownstream ``POST /fhir/import`` call, not to bundle construction."},"FhirBundleResponse":{"properties":{"bundle":{"additionalProperties":true,"type":"object","title":"Bundle"},"patient_count":{"type":"integer","title":"Patient Count"}},"type":"object","required":["bundle","patient_count"],"title":"FhirBundleResponse","description":"Response for ``POST /fhir/build-bundle`` — the built FHIR Bundle.\n\n``bundle`` is the exact value ``POST /fhir/import`` expects nested under its\n``bundle`` field; ``patient_count`` echoes how many Patients were built."},"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"},"FhirPatientUser":{"properties":{"external_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"External Id","description":"Stable source-system id (e.g. FAM user UUID). Becomes the Patient MR identifier and, when it satisfies the FHIR id grammar, the resource id. Capped at 64 to match the FHIR Resource.id length."},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email","description":"Validated email; becomes an email telecom on the Patient."},"name":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Name","description":"Full name; used when first_name/last_name are not supplied."},"first_name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"First Name"},"last_name":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Last Name"}},"type":"object","title":"FhirPatientUser","description":"One caller-friendly user row for ``POST /fhir/build-bundle``.\n\nA flat identity shape (email / name / external id) that the server expands\ninto a FHIR Patient resource, so integrators onboarding users don't have to\nhand-author FHIR. ``external_id`` becomes the Patient MR identifier (and,\nwhen spec-valid, the FHIR resource id) — the anchor a later import uses for\nthe entity's canonical id / source-system binding (e.g. the FAM user UUID).\nSupply either ``name`` (full) or ``first_name`` / ``last_name``."},"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."},"FileEntry":{"properties":{"file_id":{"type":"string","format":"uuid","title":"File Id"},"document_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Document Id"},"version":{"type":"integer","title":"Version"},"source_path":{"type":"string","title":"Source Path"},"file_type":{"type":"string","title":"File Type"},"content_type":{"type":"string","title":"Content Type"},"sha256":{"type":"string","title":"Sha256"},"size_bytes":{"type":"integer","title":"Size Bytes"},"ingested_at":{"type":"string","title":"Ingested At"},"contract_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Contract Id"},"contract_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contract Version"},"source_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source File Id"},"source_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Url"},"source_folder_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Folder Path"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"}},"type":"object","required":["file_id","version","source_path","file_type","content_type","sha256","size_bytes","ingested_at"],"title":"FileEntry"},"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"},"FleetStatusResponse":{"properties":{"fleet":{"type":"string","title":"Fleet"},"namespace":{"type":"string","title":"Namespace"},"ready":{"type":"integer","title":"Ready"},"allocated":{"type":"integer","title":"Allocated"},"total":{"type":"integer","title":"Total"},"max_replicas":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Replicas"},"headroom":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Headroom"},"by_state":{"additionalProperties":{"type":"integer"},"type":"object","title":"By State"}},"type":"object","required":["fleet","namespace","ready","allocated","total","max_replicas","headroom","by_state"],"title":"FleetStatusResponse","description":"Live Agones fleet capacity (workspace-global).\n\n``headroom`` = remaining isolated-unit slots (``max_replicas - allocated``);\n``max_replicas``/``headroom`` are null when the ceiling isn't configured upstream.\nThe counts span the whole fleet (one fleet serves every workspace) — this is NOT\nper-workspace. ``fleet``/``namespace`` echo which fleet was read."},"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":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","const":"labs"}],"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."},"ForwardingDetails":{"properties":{"forward_to":{"type":"string","title":"Forward To","x-phi":true},"warm_transfer":{"type":"boolean","title":"Warm Transfer"},"forwarded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Forwarded At"}},"type":"object","required":["forward_to","warm_transfer"],"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)."},"Guardrails":{"properties":{"guardrails":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Guardrails","default":[]},"global_boundary_constraints":{"items":{"type":"string"},"type":"array","title":"Global Boundary Constraints","default":[]},"global_action_guidelines":{"items":{"type":"string"},"type":"array","title":"Global Action Guidelines","default":[]}},"type":"object","title":"Guardrails"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HarnessContext":{"properties":{"context_version":{"type":"integer","title":"Context Version","default":1},"config_fingerprint":{"type":"string","title":"Config Fingerprint","default":""},"source":{"type":"string","title":"Source","default":""},"identity":{"anyOf":[{"$ref":"#/components/schemas/AgentIdentity"},{"type":"null"}]},"world_scope":{"$ref":"#/components/schemas/WorldScope"},"tools":{"$ref":"#/components/schemas/Tools"},"guardrails":{"$ref":"#/components/schemas/Guardrails"},"write_floor":{"$ref":"#/components/schemas/WriteFloor"},"runtime":{"$ref":"#/components/schemas/Runtime"}},"type":"object","required":["world_scope","tools","guardrails","write_floor","runtime"],"title":"HarnessContext","description":"A framework-neutral, retrievable service bootstrap projection."},"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"},"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"},"InfrastructureCostResponse":{"properties":{"close_month":{"type":"string","format":"date","title":"Close Month","description":"First day of the closed month this breakdown covers"},"currency":{"type":"string","title":"Currency","description":"Currency of every amount in this response","default":"USD"},"total_cost_usd":{"type":"number","title":"Total Cost Usd","description":"Amigo's cost to serve this workspace, not an amount owed. Sum of all components for the month"},"components":{"items":{"$ref":"#/components/schemas/Component"},"type":"array","title":"Components"}},"type":"object","required":["close_month","total_cost_usd","components"],"title":"InfrastructureCostResponse","description":"Per-component infrastructure cost for one close month."},"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"},"InstrumentationScope":{"properties":{"name":{"type":"string","title":"Name"},"version":{"type":"string","title":"Version"}},"type":"object","required":["name","version"],"title":"InstrumentationScope"},"IntakeFieldType":{"type":"string","enum":["str","int","float","bool","date","datetime"],"title":"IntakeFieldType","description":"Allowed ``schema[].type`` values for a registered contract.\n\nConfirmed set (intake-ui-mvp design contract point #1): scalars plus\nISO date/datetime. Coercion semantics live in :func:`_coerces`."},"IntakeFileRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"file_id — used for download."},"filename":{"type":"string","title":"Filename"},"dataset":{"type":"string","title":"Dataset","description":"Schema slug (UI label \"Schema\")."},"schema_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Schema Version","description":"The contract version this file validated against (e.g. ``v1``)."},"status":{"$ref":"#/components/schemas/_FileStatus"},"error_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Reason","description":"Null unless rejected/failed."},"size_bytes":{"type":"integer","title":"Size Bytes"},"ingested_at":{"type":"string","title":"Ingested At","description":"ISO-8601 timestamp the file was received."},"document_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Document Id","description":"The document this version belongs to (§5.9). Null for snapshot/CSV rows;\nset for documents — the console groups versions by it and the version chain."},"version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version","description":"The file's version number (per-document for documents, per-dataset for\nsnapshot). Lets the UI render a document's version history."},"source_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Type","description":"Origin of the document this version belongs to — ``manual`` for console\nuploads, ``google_shared_drive`` for the Drive connector (V269). Null for\nsnapshot/CSV rows."},"source_file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source File Id","description":"The source's stable external id (e.g. the Google Drive file id) for the\ndocument. Lets the console show provenance and confirm a re-synced file\nbumped the *same* document. Null for manual uploads and snapshot rows."},"source_folder_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Folder Path","description":"Where the file lived within the mapped Drive folder tree (V279) — the\nrelative path, folder names joined by ``/`` (e.g. ``clinical/notes``); ``''``\nat the mapped root. Lets the console show the original folder structure. Null\nfor manual uploads and snapshot rows."}},"type":"object","required":["id","filename","dataset","status","size_bytes","ingested_at"],"title":"IntakeFileRow","description":"A file in the Files list (intake-ui-mvp-design.md §5.1)."},"IntakeSourceRow":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"source_id."},"source_type":{"type":"string","title":"Source Type"},"display_name":{"type":"string","title":"Display Name"},"drive_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Drive Id"},"folders":{"items":{"$ref":"#/components/schemas/DriveFolderMapping"},"type":"array","title":"Folders"},"impersonate_subject":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Impersonate Subject","description":"DWD impersonation subject, if this source authenticates via domain-wide delegation."},"status":{"type":"string","title":"Status"},"created_ts":{"type":"string","title":"Created Ts","description":"ISO-8601 timestamp."}},"type":"object","required":["id","source_type","display_name","folders","status","created_ts"],"title":"IntakeSourceRow","description":"A registered intake source (Sources list)."},"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-5"},"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":[{"$ref":"#/components/schemas/ThinkingEffort"},{"type":"null"}]},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature"},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top P"},"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"},"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."},"JsonValue":{"anyOf":[{"type":"boolean"},{"type":"integer"},{"type":"number"},{"type":"string"},{"items":{"$ref":"#/components/schemas/JsonValue"},"type":"array"},{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},{"type":"null"}]},"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."},"KeyValue":{"properties":{"key":{"type":"string","title":"Key"},"value":{"$ref":"#/components/schemas/AnyValue"}},"type":"object","required":["key","value"],"title":"KeyValue","description":"OTLP ``KeyValue`` attribute pair."},"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":{"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"}},"additionalProperties":false,"type":"object","title":"LLMExperienceControls","description":"Typed model-tuning controls for a version set's LLM preference.\n\n``params`` remains available as a provider-specific escape hatch. These three\nfields are the ones deployments actually use; the surface was trimmed from\nnineteen in V370 after a production census found the other sixteen had never\nbeen set to a non-null value by anyone. Token budgets are intentionally\nexcluded so version sets do not reintroduce accidental response truncation."},"LanguageProviderEntry":{"properties":{"provider":{"type":"string","enum":["cartesia","elevenlabs"],"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"},"Limits":{"properties":{"max_size_mb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Size Mb"}},"type":"object","title":"Limits"},"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"},"LlmInferenceCostResponse":{"properties":{"close_month":{"type":"string","format":"date","title":"Close Month","description":"First day of the closed month this breakdown covers"},"currency":{"type":"string","title":"Currency","description":"Currency of every amount in this response","default":"USD"},"total_cost_usd":{"type":"number","title":"Total Cost Usd","description":"Amigo's cost to serve this workspace, not an amount owed. Sum of priced models; excludes any model where is_priced is false"},"has_unpriced_usage":{"type":"boolean","title":"Has Unpriced Usage","description":"True when some usage could not be priced, so total_cost_usd understates actual spend"},"models":{"items":{"$ref":"#/components/schemas/Model"},"type":"array","title":"Models"}},"type":"object","required":["close_month","total_cost_usd","has_unpriced_usage","models"],"title":"LlmInferenceCostResponse","description":"Per-model LLM inference cost for one close month."},"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"},"MappedRole":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"MappedRole"},"MaterializationRow":{"properties":{"dataset":{"type":"string","title":"Dataset"},"ingestion_mode":{"type":"string","title":"Ingestion Mode"},"status":{"type":"string","enum":["materialized","not_materialized"],"title":"Status"},"row_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Row Count"},"last_materialized_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Materialized At"}},"type":"object","required":["dataset","ingestion_mode","status"],"title":"MaterializationRow","description":"Per-dataset status of the customer-data destination table\n(``customer_data_<env>.<workspace_id>.<dataset>``)."},"MaterializeRequest":{"properties":{"dataset":{"anyOf":[{"$ref":"#/components/schemas/_DatasetSlug"},{"type":"null"}]}},"type":"object","title":"MaterializeRequest"},"MaterializeResponse":{"properties":{"run_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Run Id"}},"type":"object","title":"MaterializeResponse"},"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"},"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"},"MetricStoreRunResponse":{"properties":{"run_id":{"type":"integer","title":"Run Id"}},"type":"object","required":["run_id"],"title":"MetricStoreRunResponse"},"MetricStoreRunStatusResponse":{"properties":{"run_id":{"type":"integer","title":"Run Id"},"life_cycle_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Life Cycle State"},"result_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result State"},"state_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State Message"}},"type":"object","required":["run_id"],"title":"MetricStoreRunStatusResponse"},"MigrationConversationItem":{"properties":{"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"source_conversation_id":{"type":"string","maxLength":128,"minLength":1,"title":"Source Conversation Id"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"ended_at":{"type":"string","format":"date-time","title":"Ended At"},"channel_kind":{"$ref":"#/components/schemas/ChannelKind","default":"web"},"turn_count":{"type":"integer","minimum":0.0,"title":"Turn Count","default":0}},"type":"object","required":["entity_id","source_conversation_id","started_at","ended_at"],"title":"MigrationConversationItem"},"MigrationConversationsBody":{"properties":{"conversations":{"items":{"$ref":"#/components/schemas/MigrationConversationItem"},"type":"array","maxItems":500,"minItems":1,"title":"Conversations"}},"type":"object","required":["conversations"],"title":"MigrationConversationsBody"},"MigrationConversationsResponse":{"properties":{"imported":{"type":"integer","title":"Imported"},"created":{"type":"integer","title":"Created"},"updated":{"type":"integer","title":"Updated"}},"type":"object","required":["imported","created","updated"],"title":"MigrationConversationsResponse"},"Model":{"properties":{"model":{"type":"string","title":"Model","description":"Model identifier, e.g. claude-sonnet-5"},"input_tokens":{"type":"integer","title":"Input Tokens"},"output_tokens":{"type":"integer","title":"Output Tokens"},"cached_tokens":{"type":"integer","title":"Cached Tokens"},"cost_usd":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cost Usd","description":"Token cost in USD, priced per call against the tiered rate card. null when this model has no rate card entry — usage is real but not yet priceable, which is why it is reported rather than omitted or shown as 0."},"is_priced":{"type":"boolean","title":"Is Priced","description":"False when the model has no rate card entry for this month"}},"type":"object","required":["model","input_tokens","output_tokens","cached_tokens","cost_usd","is_priced"],"title":"Model"},"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":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","const":"labs"}],"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"},"assertion_usage":{"type":"string","enum":["authorization_grant","client_authentication"],"title":"Assertion Usage"},"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","assertion_usage","scopes","extra_claims"],"title":"OAuth2JwtBearerAuthDict","description":"OAuth 2.0 JWT Bearer Token — RFC 7523.\n\n``assertion_usage`` selects the flow: § 2.1 (JWT as authorization grant) or\n§ 2.2 (JWT as client authentication / private_key_jwt)."},"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"},"assertion_usage":{"type":"string","enum":["authorization_grant","client_authentication"],"title":"Assertion Usage","description":"RFC 7523 flow selector — required; the caller must pick a flow.\n``authorization_grant`` (§ 2.1) sends the JWT as ``assertion`` under\n``grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer``.\n``client_authentication`` (§ 2.2, the ``private_key_jwt`` method) sends it as\n``client_assertion`` + ``client_assertion_type`` under ``grant_type=client_credentials``\n— required by Epic / SMART Backend Services."},"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","assertion_usage"],"title":"OAuth2JwtBearerAuthRequest","description":"OAuth 2.0 JWT Bearer Token — RFC 7523.\n\n``assertion_usage`` (required) selects the flow: § 2.1 (JWT as authorization\ngrant) or § 2.2 (JWT as client authentication / private_key_jwt)."},"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."},"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``."},"OperatorListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OperatorResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"OperatorListResponse"},"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"},"OutboundLogListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OutboundLogItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"OutboundLogListResponse"},"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"},"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_BatchRow_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BatchRow"},"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[BatchRow]"},"PaginatedResponse_DatasetRow_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DatasetRow"},"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[DatasetRow]"},"PaginatedResponse_IntakeFileRow_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/IntakeFileRow"},"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[IntakeFileRow]"},"PaginatedResponse_IntakeSourceRow_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/IntakeSourceRow"},"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[IntakeSourceRow]"},"PaginatedResponse_MaterializationRow_":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MaterializationRow"},"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[MaterializationRow]"},"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":{"anyOf":[{"type":"string","format":"uuid"},{"type":"string","const":"labs"}],"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"},"PermissionCatalogResponse":{"properties":{"roles":{"items":{"$ref":"#/components/schemas/RoleEntry"},"type":"array","title":"Roles"},"permissions":{"items":{"$ref":"#/components/schemas/PermissionEntry"},"type":"array","title":"Permissions"}},"type":"object","required":["roles","permissions"],"title":"PermissionCatalogResponse","description":"The authoritative role→permission model for API-key creation.\n\nServes the server-side source of truth (``DEFAULT_ROLE_DEFINITIONS``) so\nclients (console, SDK) stop hand-copying the matrix and drifting out of\nsync — a drift previously shipped `Data:Query` as a viewer default and\nmade the default create flow 422. Human-facing labels/descriptions for\nindividual permissions stay client-side (pure presentation); this payload\nis authorization truth only."},"PermissionEntry":{"properties":{"name":{"type":"string","title":"Name"},"namespace":{"type":"string","title":"Namespace"},"action":{"type":"string","title":"Action"}},"type":"object","required":["name","namespace","action"],"title":"PermissionEntry"},"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"},"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"},"ProductionEvalDefinition":{"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"},"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"},"expected":{"title":"Expected"},"params":{"additionalProperties":true,"type":"object","title":"Params"},"active":{"type":"boolean","title":"Active","default":true},"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":["workspace_id","eval_key","eval_type"],"title":"ProductionEvalDefinition","description":"An eval (assertion or metric-eval) that runs against a workspace's live\ncalls — the production analogue of a sim case's ``evals``. ``service_id``\nNone applies to every service in the workspace. ``expected`` is JSON: a\nphrase string for assertions, or a ``{gte|lte|equals|...}`` threshold for\nmetric-evals."},"ProductionEvalDefinitionListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ProductionEvalDefinition"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ProductionEvalDefinitionListResponse"},"ProductionEvalType":{"type":"string","enum":["metric"],"title":"ProductionEvalType"},"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."},"PromoteSessionResponse":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id","description":"The coverage run the session is now bound to"},"session_id":{"type":"string","title":"Session Id","description":"The promoted session id (unchanged)"},"already_bound":{"type":"boolean","title":"Already Bound","description":"True when the session was already run-scoped; the existing run is returned unchanged"}},"type":"object","required":["run_id","session_id","already_bound"],"title":"PromoteSessionResponse","description":"Result of binding a run-less session to a (newly created) coverage run."},"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_synced``. 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","meta"],"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"},"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"},"RealtimeCustomVoice":{"properties":{"id":{"type":"string","maxLength":256,"minLength":1,"pattern":"^voice_[A-Za-z0-9_-]+$","title":"Id"}},"additionalProperties":false,"type":"object","required":["id"],"title":"RealtimeCustomVoice","description":"Approved OpenAI custom voice reference."},"RealtimeSemanticVadConfig":{"properties":{"type":{"type":"string","const":"semantic_vad","title":"Type","default":"semantic_vad"},"eagerness":{"type":"string","enum":["auto","low","medium","high"],"title":"Eagerness","default":"auto"}},"additionalProperties":false,"type":"object","title":"RealtimeSemanticVadConfig","description":"Semantic turn detection controls."},"RealtimeServerVadConfig":{"properties":{"type":{"type":"string","const":"server_vad","title":"Type","default":"server_vad"},"threshold":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Threshold"},"prefix_padding_ms":{"anyOf":[{"type":"integer","maximum":5000.0,"minimum":0.0},{"type":"null"}],"title":"Prefix Padding Ms"},"silence_duration_ms":{"anyOf":[{"type":"integer","maximum":10000.0,"minimum":0.0},{"type":"null"}],"title":"Silence Duration Ms"},"idle_timeout_ms":{"anyOf":[{"type":"integer","maximum":30000.0,"minimum":5000.0},{"type":"null"}],"title":"Idle Timeout Ms"}},"additionalProperties":false,"type":"object","title":"RealtimeServerVadConfig","description":"Volume-based turn detection controls."},"RealtimeSessionConfig":{"properties":{"model":{"anyOf":[{"type":"string","enum":["gpt-realtime-1.5","gpt-realtime-2","gpt-realtime-2.1","gpt-realtime-2.1-mini"]},{"type":"null"}],"title":"Model"},"voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","sage","shimmer","verse","marin","cedar"]},{"$ref":"#/components/schemas/RealtimeCustomVoice"},{"type":"null"}],"title":"Voice"},"speed":{"anyOf":[{"type":"number","maximum":1.5,"minimum":0.25},{"type":"null"}],"title":"Speed"},"noise_reduction":{"anyOf":[{"type":"string","enum":["near_field","far_field","off"]},{"type":"null"}],"title":"Noise Reduction","description":"Input noise reduction. Omit or set null to use the Platform default; set 'off' to disable it."},"transcription":{"anyOf":[{"$ref":"#/components/schemas/RealtimeTranscriptionConfig"},{"type":"null"}]},"turn_detection":{"anyOf":[{"oneOf":[{"$ref":"#/components/schemas/RealtimeServerVadConfig"},{"$ref":"#/components/schemas/RealtimeSemanticVadConfig"}],"discriminator":{"propertyName":"type","mapping":{"semantic_vad":"#/components/schemas/RealtimeSemanticVadConfig","server_vad":"#/components/schemas/RealtimeServerVadConfig"}}},{"type":"null"}],"title":"Turn Detection"},"reasoning_effort":{"anyOf":[{"type":"string","enum":["low","medium","high"]},{"type":"null"}],"title":"Reasoning Effort"},"max_output_tokens":{"anyOf":[{"type":"integer","maximum":4096.0,"minimum":1.0},{"type":"string","const":"inf"},{"type":"null"}],"title":"Max Output Tokens"},"truncation":{"anyOf":[{"$ref":"#/components/schemas/RealtimeTruncationConfig"},{"type":"null"}]},"required_tool_on_first_caller_turn":{"anyOf":[{"type":"string","maxLength":256,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_.:-]*$"},{"type":"null"}],"title":"Required Tool On First Caller Turn","description":"Force one named function on the first caller-generated response, excluding the inbound greeting, then restore automatic tool choice. Runtime accepts this only for source_override='test' sessions and tools that the executor verifies are read-only or side-effect-free."}},"additionalProperties":false,"type":"object","title":"RealtimeSessionConfig","description":"Typed OpenAI Realtime session controls for a service."},"RealtimeTranscriptionConfig":{"properties":{"model":{"type":"string","enum":["whisper-1","gpt-4o-mini-transcribe","gpt-4o-transcribe"],"title":"Model","default":"gpt-4o-transcribe"},"language":{"anyOf":[{"type":"string","maxLength":35,"minLength":2,"pattern":"^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8})*$"},{"type":"null"}],"title":"Language"},"prompt":{"anyOf":[{"type":"string","maxLength":1024,"minLength":1},{"type":"null"}],"title":"Prompt"}},"additionalProperties":false,"type":"object","title":"RealtimeTranscriptionConfig","description":"Asynchronous caller-audio transcription used for transcripts and observability."},"RealtimeTruncationConfig":{"properties":{"type":{"type":"string","enum":["auto","disabled","retention_ratio"],"title":"Type","default":"auto"},"retention_ratio":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Retention Ratio"},"post_instructions_tokens":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Post Instructions Tokens"}},"additionalProperties":false,"type":"object","title":"RealtimeTruncationConfig","description":"Conversation context truncation strategy."},"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"},"RecordingUrlsResponse":{"properties":{"call_sid":{"type":"string","title":"Call Sid","description":"Twilio call SID"},"inbound_url":{"type":"string","title":"Inbound Url","description":"Presigned URL for the inbound (caller) WAV"},"outbound_url":{"type":"string","title":"Outbound Url","description":"Presigned URL for the outbound (agent) WAV"},"stereo_url":{"type":"string","title":"Stereo Url","description":"Presigned URL for the merged stereo (caller left / agent right) WAV"}},"type":"object","required":["call_sid","inbound_url","outbound_url","stereo_url"],"title":"RecordingUrlsResponse","description":"Presigned S3 URLs for a call recording's WAV objects."},"RegisterSchemaRequest":{"properties":{"name":{"$ref":"#/components/schemas/_DatasetSlug"},"file_type":{"$ref":"#/components/schemas/_FileType"},"accepted_file_types":{"items":{"$ref":"#/components/schemas/_FileType"},"type":"array","maxItems":16,"title":"Accepted File Types","description":"Document only — the SET of accepted file types (V265, e.g.\n``[\"pdf\",\"docx\",\"md\"]``). Empty → single-type (just ``file_type``).\n``file_type`` is included as the primary. Mixing in a tabular type\n(csv/xls/xlsx) is rejected; snapshot datasets are single-type.","default":[]},"primary_key":{"items":{"$ref":"#/components/schemas/_FieldName"},"type":"array","maxItems":32,"title":"Primary Key","description":"Snapshot only — the canonical PK column(s). Empty/ignored for documents.","default":[]},"schema":{"items":{"$ref":"#/components/schemas/SchemaFieldSpec"},"type":"array","maxItems":500,"title":"Schema","description":"Snapshot only — canonical field list ``[{name, type}]`` (wire key ``schema``).","default":[]},"document_processing":{"anyOf":[{"$ref":"#/components/schemas/DocumentProcessingSpec"},{"type":"null"}],"description":"Document only — extraction config; defaulted server-side when omitted."},"max_size_mb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Size Mb"}},"type":"object","required":["name","file_type"],"title":"RegisterSchemaRequest","description":"Create Schema payload (intake-ui-mvp-design.md §5.4, §5.9).\n\n``ingestion_mode`` is inferred from ``file_type`` (csv/xls/xlsx → snapshot;\nelse document) — not part of the wire contract. Snapshot datasets require\n``primary_key`` + ``schema``; document datasets take an optional\n``document_processing`` config and ignore primary_key/schema. The backend\napplies the other hidden defaults (``on_schema_change=additive``,\n``schema_version`` auto)."},"RegisterSourceRequest":{"properties":{"display_name":{"type":"string","maxLength":200,"minLength":1,"title":"Display Name"},"drive_id":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Drive Id"},"folders":{"items":{"$ref":"#/components/schemas/DriveFolderMapping"},"type":"array","maxItems":100,"minItems":1,"title":"Folders"},"impersonate_subject":{"anyOf":[{"type":"string","maxLength":320},{"type":"null"}],"title":"Impersonate Subject"}},"type":"object","required":["display_name","folders"],"title":"RegisterSourceRequest","description":"Register a Google Shared Drive intake source (design §3).\n\nThe credential is not part of the wire contract and nothing needs provisioning:\nthe source authenticates as the unified platform-infra intake service account,\nimpersonated from the pod's workload identity. Grant access Drive-side — share\nthe folder with that SA's email, or set ``impersonate_subject`` for the DWD\nmodel. ``drive_id`` is optional (resolved at sync if omitted)."},"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``."},"RejectProposalRequest":{"properties":{"reason":{"type":"string","maxLength":1000,"minLength":1,"title":"Reason"}},"type":"object","required":["reason"],"title":"RejectProposalRequest"},"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"},"ResolvePreviewRequest":{"properties":{"auth_claims":{"items":{"$ref":"#/components/schemas/ExternalAuthClaim"},"type":"array","maxItems":32,"title":"Auth Claims","default":[]}},"additionalProperties":false,"type":"object","title":"ResolvePreviewRequest"},"ResolvePreviewResponse":{"properties":{"roles":{"items":{"$ref":"#/components/schemas/MappedRole"},"type":"array","title":"Roles"},"grants":{"items":{"$ref":"#/components/schemas/EffectiveGrant"},"type":"array","title":"Grants"},"unmapped_claim_count":{"type":"integer","title":"Unmapped Claim Count"}},"type":"object","required":["roles","grants","unmapped_claim_count"],"title":"ResolvePreviewResponse"},"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"},"Resource":{"properties":{"attributes":{"items":{"$ref":"#/components/schemas/KeyValue"},"type":"array","title":"Attributes"}},"type":"object","required":["attributes"],"title":"Resource"},"ResourceSpans":{"properties":{"resource":{"$ref":"#/components/schemas/Resource"},"scopeSpans":{"items":{"$ref":"#/components/schemas/ScopeSpans"},"type":"array","title":"Scopespans"}},"type":"object","required":["resource","scopeSpans"],"title":"ResourceSpans"},"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."},"managed":{"type":"boolean","title":"Managed","description":"Whether the integration is system-managed and protected from workspace CRUD.","default":false},"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"},"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"},"ReviewQueueListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SurfaceResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ReviewQueueListResponse"},"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."},"RoleEntry":{"properties":{"name":{"type":"string","title":"Name"},"priority":{"type":"integer","title":"Priority"},"description":{"type":"string","title":"Description"},"permission_names":{"items":{"type":"string"},"type":"array","title":"Permission Names"}},"type":"object","required":["name","priority","description","permission_names"],"title":"RoleEntry"},"RoleGrantItem":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"role_id":{"type":"string","format":"uuid","title":"Role Id"},"resource_type":{"$ref":"#/components/schemas/_ResourceType"},"resource_key":{"type":"string","title":"Resource Key"},"access":{"$ref":"#/components/schemas/_Access"},"param_binding":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Param Binding"},"status":{"type":"string","enum":["active","superseded"],"title":"Status"},"changed_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Changed By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","role_id","resource_type","resource_key","access","status","created_at"],"title":"RoleGrantItem"},"RoleGrantKeysBinding":{"properties":{"source":{"type":"string","const":"role_grant_resource_keys","title":"Source"},"resource_type":{"type":"string","const":"kb_scope","title":"Resource Type"},"access":{"type":"string","const":"read","title":"Access","default":"read"},"encoding":{"type":"string","const":"csv","title":"Encoding","default":"csv"}},"additionalProperties":false,"type":"object","required":["source","resource_type"],"title":"RoleGrantKeysBinding","description":"Declares a SQL-tool parameter as *server-bound* to a turn's resolved authorization.\n\nFamily-agnostic — consumed by BOTH platform functions (``fn_*``,\n``platform.function_parameters``) and workspace data queries (``wsq_*``,\n``platform.workspace_data_query_parameters``). A parameter carrying this binding\nis NOT caller-supplied: at execution the platform discards any caller value,\nprojects the resource keys the turn's :class:`ExternalAuthorizationBlock` holds\nfor ``(resource_type, access)`` via :meth:`ExternalAuthorizationBlock.resource_keys`,\nencodes them, and injects the result into the ``:name`` SQL bind — the model /\ncaller never sees or supplies it.\n\nThis is a THIRD parameter state, distinct from required (``default is None``) and\ndefaulted (``default is not None``): the caller-required check must exempt it and\nthe executor must always inject. The literal sets are pinned to v1; widening one is\na paired migration + model change (the ``binding_*`` columns added to both param\ntables in V328). ``extra=\"forbid\"`` so an author can't smuggle an unrecognized field.\n\nLives here, next to ``ExternalAuthorizationBlock.resource_keys`` (its runtime\ncounterpart), so the two SQL-tool families share one definition and can't drift."},"RotateApiKeyRequest":{"properties":{"duration_days":{"type":"integer","maximum":90.0,"minimum":1.0,"title":"Duration Days"}},"type":"object","required":["duration_days"],"title":"RotateApiKeyRequest"},"Run":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"kind":{"type":"string","enum":["conversation","framework"],"title":"Kind"},"status":{"type":"string","enum":["running","paused","completed","failed","timed_out"],"title":"Status"},"channel":{"anyOf":[{"type":"string","enum":["voice","text","sms","email","web"]},{"type":"null"}],"title":"Channel"},"framework":{"anyOf":[{"type":"string","enum":["claude-agent-sdk","openai-agents"]},{"type":"null"}],"title":"Framework"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"entity_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Name"},"service_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Name"},"caller_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Id"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"direction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"},"turn_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Turn Count"},"completion_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completion Reason"},"source_call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Call Sid"},"source_conversation_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Source Conversation Id"},"source_framework_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Source Framework Run Id"},"takeover":{"$ref":"#/components/schemas/TakeoverEligibility","description":"Channel-neutral takeover eligibility, derived from this run's own fields.\n\nA computed field (not a stored one) so eligibility is derived in ONE place and\ncan never drift across the reader's per-source builders — every ``Run``, however\nconstructed, exposes a consistent ``takeover`` on the wire + in OpenAPI.","readOnly":true}},"type":"object","required":["run_id","workspace_id","kind","status","started_at","takeover"],"title":"Run","description":"One item in the canonical unified Runs read model.\n\n``run_id`` is a dedicated UUID (not an overloaded ``call_sid`` / ``conversation_id``);\nthe originating subsystem's ids are kept as ``source_*`` provenance fields so a\nrun can always be traced back to its channel/framework origin. Conversation runs\ncarry a ``channel`` and no ``framework``; framework runs carry a ``framework`` and\nno ``channel`` — enforced below."},"RunAuthoredTurnRequest":{"properties":{"operator_id":{"type":"string","format":"uuid","title":"Operator Id"},"text":{"type":"string","maxLength":4000,"minLength":1,"title":"Text"}},"type":"object","required":["operator_id","text"],"title":"RunAuthoredTurnRequest"},"RunAuthoredTurnResponse":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"staged":{"type":"boolean","title":"Staged"}},"type":"object","required":["run_id","staged"],"title":"RunAuthoredTurnResponse"},"RunGuidanceRequest":{"properties":{"operator_id":{"type":"string","format":"uuid","title":"Operator Id"},"message":{"type":"string","maxLength":5000,"minLength":1,"title":"Message"}},"type":"object","required":["operator_id","message"],"title":"RunGuidanceRequest","description":"Operator guidance for a live run. ``operator_id`` is in the body because this\nrouter is not under ``/operators/{operator_id}`` — it is bound to the authenticated\ncaller by ``_enforce_operator_identity`` (no impersonation)."},"RunGuidanceResponse":{"properties":{"status":{"type":"string","enum":["delivered","queued_no_subscriber","deduplicated","failed","unknown"],"title":"Status","description":"Delivery status"},"run_id":{"type":"string","format":"uuid","title":"Run Id","description":"Run the guidance was sent to"}},"type":"object","required":["status","run_id"],"title":"RunGuidanceResponse"},"RunHandbackRequest":{"properties":{"operator_id":{"type":"string","format":"uuid","title":"Operator Id"}},"type":"object","required":["operator_id"],"title":"RunHandbackRequest"},"RunHandbackResponse":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"success":{"type":"boolean","title":"Success"}},"type":"object","required":["run_id","success"],"title":"RunHandbackResponse"},"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"},"RunSwitchModeRequest":{"properties":{"operator_id":{"type":"string","format":"uuid","title":"Operator Id"},"participant_call_sid":{"type":"string","maxLength":64,"title":"Participant Call Sid"},"mode":{"type":"string","enum":["listen","takeover"],"title":"Mode"}},"type":"object","required":["operator_id","participant_call_sid","mode"],"title":"RunSwitchModeRequest"},"RunSwitchModeResponse":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"mode":{"type":"string","enum":["listen","takeover"],"title":"Mode"}},"type":"object","required":["run_id","mode"],"title":"RunSwitchModeResponse"},"RunTakeoverRequest":{"properties":{"operator_id":{"type":"string","format":"uuid","title":"Operator Id"},"mode":{"type":"string","enum":["listen","takeover"],"title":"Mode","default":"takeover"}},"type":"object","required":["operator_id"],"title":"RunTakeoverRequest"},"RunTakeoverResponse":{"properties":{"run_id":{"type":"string","format":"uuid","title":"Run Id"},"mode":{"type":"string","enum":["listen","takeover"],"title":"Mode"},"participant_call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Call Sid"},"conference_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Conference Sid"}},"type":"object","required":["run_id","mode"],"title":"RunTakeoverResponse"},"RunTrajectoryResponse":{"properties":{"steps":{"items":{"$ref":"#/components/schemas/TrajectoryStep"},"type":"array","title":"Steps"},"truncated":{"type":"boolean","title":"Truncated"}},"type":"object","required":["steps","truncated"],"title":"RunTrajectoryResponse"},"RunsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Run"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"RunsResponse"},"RunsSummaryResponse":{"properties":{"total":{"type":"integer","title":"Total"},"live":{"type":"integer","title":"Live"},"running":{"type":"integer","title":"Running"},"paused":{"type":"integer","title":"Paused"},"completed":{"type":"integer","title":"Completed"},"failed":{"type":"integer","title":"Failed"},"timed_out":{"type":"integer","title":"Timed Out"},"by_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Status"},"by_kind":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Kind"}},"type":"object","required":["total","live","running","paused","completed","failed","timed_out","by_status","by_kind"],"title":"RunsSummaryResponse","description":"Aggregate run counts for the Runs page summary strip.\n\nHonest workspace totals the paginated list cannot derive client-side (it only\nholds the loaded page). ``by_status`` carries the full canonical breakdown\n(incl. any status beyond the named convenience fields); ``by_kind`` splits\nframework vs conversation. ``live`` = running + paused."},"Runtime":{"properties":{"engage_model":{"type":"string","title":"Engage Model","default":""},"channel_kind":{"type":"string","title":"Channel Kind","default":""},"language":{"type":"string","title":"Language","default":""},"caller_context":{"type":"string","title":"Caller Context","default":""}},"type":"object","title":"Runtime"},"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."},"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"},"SchedulingRuleSetListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SchedulingRuleSetResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"SchedulingRuleSetListResponse"},"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."},"SchemaFieldSpec":{"properties":{"name":{"$ref":"#/components/schemas/_FieldName"},"type":{"$ref":"#/components/schemas/IntakeFieldType"}},"type":"object","required":["name","type"],"title":"SchemaFieldSpec"},"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"},"ScopeSpans":{"properties":{"scope":{"$ref":"#/components/schemas/InstrumentationScope"},"spans":{"items":{"$ref":"#/components/schemas/Span"},"type":"array","title":"Spans"}},"type":"object","required":["scope","spans"],"title":"ScopeSpans"},"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","queued_no_subscriber","deduplicated","failed","unknown"],"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},"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"}]},"accepted_context":{"items":{"$ref":"#/components/schemas/ContextKeySpec"},"type":"array","maxItems":100,"title":"Accepted Context"},"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","email","sms","imessage","whatsapp"],"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":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}]},"warm_transfer":{"type":"boolean","title":"Warm Transfer"}},"type":"object","required":["forward_to","warm_transfer"],"title":"ServiceForwardingConfig","description":"Per-service call-forwarding destination + transfer mechanism.\n\nPresence of this block is the whole gate for the ``forward_call`` tool:\nNone means the agent cannot transfer at all. When present, ``forward_to``\npicks the destination mode, and the tool schema follows it — a static\nservice gets an argument-less tool, a dynamic one gets a required\n``phone_number``. Nothing cascades: a service is one mode or the other."},"ServiceListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ServiceResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ServiceListResponse"},"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"},"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"}]},"accepted_context":{"items":{"$ref":"#/components/schemas/ContextKeySpec"},"type":"array","title":"Accepted Context"},"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"]},{"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"},"session_provider":{"anyOf":[{"type":"string","enum":["amigo","gpt_realtime"]},{"type":"null"}],"title":"Session Provider"},"realtime_voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","sage","shimmer","verse","marin","cedar"]},{"type":"null"}],"title":"Realtime Voice","description":"Deprecated built-in OpenAI Realtime voice shortcut. Use realtime.voice instead; the two fields are mutually exclusive.","deprecated":true},"realtime":{"anyOf":[{"$ref":"#/components/schemas/RealtimeSessionConfig"},{"type":"null"}]},"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"]},{"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"},"session_provider":{"anyOf":[{"type":"string","enum":["amigo","gpt_realtime"]},{"type":"null"}],"title":"Session Provider"},"realtime_voice":{"anyOf":[{"type":"string","enum":["alloy","ash","ballad","coral","echo","sage","shimmer","verse","marin","cedar"]},{"type":"null"}],"title":"Realtime Voice","description":"Deprecated built-in OpenAI Realtime voice shortcut. Use realtime.voice instead; the two fields are mutually exclusive.","deprecated":true},"realtime":{"anyOf":[{"$ref":"#/components/schemas/RealtimeSessionConfig"},{"type":"null"}]},"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)."},"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."},"SimCaseAssertionResponse":{"properties":{"eval_key":{"type":"string","maxLength":128,"title":"Eval Key"},"eval_type":{"type":"string","enum":["assertion","metric"],"title":"Eval Type"},"passed":{"type":"integer","title":"Passed","default":0},"failed":{"type":"integer","title":"Failed","default":0},"pending":{"type":"integer","title":"Pending","default":0},"pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pass Rate"},"results":{"items":{"$ref":"#/components/schemas/SimulationEvalResultResponse"},"type":"array","title":"Results"},"checks":{"items":{"$ref":"#/components/schemas/EvaluationResultView"},"type":"array","title":"Checks","description":"Normalized per-check view of ``results`` (metric + assertion verdicts),\nso the console renders each drill-down verdict without parsing raw shapes.","readOnly":true}},"type":"object","required":["eval_key","eval_type","checks"],"title":"SimCaseAssertionResponse"},"SimCasePerfResponse":{"properties":{"case_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Case Id"},"case_name":{"type":"string","maxLength":512,"title":"Case Name"},"pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pass Rate"},"passed":{"type":"integer","title":"Passed","default":0},"measured":{"type":"integer","title":"Measured","default":0},"latest_run_id":{"type":"string","format":"uuid","title":"Latest Run Id"},"latest_run_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Run At"},"assertions":{"items":{"$ref":"#/components/schemas/SimCaseAssertionResponse"},"type":"array","title":"Assertions"}},"type":"object","required":["case_name","latest_run_id"],"title":"SimCasePerfResponse"},"SimMetricPerfResponse":{"properties":{"metric_key":{"type":"string","maxLength":128,"title":"Metric Key"},"label":{"type":"string","maxLength":128,"title":"Label"},"per_run":{"items":{"$ref":"#/components/schemas/SimMetricRunPointResponse"},"type":"array","title":"Per Run"},"results":{"items":{"$ref":"#/components/schemas/SimulationEvalResultResponse"},"type":"array","title":"Results"},"checks":{"items":{"$ref":"#/components/schemas/EvaluationResultView"},"type":"array","title":"Checks","description":"Normalized per-check view of ``results`` (mirrors SimCaseAssertionResponse)\nso the console renders each metric drill-down verdict without parsing raw shapes.","readOnly":true}},"type":"object","required":["metric_key","label","checks"],"title":"SimMetricPerfResponse"},"SimMetricRunPointResponse":{"properties":{"at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"At"},"value":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Value"},"passed":{"type":"integer","title":"Passed","default":0},"measured":{"type":"integer","title":"Measured","default":0}},"type":"object","title":"SimMetricRunPointResponse","description":"One run's contribution to a metric: the mean value that run (null for\nnon-numeric metrics) plus how many conversations passed / were measured."},"SimPerformanceOverviewResponse":{"properties":{"overall_pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Overall Pass Rate"},"evals_run":{"type":"integer","title":"Evals Run","default":0},"needs_attention_count":{"type":"integer","title":"Needs Attention Count","default":0},"runs_analyzed":{"type":"integer","title":"Runs Analyzed","default":0}},"type":"object","title":"SimPerformanceOverviewResponse"},"SimSuitePerfResponse":{"properties":{"suite_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Suite Id"},"suite_name":{"type":"string","maxLength":512,"title":"Suite Name"},"pass_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pass Rate"},"passed":{"type":"integer","title":"Passed","default":0},"measured":{"type":"integer","title":"Measured","default":0},"latest_run_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Latest Run At"},"cases":{"items":{"$ref":"#/components/schemas/SimCasePerfResponse"},"type":"array","title":"Cases"}},"type":"object","required":["suite_name"],"title":"SimSuitePerfResponse"},"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"},"error":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Error"},"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."},"SimulationCaseListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SimulationCaseResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"SimulationCaseListResponse"},"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"},"justification":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Justification"},"references":{"items":{"type":"integer"},"type":"array","maxItems":100,"title":"References"},"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"},"SimulationPerformanceResponse":{"properties":{"overview":{"$ref":"#/components/schemas/SimPerformanceOverviewResponse"},"metrics":{"items":{"$ref":"#/components/schemas/SimMetricPerfResponse"},"type":"array","title":"Metrics"},"by_case":{"items":{"$ref":"#/components/schemas/SimCasePerfResponse"},"type":"array","title":"By Case"},"by_suite":{"items":{"$ref":"#/components/schemas/SimSuitePerfResponse"},"type":"array","title":"By Suite"}},"type":"object","required":["overview"],"title":"SimulationPerformanceResponse","description":"Aggregated Simulations overview: one request in place of the console's\nformer one-detail-fetch-per-run fan-out."},"SimulationProxyErrorResponse":{"properties":{"detail":{"anyOf":[{"type":"string"},{"items":{"additionalProperties":true,"type":"object"},"type":"array"}],"title":"Detail"}},"type":"object","required":["detail"],"title":"SimulationProxyErrorResponse","description":"Error envelope for simulation routes that proxy agent-engine.\n\n``detail`` is a string for forwarded runtime/configuration errors and a\nstructured list for FastAPI request validation failures. Both share HTTP\n422, so the published contract must admit both shapes."},"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"},"error":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Error"},"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},"checks":{"items":{"$ref":"#/components/schemas/EvaluationResultView"},"type":"array","title":"Checks","description":"Normalized per-check view of ``eval_results``. Raw ``eval_results``\nstay intact; this rides alongside so the console renders checks without\nreverse-engineering actual.latest vs actual.judge vs score.","readOnly":true}},"type":"object","required":["id","service_id","status","checks"],"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"},"expected_case_count":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Expected Case Count"},"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"},"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"},"SkillListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SkillResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"SkillListResponse"},"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":[{"$ref":"#/components/schemas/ThinkingEffort"},{"type":"null"}]},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature"},"top_p":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Top P"},"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","temperature","top_p","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"},"SourceEventListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SourceEventItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"SourceEventListResponse"},"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":["ehr","fhir_store","snowflake"],"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":["ehr","fhir_store","snowflake"],"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":["ehr","fhir_store","snowflake"],"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"},"SourceSyncResponse":{"properties":{"batches":{"items":{"$ref":"#/components/schemas/SyncBatchRow"},"type":"array","title":"Batches"}},"type":"object","required":["batches"],"title":"SourceSyncResponse"},"Span":{"properties":{"traceId":{"type":"string","title":"Traceid"},"spanId":{"type":"string","title":"Spanid"},"name":{"type":"string","title":"Name"},"kind":{"type":"integer","title":"Kind"},"startTimeUnixNano":{"type":"string","title":"Starttimeunixnano"},"endTimeUnixNano":{"type":"string","title":"Endtimeunixnano"},"attributes":{"items":{"$ref":"#/components/schemas/KeyValue"},"type":"array","title":"Attributes"},"status":{"$ref":"#/components/schemas/Status"}},"type":"object","required":["traceId","spanId","name","kind","startTimeUnixNano","endTimeUnixNano","attributes","status"],"title":"Span","description":"OTLP ``Span`` in OTLP/JSON encoding (ids hex, timestamps decimal-string)."},"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_synced 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"},"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."},"Status":{"properties":{"code":{"type":"integer","title":"Code"}},"type":"object","required":["code"],"title":"Status","description":"OTLP ``Status`` — 0=UNSET, 1=OK, 2=ERROR."},"StatusWriteBackRequest":{"properties":{"status":{"$ref":"#/components/schemas/_FileStatus"},"error_reason":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Error Reason"},"curated_path":{"anyOf":[{"$ref":"#/components/schemas/_VolumePath"},{"type":"null"}]},"cdc_path":{"anyOf":[{"$ref":"#/components/schemas/_VolumePath"},{"type":"null"}]}},"type":"object","required":["status"],"title":"StatusWriteBackRequest","description":"Status advance written by the async CDC job (P4).\n\nThe job posts the terminal verdict after conform/validate/diff. ``error_reason``\nmust be PHI-safe (the engine reports column + type + counts only — never cell\nvalues). ``curated_path``/``cdc_path`` are set only on a clean verdict."},"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"},"authorization_binding":{"anyOf":[{"$ref":"#/components/schemas/RoleGrantKeysBinding"},{"type":"null"}]},"authorization_binding_test_value":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Authorization Binding Test Value","description":"Canonical CSV resource keys used only by trusted playground execution when no live authorization block exists."}},"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."},"SurfaceListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SurfaceResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"SurfaceListResponse"},"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"},"review_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Notes"},"reviewed_by":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Reviewed By"},"reviewed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reviewed At"},"archived_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Archived At"},"archive_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Archive Reason"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"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."},"SwitchChannelRequest":{"properties":{"channel":{"$ref":"#/components/schemas/ChannelKind","description":"Target channel to move the conversation to (sms or imessage)."},"recipient":{"anyOf":[{"$ref":"#/components/schemas/PhoneE164"},{"type":"null"}],"description":"Recipient address on the new channel (E.164). Required for sms/imessage."},"use_case_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Use Case Id","description":"Channel-manager use case for the new channel (resolves the sender). Required for sms/imessage."},"reason":{"$ref":"#/components/schemas/NameString","description":"Why the conversation is being moved (e.g. escalation, customer_request)."},"dispatch_opener":{"type":"boolean","title":"Dispatch Opener","description":"If true, immediately drive one agent turn on the new channel (e.g. 'I'll text you now').","default":false},"instruction":{"anyOf":[{"$ref":"#/components/schemas/BackgroundString"},{"type":"null"}],"description":"Optional context steering the opener when dispatch_opener=true."}},"type":"object","required":["channel","reason"],"title":"SwitchChannelRequest"},"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"},"SyncBatchRow":{"properties":{"batch_id":{"type":"string","format":"uuid","title":"Batch Id"},"dataset":{"type":"string","title":"Dataset"},"files_found":{"type":"integer","title":"Files Found"},"status":{"type":"string","title":"Status"}},"type":"object","required":["batch_id","dataset","files_found","status"],"title":"SyncBatchRow","description":"One batch produced by a source sync (one per mapped folder/dataset)."},"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."},"TakeoverEligibility":{"properties":{"eligible":{"type":"boolean","title":"Eligible"},"mode_options":{"items":{"type":"string","enum":["listen","takeover"]},"type":"array","title":"Mode Options","default":[]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["eligible"],"title":"TakeoverEligibility","description":"Whether an operator can take a run over, and how — the channel-neutral signal the\nconsole keys on instead of a per-channel heuristic.\n\n``eligible`` = an operator may take this run over right now. ``mode_options`` = the\ntakeover modes valid for the run's channel (voice exposes ``listen`` + ``takeover``;\nenumerated asynchronous channels expose authored-turn ``takeover`` only).\n``reason`` = a short, human-facing explanation when NOT eligible (e.g.\n``\"run is not live\"``, ``\"channel not yet supported\"``), so the console can\nrender an honest disabled-state tooltip rather than a bare greyed button.\nServer-computed (see ``Run.takeover``) so eligibility rules live in one place and the\nconsole never re-derives them."},"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"},"TestCredentialIdsRequest":{"properties":{"credential_ids":{"items":{"type":"string","format":"uuid"},"type":"array","maxItems":100,"title":"Credential Ids"}},"type":"object","required":["credential_ids"],"title":"TestCredentialIdsRequest"},"TestCredentialIdsResponse":{"properties":{"credential_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Credential Ids"}},"type":"object","required":["credential_ids"],"title":"TestCredentialIdsResponse"},"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"},"ThinkingEffort":{"type":"string","enum":["low","medium","high"]},"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","ephemeral"],"title":"Result Persistence","description":"How this tool call's arguments and result are retained. 'ephemeral' is fail-closed: Platform API authoring must be enabled for the workspace, and Agent Engine honors it only on the inline text/simulation path — voice, background, and external-realtime sessions reject an ephemeral graph at init rather than journal it.","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"},"lifecycle":{"type":"string","enum":["coupled","independent"],"title":"Lifecycle","default":"independent"},"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."},"ToolCatalogResponse":{"properties":{"tools":{"items":{"$ref":"#/components/schemas/ResolvedToolItem"},"type":"array","title":"Tools"}},"type":"object","required":["tools"],"title":"ToolCatalogResponse"},"ToolDescriptor":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description","default":""},"input_schema":{"additionalProperties":true,"type":"object","title":"Input Schema","default":{}}},"type":"object","required":["name"],"title":"ToolDescriptor"},"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."},"Tools":{"properties":{"descriptors":{"items":{"$ref":"#/components/schemas/ToolDescriptor"},"type":"array","title":"Descriptors","default":[]},"read_tool_names":{"items":{"type":"string"},"type":"array","title":"Read Tool Names","default":[]},"write_tool_names":{"items":{"type":"string"},"type":"array","title":"Write Tool Names","default":[]}},"type":"object","title":"Tools","description":"Discovery hint — the neutral descriptors. NOT the enforcement (the MCP\nedge is; a remote agent discovers live schemas from the server too)."},"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_synced 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_synced 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"}]},"TracesExportRequest":{"properties":{"start_time":{"type":"string","format":"date-time","title":"Start Time","description":"Inclusive lower bound on span ``effective_at`` (ISO-8601)."},"end_time":{"type":"string","format":"date-time","title":"End Time","description":"Exclusive upper bound on span ``effective_at`` (ISO-8601)."},"limit":{"type":"integer","maximum":1000.0,"exclusiveMinimum":0.0,"title":"Limit","description":"Max spans per page (1-1000).","default":500},"continuation_token":{"title":"Continuation Token","description":"Opaque page cursor — round-trip the value from the previous response."}},"type":"object","required":["start_time","end_time"],"title":"TracesExportRequest"},"TracesExportResponse":{"properties":{"resourceSpans":{"items":{"$ref":"#/components/schemas/ResourceSpans"},"type":"array","title":"Resourcespans","description":"OTLP/JSON ``ResourceSpans`` envelope (empty list when no spans match)."},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["resourceSpans","has_more"],"title":"TracesExportResponse","description":"Paginated PULL response — NOT a bare OTLP ``ExportTraceServiceRequest``.\n\n``resourceSpans`` is OTLP/JSON-conformant; to forward to an OTLP collector,\nextract ``.resourceSpans`` and re-wrap as ``{\"resourceSpans\": [...]}`` (a\nstrict protojson push receiver rejects the ``has_more``/``continuation_token``\nsiblings). Round-trip ``continuation_token`` to page."},"TrajectoryStep":{"properties":{"seq":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seq"},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"},"actor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"},"tool_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Name"},"tool_input_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Input Summary"},"tool_result_summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tool Result Summary"},"tool_succeeded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Tool Succeeded"},"decision_from_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision From State"},"decision_to_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Decision To State"},"effective_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Effective At"}},"type":"object","title":"TrajectoryStep","description":"One structural step of a framework run's trajectory. Fields are best-effort\n(only those the step actually carries are present), all optional, and free ``str``\nfor the same read-model resilience the ``Run`` descriptive fields use."},"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":{"anyOf":[{"type":"number"},{"type":"null"}],"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"},"TriggerListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TriggerResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"TriggerListResponse"},"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"},"TriggerRunListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TriggerRunResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"TriggerRunListResponse"},"TriggerRunResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"trigger_id":{"type":"string","format":"uuid","title":"Trigger Id"},"fired_event_id":{"type":"string","format":"uuid","title":"Fired Event Id"},"source":{"type":"string","enum":["cron","manual","webhook","event"],"title":"Source","description":"Source that fired the trigger"},"input_override":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Input Override","description":"Per-run input overrides"},"status":{"type":"string","enum":["queued","running","succeeded","failed","dead"],"title":"Status","description":"Run status"},"attempt_count":{"type":"integer","title":"Attempt Count","description":"Number of claim attempts"},"max_attempts":{"type":"integer","title":"Max Attempts","description":"Maximum claim attempts before dead-lettering"},"next_attempt_at":{"type":"string","format":"date-time","title":"Next Attempt At","description":"Next eligible claim time"},"claimed_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Claimed By","description":"Dispatcher consumer that claimed the run"},"claimed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Claimed At","description":"When the run was claimed"},"lease_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Lease Expires At","description":"When the running lease expires"},"result_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Result Text","description":"Text result emitted by the action"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Failure detail, if any"},"created_at":{"type":"string","format":"date-time","title":"Created At","description":"When the run was enqueued"},"updated_at":{"type":"string","format":"date-time","title":"Updated At","description":"When the run row last changed"}},"type":"object","required":["id","workspace_id","trigger_id","fired_event_id","source","status","attempt_count","max_attempts","next_attempt_at","created_at","updated_at"],"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"},"TriggerableEvent":{"type":"string","enum":["amigo.trigger.cron","appointment.booked","appointment.cancelled","appointment.confirmed","booking.requested","call.ended","call.intelligence","call.outcome","channel.message.received","conversation.channel_switched","conversation.started","conversation.turn_recorded","coverage.created","entity.enriched","entity.resolved","medication.refill_requested","outbound.initiated","outbound.scheduled","patient.created","patient.updated","relationship.established","review.approve","review.correct","review.reject","surface.created","surface.submitted","ticket.created","triage.completed","trigger.completed","trigger.failed","trigger.fired"],"title":"TriggerableEvent","description":"Closed set of world events that trigger definitions may subscribe to.\n\nThe database column intentionally remains text for compatibility with old\nrows, but API writes must choose from this list so typoed event names do\nnot silently create never-matching triggers."},"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","paused"],"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"},"TurnDelivery":{"properties":{"delivery_id":{"type":"string","format":"uuid","title":"Delivery Id","description":"Stable identifier for this background delivery."},"request_id":{"type":"string","format":"uuid","title":"Request Id","description":"Stable poll request identifier bound to this claim."},"receipt":{"type":"string","format":"uuid","title":"Receipt","description":"Opaque receipt required to acknowledge this delivery."}},"type":"object","required":["delivery_id","request_id","receipt"],"title":"TurnDelivery"},"TurnDeliveryAckRequest":{"properties":{"request_id":{"type":"string","format":"uuid","title":"Request Id"},"receipt":{"type":"string","format":"uuid","title":"Receipt"}},"additionalProperties":false,"type":"object","required":["request_id","receipt"],"title":"TurnDeliveryAckRequest"},"TurnPolicy":{"properties":{"barge_in_enabled":{"type":"boolean","title":"Barge In Enabled","default":true},"safety_response":{"type":"string","enum":["suspend_forward","stay_empathize","alert"],"title":"Safety Response","default":"stay_empathize"},"context_strategy":{"type":"string","enum":["full","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"},"wait_for_final":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Wait For Final","description":"Synchronous callers only: when a turn hands work to a background tool (``background_pending``), await the real answer inline (bounded, ~30s) instead of returning the acknowledgement immediately. On completion the response carries the final answer with ``background_pending=false``; on timeout it returns ``background_pending=true`` — resolve it later with ``poll=true``. ``null`` (default) inherits the channel policy (web = do not wait). Ignored with ``poll=true`` (422)."},"suppress_filler":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Suppress Filler","description":"Synchronous callers only: when a turn ends ``background_pending``, omit the filler/acknowledgement text from ``output`` so a batch caller never mistakes the ack for the answer (``output`` is empty; ``background_pending=true`` is the poll-later signal). ``null`` (default) inherits the channel policy. Ignored with ``poll=true`` (422)."}},"type":"object","title":"TurnRequest"},"TurnResponse":{"properties":{"turn_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Turn Id","description":"Identifier of the user exchange this turn created — or, for ``poll=true`` and greeting-kickoff turns (empty ``message``), the exchange the returned messages attach to. A background delivery keeps the originating exchange even when later user turns already exist. Deterministic: matches the ``turn_id`` on this conversation's history turns, so it can anchor durable per-turn artifacts (e.g. feedback) across page reloads. Null only when the conversation has no user exchange yet (a poll or kickoff before the first user message)."},"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":[]},"artifacts":{"items":{"$ref":"#/components/schemas/ClientArtifact"},"type":"array","title":"Artifacts","default":[]},"conversation":{"$ref":"#/components/schemas/TurnConversationSnapshot"},"background_pending":{"type":"boolean","title":"Background Pending","description":"Whether this turn's ``output`` is the final answer, or only an acknowledgement that\nwork is still running in the background.\n\n``false`` (default): ``output`` is the complete agent response for this turn.\n\n``true``: a tool crossed the server's blocking window and was handed to a background\ntask, so ``output`` is NOT the final answer — the definitive assistant answer is\nproduced later, out-of-band. Under delivery protocol v2, collect it by re-issuing\n``POST …/turns`` with ``poll=true`` (a no-message, receipt-backed claim), render or\ndurably persist the returned answer, then acknowledge its exact delivery receipt.\nThis is the per-conversation delivery contract — see\nthe web-integration paved path. (The workspace observer bus,\n``GET /v1/{workspace_id}/events/stream``, mirrors this activity as ``text.agent_message``\n/ ``text.tool_started`` / ``text.background_result`` for *dashboards* watching many\nconversations, but is not the per-chat delivery path.) A client that treats a\n``background_pending=true`` turn as complete without polling and acknowledging will\nmiss the final answer.","default":false},"delivery":{"anyOf":[{"$ref":"#/components/schemas/TurnDelivery"},{"type":"null"}],"description":"Receipt for a background result returned by ``poll=true``. Render the response successfully, then acknowledge this delivery. Null for ordinary turns and idle/pending polls."},"delivery_protocol_version":{"anyOf":[{"type":"integer","const":2},{"type":"null"}],"title":"Delivery Protocol Version","description":"Version of the durable background-delivery protocol supported by the serving agent. Clients may retry polls only after observing version 2."}},"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"},"UpdateContextGraphRequest":{"properties":{"name":{"anyOf":[{"$ref":"#/components/schemas/NameString"},{"type":"null"}]},"description":{"anyOf":[{"$ref":"#/components/schemas/DescriptionString"},{"type":"null"}]}},"type":"object","title":"UpdateContextGraphRequest"},"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"},"UpdateProductionEvalDefinitionRequest":{"properties":{"service_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Service Id"},"eval_key":{"anyOf":[{"type":"string","maxLength":128,"minLength":1},{"type":"null"}],"title":"Eval Key"},"eval_type":{"anyOf":[{"type":"string","enum":["assertion","metric"]},{"type":"null"}],"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"},"expected":{"title":"Expected"},"params":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Params"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},"type":"object","title":"UpdateProductionEvalDefinitionRequest"},"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"},"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"}]},"accepted_context":{"anyOf":[{"items":{"$ref":"#/components/schemas/ContextKeySpec"},"type":"array","maxItems":100},{"type":"null"}],"title":"Accepted Context"}},"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":[{"$ref":"#/components/schemas/ThinkingEffort"},{"type":"null"}]},"temperature":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Temperature","description":"Anthropic sampling temperature (0-1); see CreateSkillRequest. null/absent leaves it unchanged."},"top_p":{"anyOf":[{"type":"number","maximum":1.0,"minimum":0.0},{"type":"null"}],"title":"Top P","description":"Anthropic nucleus sampling (0-1); see CreateSkillRequest. null/absent leaves it unchanged."},"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/TriggerableEvent"},{"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"}]},"topic_modeling_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Topic Modeling Enabled"},"delta_sharing_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Delta Sharing Enabled"},"delta_sharing_mode":{"type":"string","enum":["open","databricks"],"title":"Delta Sharing Mode"},"delta_sharing_identifier":{"type":"string","maxLength":512,"minLength":1,"title":"Delta Sharing Identifier"},"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"},"UpsertRequest":{"properties":{"source":{"type":"string","maxLength":128,"minLength":1,"title":"Source"},"external_subject_key":{"type":"string","maxLength":512,"minLength":1,"title":"External Subject Key"},"external_subject_id":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"External Subject Id"},"entity_id":{"type":"string","format":"uuid","title":"Entity Id"},"display_name":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Display Name"},"roles":{"items":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9_]{0,63}$"},"type":"array","maxItems":64,"title":"Roles"},"roles_verified":{"type":"boolean","title":"Roles Verified","default":false},"provisioned_via":{"type":"string","enum":["roster_sync","jit"],"title":"Provisioned Via"}},"additionalProperties":false,"type":"object","required":["source","external_subject_key","entity_id","provisioned_via"],"title":"UpsertRequest"},"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"},"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"]},{"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"},"session_provider":{"anyOf":[{"type":"string","enum":["amigo","gpt_realtime"]},{"type":"null"}],"title":"Session Provider"}},"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"},"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"},"stt_provider":{"anyOf":[{"type":"string","enum":["deepgram","openai","cartesia"]},{"type":"null"}],"title":"Stt Provider"},"tts_provider":{"anyOf":[{"type":"string","enum":["cartesia","elevenlabs"]},{"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"},"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"},"stt_provider":{"anyOf":[{"type":"string","enum":["deepgram","openai","cartesia"]},{"type":"null"}],"title":"Stt Provider"},"tts_provider":{"anyOf":[{"type":"string","enum":["cartesia","elevenlabs"]},{"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","pronunciation_dict_id","sensitive_topics","post_call_analysis_enabled","transcript_correction_enabled","stt_provider","tts_provider","tts_config"],"title":"VoiceSettingsResponse","description":"Voice experience state — what the PM configured."},"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."},"WorkspaceListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/WorkspaceResponse"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"WorkspaceListResponse"},"WorkspaceResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"slug":{"type":"string","title":"Slug"},"name":{"type":"string","title":"Name"},"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"},"topic_modeling_enabled":{"type":"boolean","title":"Topic Modeling Enabled"},"delta_sharing_enabled":{"type":"boolean","title":"Delta Sharing Enabled"},"delta_sharing_mode":{"type":"string","enum":["open","databricks"],"title":"Delta Sharing Mode"},"delta_sharing_identifier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delta Sharing Identifier"},"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","backend_org_id","region","connector_type","topic_modeling_enabled","delta_sharing_enabled","delta_sharing_mode","delta_sharing_identifier","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"},"WorldScope":{"properties":{"workspace_id":{"type":"string","format":"uuid","title":"Workspace Id"},"scoped_entity_ids":{"items":{"type":"string","format":"uuid"},"type":"array","title":"Scoped Entity Ids","default":[]},"allow_create":{"type":"boolean","title":"Allow Create","default":false}},"type":"object","required":["workspace_id"],"title":"WorldScope","description":"The world slice — ids only (the leaf stays I/O-free). This is the\nread/subject scope, NOT the write bound (see ``write_floor``).\n``allow_create`` records context intent and is not an authorization grant."},"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"},"WriteFloor":{"properties":{"enforced_at":{"type":"string","title":"Enforced At","default":"mcp-world-tools-edge"},"requires_entity_anchor":{"type":"boolean","title":"Requires Entity Anchor","default":true},"clinical_write_principal":{"type":"string","title":"Clinical Write Principal","default":"provider-only"},"clinical_write_scope":{"type":"string","title":"Clinical Write Scope","default":"any-entity-in-workspace"},"enrichment_write_scope":{"type":"string","title":"Enrichment Write Scope","default":"caller-anchor-only"},"unanchored_or_api_key_writes":{"type":"string","title":"Unanchored Or Api Key Writes","default":"none"},"allow_create":{"type":"boolean","title":"Allow Create","default":false}},"type":"object","title":"WriteFloor","description":"A static summary of MCP write policy, advisory to the renderer.\n\nThe MCP edge resolves the caller's actual principal and enforces the\nresult. These fields do not grant write access; hosted runner credentials\nare currently unanchored and cannot perform provider-only clinical writes."},"_Access":{"type":"string","enum":["read","write"]},"_AgentSortField":{"type":"string","enum":["name","created_at","updated_at"]},"_DatasetSlug":{"type":"string","maxLength":63,"minLength":2,"pattern":"^[a-z0-9][a-z0-9_-]*[a-z0-9]$"},"_DatasetUpdateStatus":{"type":"string","enum":["checking_drive","preparing","publishing","completed","needs_review","failed"]},"_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``."},"_FieldName":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z_][A-Za-z0-9_]*$"},"_FileStatus":{"type":"string","enum":["received","scanned","processing","curated","rejected","failed","held"]},"_FileType":{"type":"string","maxLength":16,"minLength":1,"pattern":"^[a-z0-9]+$"},"_ResourceType":{"type":"string","enum":["integration_endpoint","skill","kb_scope"]},"_SourceEventSortField":{"type":"string","enum":["ingested_at","event_type","confidence"]},"_ToolMockKey":{"type":"string","maxLength":128,"minLength":1},"_ToolMockValue":{"type":"string","maxLength":16384},"_VolumePath":{"type":"string","maxLength":1024,"minLength":1,"pattern":"^[A-Za-z0-9/._-]+$"},"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"},"authorization_binding":{"anyOf":[{"$ref":"#/components/schemas/RoleGrantKeysBinding"},{"type":"null"}]},"authorization_binding_test_value":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Authorization Binding Test Value","description":"Canonical CSV resource keys used only by trusted function-test or playground execution when no live authorization block exists."}},"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__api_keys___SortField":{"type":"string","const":"created_at"},"src__routes__audit__AuditEventResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id","description":"Unique audit event identifier"},"workspace_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Workspace Id","description":"Workspace that owns this event; null for pre-workspace events (e.g. login)"},"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":{"anyOf":[{"type":"string"},{"type":"null"}],"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","timestamp","service","action"],"title":"AuditEventResponse"},"src__routes__context_graphs__context_graph_crud___SortField":{"type":"string","enum":["name","created_at","updated_at"]},"src__routes__external_auth_claim_mappings__CreateRequest":{"properties":{"claim_namespace":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9_.:-]{0,63}$","title":"Claim Namespace"},"claim_key":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9_.:-]{0,63}$","title":"Claim Key"},"external_value":{"type":"string","maxLength":256,"minLength":1,"title":"External Value"},"external_role_id":{"type":"string","format":"uuid","title":"External Role Id"}},"additionalProperties":false,"type":"object","required":["claim_namespace","claim_key","external_value","external_role_id"],"title":"CreateRequest"},"src__routes__external_auth_claim_mappings__ListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ClaimMappingItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ListResponse"},"src__routes__external_auth_claim_mappings___SortField":{"type":"string","const":"created_at"},"src__routes__external_identity_bindings___SortField":{"type":"string","enum":["created_at","external_subject_key"]},"src__routes__external_integrations___SortField":{"type":"string","enum":["created_at","name","updated_at"]},"src__routes__external_role_assignments__ListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ExternalRoleAssignmentItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ListResponse"},"src__routes__external_role_assignments___SortField":{"type":"string","enum":["created_at","external_subject_key"]},"src__routes__external_roles__CreateRequest":{"properties":{"name":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[a-z][a-z0-9_]{0,63}$","title":"Name"},"external_name":{"type":"string","maxLength":256,"minLength":1,"title":"External Name"},"description":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Description"}},"additionalProperties":false,"type":"object","required":["name","external_name"],"title":"CreateRequest"},"src__routes__external_roles__ListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ExternalRoleItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ListResponse"},"src__routes__external_roles___SortField":{"type":"string","const":"created_at"},"src__routes__external_write_proposals___SortField":{"type":"string","const":"created_at"},"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."},"client_output":{"anyOf":[{"$ref":"#/components/schemas/ClientOutputConfig"},{"type":"null"}],"description":"Optional external-user-safe output contract. Uses response_template as its projection."},"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},"managed":{"type":"boolean","title":"Managed","description":"Whether this is a system-managed integration protected from workspace CRUD.","default":false},"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 — the AUTH-ONLY channel.\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.\n\nPLA-980: these values resolve the token exchange but are STRIPPED before the\ndownstream endpoint request is built, so a pure-auth secret put here never\nechoes into the outbound body/query. A param that legitimately feeds BOTH the\nexchange and the endpoint call belongs in ``params`` (which keeps its existing\ndual-use behavior). ``auth_params`` is for pure-auth keys absent from ``params``;\non a key collision the ``params`` value wins (for both the exchange and the call)."}},"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."},"artifact":{"anyOf":[{"$ref":"#/components/schemas/ClientArtifact"},{"type":"null"}],"description":"Client artifact preview after JSON Schema and size validation."},"artifact_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Artifact Error","description":"Safe validation summary when client output is enabled but cannot be emitted."}},"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)."},"client_output":{"anyOf":[{"$ref":"#/components/schemas/ClientOutputConfig"},{"type":"null"}],"title":"Client Output","description":"Client output contract; pass `null` to disable external artifact delivery."},"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."},"managed":{"type":"boolean","title":"Managed","description":"Mark/unmark the integration as system-managed. Requires ``platform:admin`` scope."},"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__production_evals___SortField":{"type":"string","const":"created_at"},"src__routes__role_grants__CreateRequest":{"properties":{"role_id":{"type":"string","format":"uuid","title":"Role Id"},"resource_type":{"$ref":"#/components/schemas/_ResourceType"},"resource_key":{"type":"string","maxLength":512,"minLength":1,"title":"Resource Key"},"access":{"$ref":"#/components/schemas/_Access"},"param_binding":{"anyOf":[{"type":"string","maxLength":256},{"type":"null"}],"title":"Param Binding"}},"additionalProperties":false,"type":"object","required":["role_id","resource_type","resource_key","access"],"title":"CreateRequest"},"src__routes__role_grants__ListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/RoleGrantItem"},"type":"array","title":"Items"},"has_more":{"type":"boolean","title":"Has More"},"continuation_token":{"title":"Continuation Token"}},"type":"object","required":["items","has_more"],"title":"ListResponse"},"src__routes__role_grants___SortField":{"type":"string","const":"created_at"},"src__routes__runs___SortField":{"type":"string","const":"started_at"},"src__routes__scheduling_rule_sets___SortField":{"type":"string","enum":["agent_kind","rule_kind"]},"src__routes__services___SortField":{"type":"string","enum":["name","created_at","updated_at"]},"src__routes__skills___SortField":{"type":"string","enum":["name","created_at","updated_at","slug"]},"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"},"authorization_binding":{"anyOf":[{"$ref":"#/components/schemas/RoleGrantKeysBinding"},{"type":"null"}]},"authorization_binding_test_value":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Authorization Binding Test Value","description":"Canonical CSV resource keys used only by trusted playground execution when no live authorization block exists."}},"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__list_workspace_data_queries___SortField":{"type":"string","const":"deployed_at"},"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"},"authorization_binding":{"anyOf":[{"$ref":"#/components/schemas/RoleGrantKeysBinding"},{"type":"null"}]},"authorization_binding_test_value":{"anyOf":[{"type":"string","maxLength":2048},{"type":"null"}],"title":"Authorization Binding Test Value","description":"Canonical CSV resource keys used only by trusted playground execution when no live authorization block exists."}},"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"},"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"},"TextAgentMessageEvent":{"description":"An agent text turn pushed live over workspace SSE — the outbox of the\ndurable text-conversation actor (text-conversation-actor Stage A).\n\nWhere ``TextBackgroundResultEvent`` surfaces the raw tool card,\nthis carries the agent's *narrated* response (the turn the actor produces after\nre-entering on a background completion or other off-request signal), so a\nsubscribed web client renders it as a normal agent message with no polling and\nno user turn. ``conversation_id`` is the durable conversation UUID (web-only).","properties":{"event_type":{"const":"text.agent_message","default":"text.agent_message","title":"Event Type","type":"string"},"conversation_id":{"format":"uuid","title":"Conversation Id","type":"string"},"text":{"title":"Text","type":"string"},"delivery_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"default":null,"title":"Delivery Id"}},"required":["conversation_id","text"],"title":"TextAgentMessageEvent","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"},"TextToolStartedEvent":{"description":"A slow text tool *began* running for a web text conversation — pushed live\nthe instant the tool is dispatched, before the 15s blocking floor elapses, so a\nsubscribed client shows progress immediately instead of waiting out the floor in\nsilence (PLA-986). Emitted for tools that route through the background/floor-promoted\ndispatch paths (companion skills and ``execution=\"background\"`` tools) — the ones\nthat can outlast the turn's synchronous response.\n\nThe start/completion pair share one card identity: ``call_id`` is ``bg:<task_id>``,\nmatching the eventual ``TextBackgroundResultEvent`` (and the next-turn drained card\nfrom ``build_background_completion_effect``), so a client collapses started → result\ninto one card rather than rendering two. Web-only: ``conversation_id`` is the durable\nconversation UUID (non-web channels route by a composite key and deliver via their own\ntransport).","properties":{"event_type":{"const":"text.tool_started","default":"text.tool_started","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"},"depth":{"title":"Depth","type":"integer"}},"required":["conversation_id","tool_name","call_id","depth"],"title":"TextToolStartedEvent","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","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.agent_message":"#/components/schemas/TextAgentMessageEvent","text.background_result":"#/components/schemas/TextBackgroundResultEvent","text.completed":"#/components/schemas/TextCompletedEvent","text.started":"#/components/schemas/TextStartedEvent","text.tool_started":"#/components/schemas/TextToolStartedEvent","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/TextToolStartedEvent"},{"$ref":"#/components/schemas/TextBackgroundResultEvent"},{"$ref":"#/components/schemas/TextAgentMessageEvent"},{"$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"}]},"ActorAllocatedEvent":{"description":"The call was bound to its isolated runtime — one call = one Agones GameServer.\n\nEmitted by the dispatcher the moment it allocates a warm GameServer for the call,\nso an observer can see WHICH pod/node powers this call and how long allocation took.","properties":{"type":{"const":"actor_allocated","default":"actor_allocated","title":"Type","type":"string"},"gameserver":{"maxLength":256,"title":"Gameserver","type":"string"},"node":{"anyOf":[{"maxLength":256,"type":"string"},{"type":"null"}],"default":null,"title":"Node"},"alloc_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Alloc Latency Ms"}},"required":["gameserver"],"title":"ActorAllocatedEvent","type":"object"},"ActorShutdownEvent":{"description":"The call's GameServer was reaped (Allocated GameServers are deploy-immune).\n\nToday only ``reason=call_ended`` is produced (normal call-end teardown).\n``orphan_no_media`` is reserved in the contract for the orphan reaper — a pod that\nwent Allocated but never received media — but that emit is not yet wired: at reap\ntime the reaper pod has no call identity (allocation is cross-pod), so plumbing the\ncall_sid to it is a follow-up. The value is pre-declared so adding it later is a\nnon-breaking widening for SDK consumers, not a breaking enum change.","properties":{"type":{"const":"actor_shutdown","default":"actor_shutdown","title":"Type","type":"string"},"reason":{"default":"call_ended","enum":["call_ended","orphan_no_media"],"title":"Reason","type":"string"},"lifetime_s":{"anyOf":[{"type":"number"},{"type":"null"}],"default":null,"title":"Lifetime S"}},"title":"ActorShutdownEvent","type":"object"},"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"},"MediaAttachedEvent":{"description":"A media WebSocket actually reached the call's GameServer — the audio-path signal.\n\nFires once per leg (caller / agent). Its ABSENCE for a leg is the no-audio failure\nmode (media never landed on the pod). The per-call cold-start / time-to-first-speech\nmetric is deliberately NOT carried here yet: TTFS is measured against the first\nsynthesized-audio frame, a signal not available at attach time, so it is wired in a\nfocused follow-up (Front 3) rather than shipped as a permanently-null field that would\nlock a misleading shape into the SDK contract.","properties":{"type":{"const":"media_attached","default":"media_attached","title":"Type","type":"string"},"leg":{"enum":["caller","agent","operator"],"title":"Leg","type":"string"}},"required":["leg"],"title":"MediaAttachedEvent","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":{"actor_allocated":"#/components/schemas/ActorAllocatedEvent","actor_shutdown":"#/components/schemas/ActorShutdownEvent","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","media_attached":"#/components/schemas/MediaAttachedEvent","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/ActorAllocatedEvent"},{"$ref":"#/components/schemas/ActorShutdownEvent"},{"$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/MediaAttachedEvent"},{"$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"}]},"TurnArtifactEvent":{"properties":{"event":{"const":"artifact","default":"artifact","title":"Event","type":"string"},"type":{"maxLength":128,"minLength":1,"pattern":"^[a-z][a-z0-9_.-]*$","title":"Type","type":"string"},"schema_version":{"maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]*$","title":"Schema Version","type":"string"},"payload":{"anyOf":[{"additionalProperties":true,"type":"object"},{"items":{},"type":"array"}],"title":"Payload"}},"required":["type","schema_version","payload"],"title":"TurnArtifactEvent","type":"object"},"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"},"background_pending":{"default":false,"description":"True when the streamed response is only an acknowledgement and the final assistant answer must be collected with the durable background-delivery protocol.","title":"Background Pending","type":"boolean"},"delivery_protocol_version":{"anyOf":[{"const":2,"type":"integer"},{"type":"null"}],"default":null,"description":"Version of the durable background-delivery protocol supported by the serving agent. Clients may retry receipt-backed polls only after observing version 2.","title":"Delivery Protocol Version"},"turn_id":{"anyOf":[{"format":"uuid","type":"string"},{"type":"null"}],"default":null,"description":"Identifier of the user exchange this turn belongs to — identical to the ``turn_id`` on the non-streaming ``POST /turns`` response and on this conversation's history turns, so a streaming client can anchor durable per-turn artifacts (e.g. feedback) without a follow-up read. Stamped by platform-api at the proxy boundary (agent-engine frames do not carry it). Null when the conversation has no user exchange yet (a greeting kickoff stream on a fresh conversation).","title":"Turn Id"},"turn_index":{"anyOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Zero-based ordinal of the user exchange (0 = first user turn). Derived server-side; null exactly when ``turn_id`` is null.","title":"Turn Index"}},"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":{"artifact":"#/components/schemas/TurnArtifactEvent","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/TurnArtifactEvent"},{"$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":[]}]}