# World

## World model dashboard composite

> Composite world health dashboard — entity counts by type, event velocity (24h/7d), average confidence, and source breakdown. All computation server-side.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}}},"paths":{"/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":{"additionalProperties":true,"type":"object","title":"Response World-Dashboard"}}}}}}}}}
```

## List entity types

> 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).

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"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"},"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"}}},"paths":{"/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."}}}}}}
```

## List event types

> 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.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"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"}}},"paths":{"/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."}}}}}}
```

## Entity stats with sync breakdown

> 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.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"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"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/v1/{workspace_id}/world/entity-stats":{"get":{"tags":["World"],"summary":"Entity stats with sync breakdown","description":"Aggregate stats for entities including sync status breakdown (pending, synced, failed). Filter by entity_type to get stats for a specific type (e.g. appointment, patient). Generic — works for any entity type in the Liquid World Model.","operationId":"entity-stats","parameters":[{"name":"entity_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by entity type","title":"Entity Type"},"description":"Filter by entity type"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityStatsSummary"}}}},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Connected data sources overview

> All active data sources with entity counts by type, sync status, and health. Powers the CRM/EHR/FHIR connector cards in the frontend. Each item includes connector\_type (revolution, hubspot, fhir\_store) and a breakdown of entities by type (patient, practitioner, etc.).

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"ConnectorOverviewResponse":{"properties":{"connectors":{"items":{"$ref":"#/components/schemas/ConnectorOverviewItem"},"type":"array","title":"Connectors"},"total_entities":{"type":"integer","title":"Total Entities"}},"type":"object","required":["connectors","total_entities"],"title":"ConnectorOverviewResponse"},"ConnectorOverviewItem":{"properties":{"data_source_id":{"type":"string","title":"Data Source Id"},"name":{"type":"string","title":"Name"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"source_type":{"type":"string","title":"Source Type"},"connector_type":{"type":"string","title":"Connector Type"},"entity_count":{"type":"integer","title":"Entity Count"},"entities_by_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"Entities By Type"},"last_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync At"},"last_sync_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Sync Status"},"last_sync_event_count":{"type":"integer","title":"Last Sync Event Count","default":0},"health_status":{"type":"string","title":"Health Status","default":"unknown"},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["data_source_id","name","source_type","connector_type","entity_count"],"title":"ConnectorOverviewItem"}}},"paths":{"/v1/{workspace_id}/world/connectors":{"get":{"tags":["World"],"summary":"Connected data sources overview","description":"All active data sources with entity counts by type, sync status, and health. Powers the CRM/EHR/FHIR connector cards in the frontend. Each item includes connector_type (revolution, hubspot, fhir_store) and a breakdown of entities by type (patient, practitioner, etc.).","operationId":"connector-overview","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectorOverviewResponse"}}}}}}}}}
```

## List entities from a data source

> 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.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"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"},"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"},"has_projection":{"type":"boolean","title":"Has Projection","default":false},"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},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"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","entity_type"],"title":"EntityResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/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":"data_source_id","in":"path","required":true,"schema":{"type":"string","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":"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"}}}}}}}}}
```

## Search FHIR resources from a data source

> 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).

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/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":"data_source_id","in":"path","required":true,"schema":{"type":"string","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":{"type":"object","additionalProperties":true,"title":"Response Connector-Resources"}}}},"400":{"description":"Invalid data source ID or resource type."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Entity counts by source system

> Breakdown of entity counts by source system (e.g. revolution, hubspot, gcp\_fhir, voice\_agent). Powers the CRM/EHR/FHIR view in the frontend. Filter by entity\_type (e.g. person, place) for focused views.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"SourceBreakdownResponse":{"properties":{"breakdown":{"items":{"$ref":"#/components/schemas/SourceBreakdownItem"},"type":"array","title":"Breakdown"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["breakdown","total"],"title":"SourceBreakdownResponse"},"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"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/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. revolution, hubspot, gcp_fhir, voice_agent). Powers the CRM/EHR/FHIR view in the frontend. Filter by entity_type (e.g. person, place) for focused views.","operationId":"source-breakdown","parameters":[{"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"}}}}}}}}}
```

## Outbound sync status per data source

> Multi-sink outbound sync progress. Shows total/synced/failed/pending counts per data source from outbound\_sync\_log. For workspaces with multiple outbound sinks (e.g. Revolution + HubSpot).

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"OutboundSyncBySinkResponse":{"properties":{"sinks":{"items":{"$ref":"#/components/schemas/SinkSyncStatus"},"type":"array","title":"Sinks"}},"type":"object","required":["sinks"],"title":"OutboundSyncBySinkResponse"},"SinkSyncStatus":{"properties":{"data_source_id":{"type":"string","format":"uuid","title":"Data Source Id"},"name":{"type":"string","title":"Name"},"source_type":{"type":"string","title":"Source Type"},"total":{"type":"integer","title":"Total"},"synced":{"type":"integer","title":"Synced"},"failed":{"type":"integer","title":"Failed"},"pending":{"type":"integer","title":"Pending"}},"type":"object","required":["data_source_id","name","source_type","total","synced","failed","pending"],"title":"SinkSyncStatus"}}},"paths":{"/v1/{workspace_id}/world/sync/by-sink":{"get":{"tags":["World"],"summary":"Outbound sync status per data source","description":"Multi-sink outbound sync progress. Shows total/synced/failed/pending counts per data source from outbound_sync_log. For workspaces with multiple outbound sinks (e.g. Revolution + HubSpot).","operationId":"outbound-sync-by-sink","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboundSyncBySinkResponse"}}}}}}}}}
```

## List sync events by status

> Lists outbound events filtered by sync status (pending or failed). Optionally scope the queue to a specific outbound data source or source system, or narrow to a specific FHIR resource type/ID. Includes entity display\_name for the UI. Use for the pending events table (status=pending) or the retry table (status=failed).

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"SyncEventsResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/SyncEventItem"},"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":["events","total","has_more"],"title":"SyncEventsResponse"},"SyncEventItem":{"properties":{"event_id":{"type":"string","format":"uuid","title":"Event Id"},"entity_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Entity Id"},"entity_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Entity Type"},"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"},"data_source_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Data Source Id"},"source":{"type":"string","title":"Source"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"sync_status":{"type":"string","title":"Sync Status"},"sync_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sync Error"},"synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Synced At"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"}},"type":"object","required":["event_id","event_type","source","sync_status"],"title":"SyncEventItem"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/v1/{workspace_id}/world/sync/events":{"get":{"tags":["World"],"summary":"List sync events by status","description":"Lists outbound events filtered by sync status (pending or failed). Optionally scope the queue to a specific outbound data source or source system, or narrow to a specific FHIR resource type/ID. Includes entity display_name for the UI. Use for the pending events table (status=pending) or the retry table (status=failed).","operationId":"world-sync-events","parameters":[{"name":"status","in":"query","required":true,"schema":{"enum":["pending","failed"],"type":"string","title":"Status"}},{"name":"data_source_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"description":"Filter events to a specific outbound data source.","title":"Data Source Id"},"description":"Filter events to a specific outbound data source."},{"name":"source_system","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter events to a specific source system.","title":"Source System"},"description":"Filter events to a specific source system."},{"name":"fhir_resource_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter events to a specific FHIR resource type.","title":"Fhir Resource Type"},"description":"Filter events to a specific FHIR resource type."},{"name":"fhir_resource_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter events to a specific FHIR resource ID.","title":"Fhir Resource Id"},"description":"Filter events to a specific FHIR resource ID."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncEventsResponse"}}}},"400":{"description":"Invalid status parameter."},"401":{"description":"Missing or invalid API key."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Outbound sync queue depth

> Pending and failed outbound sync event counts, grouped by FHIR resource type. Includes oldest pending timestamp and last successful sync time. Queries Lakebase — not Valkey.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"SyncQueueResponse":{"properties":{"pending_count":{"type":"integer","title":"Pending Count"},"failed_count":{"type":"integer","title":"Failed Count"},"oldest_pending_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Oldest Pending At"},"last_sync_success_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync Success At"},"by_resource_type":{"additionalProperties":{"additionalProperties":{"type":"integer"},"type":"object"},"type":"object","title":"By Resource Type"}},"type":"object","required":["pending_count","failed_count"],"title":"SyncQueueResponse"}}},"paths":{"/v1/{workspace_id}/world/sync/queue":{"get":{"tags":["World"],"summary":"Outbound sync queue depth","description":"Pending and failed outbound sync event counts, grouped by FHIR resource type. Includes oldest pending timestamp and last successful sync time. Queries Lakebase — not Valkey.","operationId":"world-sync-queue","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncQueueResponse"}}}},"401":{"description":"Missing or invalid API key."}}}}}}
```

## Retry a failed sync event

> Clears sync\_error on a failed event and re-publishes to the outbound sync channel. The event re-enters the sync pipeline.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"SyncRetryResponse":{"properties":{"event_id":{"type":"string","title":"Event Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["event_id","status"],"title":"SyncRetryResponse"}}},"paths":{"/v1/{workspace_id}/world/sync/retry/{event_id}":{"post":{"tags":["World"],"summary":"Retry a failed sync event","description":"Clears sync_error on a failed event and re-publishes to the outbound sync channel. The event re-enters the sync pipeline.","operationId":"world-sync-retry","parameters":[{"name":"event_id","in":"path","required":true,"schema":{"type":"string","title":"Event Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRetryResponse"}}}},"400":{"description":"Invalid event ID format."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Event not found or has no sync_error."},"422":{"description":"Event missing FHIR resource type/ID."}}}}}}
```

## Retry all failed sync events

> Clears sync\_error on all failed events in the workspace and re-publishes each to the outbound sync channel.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"SyncBulkRetryResponse":{"properties":{"retried":{"type":"integer","title":"Retried"},"failed_to_publish":{"type":"integer","title":"Failed To Publish"}},"type":"object","required":["retried","failed_to_publish"],"title":"SyncBulkRetryResponse"}}},"paths":{"/v1/{workspace_id}/world/sync/retry-all":{"post":{"tags":["World"],"summary":"Retry all failed sync events","description":"Clears sync_error on all failed events in the workspace and re-publishes each to the outbound sync channel.","operationId":"world-sync-retry-all","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncBulkRetryResponse"}}}},"401":{"description":"Missing or invalid API key."}}}}}}
```

## List entities

> 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.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"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"},"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"},"has_projection":{"type":"boolean","title":"Has Projection","default":false},"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},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"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","entity_type"],"title":"EntityResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/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":"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":"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. hubspot, revolution)","title":"Source System"},"description":"Filter by source system name (e.g. hubspot, revolution)"},{"name":"semantic","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"description":"Semantic search via pgvector cosine similarity on entity embeddings. Entity embeddings encode the full projected state — clinical conditions, demographics, relationships. Example: 'diabetes patients in Abu Dhabi'.","title":"Semantic"},"description":"Semantic search via pgvector cosine similarity on entity embeddings. Entity embeddings encode the full projected state — clinical conditions, demographics, relationships. Example: 'diabetes patients in Abu Dhabi'."},{"name":"tags","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Filter by entity tags (array overlap)","title":"Tags"},"description":"Filter by entity tags (array overlap)"}],"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"}}}}}}}}}
```

## Get entity

> 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.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"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"},"has_projection":{"type":"boolean","title":"Has Projection","default":false},"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},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"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","entity_type"],"title":"EntityResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/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":"entity_id","in":"path","required":true,"schema":{"type":"string","title":"Entity Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityResponse"}}}},"400":{"description":"Invalid entity ID format."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Entity not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Entity timeline

> 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.).

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"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"},"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":{"type":"string","title":"Source","default":"manual"},"source_system":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source System"},"confidence":{"type":"number","title":"Confidence","default":1},"produced_by_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Produced By Agent"},"supersedes":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Supersedes"},"is_current":{"type":"boolean","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"},{"type":"null"}],"title":"Sync Status"},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At"}},"type":"object","required":["id","domain","event_type"],"title":"EntityEventResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/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":"entity_id","in":"path","required":true,"schema":{"type":"string","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."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Entity not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Entity relationships

> Get relationships for an entity — links to other entities in the knowledge graph. Filter by relationship type.

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"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"},"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},"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"}},"type":"object","required":["id","source_entity_id","source_entity_type","target_entity_id","target_entity_type","relationship"],"title":"EntityRelationshipResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/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":"entity_id","in":"path","required":true,"schema":{"type":"string","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."},"401":{"description":"Missing or invalid API key."},"404":{"description":"Entity not found."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

## Get merged entities (same\_as links)

> Returns entities linked via same\_as edges — cross-source merges where different data sources refer to the same real-world entity (e.g. a patient in Revolution EHR and HubSpot CRM matched by phone number).

```json
{"openapi":"3.1.0","info":{"title":"Platform API","version":"1.0.0"},"servers":[{"url":"https://api.platform.amigo.ai","description":"Production"}],"security":[{"BearerAuth":[]}],"components":{"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."}},"schemas":{"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"},"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"},"has_projection":{"type":"boolean","title":"Has Projection","default":false},"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},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"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","entity_type"],"title":"EntityResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"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"}}},"paths":{"/v1/{workspace_id}/world/entities/{entity_id}/merged":{"get":{"tags":["World"],"summary":"Get merged entities (same_as links)","description":"Returns entities linked via same_as edges — cross-source merges where different data sources refer to the same real-world entity (e.g. a patient in Revolution EHR and HubSpot CRM matched by phone number).","operationId":"merged-entities","parameters":[{"name":"entity_id","in":"path","required":true,"schema":{"type":"string","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"}}}}}}}}}
```
