Skip to main content

Events

For live caller turns, use the outbound Agent Relay. It reconnects, retains events until ACK, and works without a public inbound URL. Use the mailbox for non-live fallback awareness when neither relay nor webhook is available. See Agent Relay for the two-command runtime setup. JavaScript examples call https://api.agentline.cloud with fetch and a Bearer al_live_... key. The Node package is not on npm.

Poll (fallback, consume once)

poll returns pending events and deletes them — treat it as a one-time read.
Each event has { event_id, agent_id, event_type, payload, created_at }. The backend emits:
  • call.received — inbound answer
  • call.utterance — a live caller turn. Its conversation field uses user and assistant.
  • call.completed
  • call.owner_task
  • call.failed
  • call.busy
  • call.no-answer
  • call.canceled
  • sms.received
  • webhook.test
GET /v1/calls/{id}/transcript uses different role names: human and agent.

Peek (non-destructive)

peek previews what’s queued without consuming it — handy to check before committing to retrieve.
Prefer Agent Relay for live calls, then webhooks for a public inbound integration. Use the mailbox for fallback polling only.