Amigo World API
The World API from Amigo — 21 operation(s) for world.
The World API from Amigo — 21 operation(s) for world.
openapi: 3.1.0
info:
title: Amigo Account World API
version: 0.1.0
servers:
- url: https://api.amigo.ai
- url: https://internal-api.amigo.ai
- url: https://api-eu-central-1.amigo.ai
- url: https://api-ap-southeast-2.amigo.ai
- url: https://api-ca-central-1.amigo.ai
security:
- Bearer-Authorization: []
Bearer-Authorization-Organization: []
Basic: []
tags:
- name: World
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:
$ref: '#/components/schemas/WorldDashboardResponse'
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
/v1/{workspace_id}/world/entity-types:
get:
tags:
- World
summary: List entity types
description: Returns distinct entity types in the workspace with counts and projection availability. Powers the World Explorer's auto-discovery of new entity types created by agents (L4 self-extending schema).
operationId: list-entity-types
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/EntityTypeRegistryResponse'
'401':
description: Missing or invalid API key.
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
/v1/{workspace_id}/world/event-types:
get:
tags:
- World
summary: List event types
description: Returns distinct event types in the workspace with counts, domains, and source breakdown. Enables the World Explorer to show what kinds of events flow through the world model.
operationId: list-event-types
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/EventTypeRegistryResponse'
'401':
description: Missing or invalid API key.
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
/v1/{workspace_id}/world/entity-stats:
get:
tags:
- World
summary: Entity stats with sync breakdown
description: Aggregate stats for entities including sync status breakdown (pending, synced, failed). Filter by entity_type to get stats for a specific type (e.g. appointment, patient). Generic — works for any entity type in the Liquid World Model.
operationId: entity-stats
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: entity_type
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by entity type
title: Entity Type
description: Filter by entity type
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/EntityStatsSummary'
'401':
description: Missing or invalid API key.
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/{workspace_id}/world/connectors:
get:
tags:
- World
summary: Connected data sources overview
description: All active data sources with entity counts by type, sync status, and health. Powers the EHR/FHIR connector cards in the frontend. Each item includes connector_type (charmhealth, fhir_store) and a breakdown of entities by type (patient, practitioner, etc.).
operationId: connector-overview
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectorOverviewResponse'
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
/v1/{workspace_id}/world/connectors/{data_source_id}/entities:
get:
tags:
- World
summary: List entities from a data source
description: Paginated entity list from a specific connected data source. Filter by entity_type and search by display name. Uses EXISTS subquery on events.data_source_id for accurate scoping.
operationId: connector-entities
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: data_source_id
in: path
required: true
schema:
type: string
format: uuid
title: Data Source Id
- name: entity_type
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by entity type
title: Entity Type
description: Filter by entity type
- name: q
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Search by display name
title: Q
description: Search by display name
- name: sort_by
in: query
required: false
schema:
anyOf:
- enum:
- +display_name
- -display_name
- +last_event_at
- -last_event_at
type: string
- type: 'null'
description: 'Sort order: `+display_name` (default) or `-display_name` for alphabetical, `+last_event_at` for oldest activity first, `-last_event_at` for most recent first. All sort orders use entity id as a final tiebreaker for stable pagination.'
title: Sort By
description: 'Sort order: `+display_name` (default) or `-display_name` for alphabetical, `+last_event_at` for oldest activity first, `-last_event_at` for most recent first. All sort orders use entity id as a final tiebreaker for stable pagination.'
- name: limit
in: query
required: false
schema:
type: integer
maximum: 100
minimum: 1
default: 20
title: Limit
- name: offset
in: query
required: false
schema:
type: integer
minimum: 0
default: 0
title: Offset
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/EntityListResponse'
'400':
description: Invalid data source ID format.
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/{workspace_id}/world/connectors/{data_source_id}/resources:
get:
tags:
- World
summary: Search FHIR resources from a data source
description: FHIR resource search scoped to a specific data source. Returns raw FHIR resource data (Condition, MedicationRequest, Coverage, etc.) from the specified connector. Powers the per-connector clinical resource tables (FHIR Store tab, EHR tab).
operationId: connector-resources
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: data_source_id
in: path
required: true
schema:
type: string
format: uuid
title: Data Source Id
- name: resource_type
in: query
required: true
schema:
type: string
description: FHIR resource type (e.g. Patient, Condition, MedicationRequest)
title: Resource Type
description: FHIR resource type (e.g. Patient, Condition, MedicationRequest)
- name: _count
in: query
required: false
schema:
type: integer
maximum: 100
minimum: 1
default: 20
title: ' Count'
- name: _offset
in: query
required: false
schema:
type: integer
minimum: 0
default: 0
title: ' Offset'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectorResourcesResponse'
'400':
description: Invalid data source ID or resource type.
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/{workspace_id}/world/source-breakdown:
get:
tags:
- World
summary: Entity counts by source system
description: Breakdown of entity counts by source system (e.g. charmhealth, gcp_fhir, voice_agent). Powers the EHR/FHIR view in the frontend. Filter by entity_type (e.g. person, place) for focused views.
operationId: source-breakdown
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: entity_type
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Filter by entity type
title: Entity Type
description: Filter by entity type
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/SourceBreakdownResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/{workspace_id}/world/sync/by-sink:
get:
tags:
- World
summary: Outbound sync status per data source
description: Multi-sink outbound sync progress. Shows total/synced/failed/pending counts per data source for workspaces with multiple outbound sinks.
operationId: outbound-sync-by-sink
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/OutboundSyncBySinkResponse'
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
/v1/{workspace_id}/world/entities/{entity_id}/enrichment/{key}:
put:
tags:
- World
summary: Set an enrichment value on an entity
description: Writes a single per-key entity.enriched event for the given entity. Validates against the workspace's enrichment_keys registry — unknown key, wrong value type, enum violation, or confidence below the key's floor all return 400. SDP picks winners by confidence class.
operationId: put-entity-enrichment
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: entity_id
in: path
required: true
schema:
type: string
format: uuid
title: Entity Id
- name: key
in: path
required: true
schema:
type: string
minLength: 1
maxLength: 128
pattern: ^[a-z0-9][a-z0-9_\-]*$
title: Key
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/EnrichmentWriteBody'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/EnrichmentValueResponse'
'400':
description: Registry validation failed.
'404':
description: Entity not found.
'403':
description: Insufficient permissions.
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/{workspace_id}/world/entities/{entity_id}/enrichment:
get:
tags:
- World
summary: List current enrichment values for an entity
description: Current winners per (entity, key) from world.entity_enrichment_out_synced (Synced-Table-populated view of SDP's entity_enrichment_out). Each row carries value, value_type, confidence, source, effective_at.
operationId: list-entity-enrichment
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: entity_id
in: path
required: true
schema:
type: string
format: uuid
title: Entity Id
- name: limit
in: query
required: false
schema:
type: integer
maximum: 500
minimum: 1
description: Max enrichment rows
default: 200
title: Limit
description: Max enrichment rows
- name: offset
in: query
required: false
schema:
type: integer
minimum: 0
description: Page offset
default: 0
title: Offset
description: Page offset
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/EnrichmentListResponse'
'404':
description: Entity not found.
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/{workspace_id}/world/entities/{entity_id}/enrichment/{key}/history:
get:
tags:
- World
summary: Enrichment supersedes chain for audit
description: 'Returns every entity.enriched event for (entity, key), newest first, including superseded entries. Each entry carries the full provenance: source, confidence, effective_at, supersedes pointer, is_current flag.'
operationId: get-entity-enrichment-history
parameters:
- name: workspace_id
in: path
required: true
schema:
type: string
format: uuid
title: Workspace Id
- name: entity_id
in: path
required: true
schema:
type: string
format: uuid
title: Entity Id
- name: key
in: path
required: true
schema:
type: string
minLength: 1
maxLength: 128
pattern: ^[a-z0-9][a-z0-9_\-]*$
title: Key
- name: limit
in: query
required: false
schema:
type: integer
maximum: 200
minimum: 1
default: 50
title: Limit
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/EnrichmentHistoryResponse'
'404':
description: Entity not found.
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/{workspace_id}/world/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:
# --- truncated at 32 KB (76 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/amigo/refs/heads/main/openapi/amigo-world-api-openapi.yml