Skip to main content
A Monitoring setup tells Egma how to receive production evidence from one agent platform. It is project configuration. It is not a simulation connection and it does not require an Egma agent. All routes on this page use the normal Egma authentication rules. Pass the project id or name in the project query parameter. A project-scoped API key can omit it when the key already names the project.

List Monitoring setup

GET /api/monitoring Returns the Retell and LiveKit Agents setup records in one project.
string
Project id or name. Required when the credential does not already select one project.
array
Zero, one, or two setup objects. There can be one setup per supported agent platform in a project.
Each setup has these fields: health.state is healthy, invalid_credential, rate_limited, or provider_unavailable. A healthy setup with last_received_at: null is still waiting for its first production conversation. Each Retell agent has its platform id and name, an import state, scan progress, last-success and last-conversation times, and any open exact-call import failures. Its state is importing, active, or degraded.

Discover Retell voice agents

POST /api/monitoring/retell/discover Checks one Retell API key and returns only voice agents. This request does not save the key.
string
required
Retell platform API key with Agent Read permission.
array
Voice-agent choices shaped as { id, name }, sorted by name.

Create or update Retell Monitoring

PUT /api/monitoring/retell Checks Agent Read and call-history access, seals the key once, and saves the selected Retell voice agents. The key needs Retell Monitor or History Read permission in addition to Agent Read permission.
string
required
Retell platform API key. Egma never returns it after this request.
object[]
required
At least one choice shaped as { id, name }. Egma checks each id against Retell and stores Retell’s current name rather than trusting a client-supplied rename.
object
The saved setup in the same shape returned by GET /api/monitoring.
A new selected agent starts a fixed 30-day import. Changing the key keeps existing progress. Removing an agent from the selection stops its polling and keeps its imported production conversations. Polling checks for new terminal conversations about every 30 seconds after the first import finishes.

Record LiveKit Agents setup

PUT /api/monitoring/livekit-agents Creates the project setup record used to show waiting and last-received state. The request has no body and does not configure a LiveKit worker. Install the Egma Python SDK, add EGMA_URL and a project-scoped EGMA_API_KEY to the worker, and call monitor_livekit(ctx) before AgentSession.start.
object
A livekit_agents setup with strategy: "livekit_otlp" and no selected-agent rows.
See Egma Python SDK for the worker setup.

Retry one Retell import

POST /api/monitoring/retell/failures/:failureId/replay Retries the exact Retell call named by one open import failure. It reads the call directly, so it still works after that call is outside the normal 30-day list window. The production claim prevents a successful retry from creating a second production conversation.
string
required
Failure id from a selected agent’s failures array.
object
{ id, status: "resolved" } after a successful retry.
object
{ id, write }, where write is written or already.
A retry can return 409 conflict when another retry owns the failure or Retell still cannot supply a complete conversation. A rate limit returns 429; a temporary provider failure returns 503.

Remove Monitoring setup

DELETE /api/monitoring/:platform Use retell or livekit-agents for platform. A successful delete returns 204 No Content and keeps production conversations already stored. Deleting a Retell setup stops its polling. Deleting a LiveKit Agents setup removes Egma’s setup-status record; it does not change code or secrets in a deployed worker. Remove monitor_livekit or its Egma credentials in that deployment when you also want the worker to stop exporting.