Get a token
POST to the session. There is no body. ThesessionId is the callId the dispatch gave you, or the id on any session read.
Play it
Any LiveKit client joins the room with that token. Each audio track is one side of the call, the agent and the caller. Attach both:connect from a click. In React, RoomAudioRenderer from @livekit/components-react inside a LiveKitRoom does the attaching for you. The Client tools page shows the same room from the caller’s side.
The limits
- Ten minutes to connect. The token expires after that, but once you are in you stay until the call ends. Mint a fresh one if you waited too long.
- No backfill. You hear from the moment you join. Nothing before that is replayed. For the whole call, take the recording off the session detail once it ends.
- Room ends with the call. When the call ends we delete the room, and your client gets
Disconnected. - One listener per API key. The listener identity comes from your key. A second connect with the same key evicts the first, so give each supervisor their own key.
- On web, wait for
state: active. Any session with a room works, phone or web. If you join before the browser does, you create the room, and the browser’s join then dispatches no agent.
When it fails
- 400, not live. The session is
completedorfailed. Every other state gets a token, including a call that is still dialing. - 404, not found. No such session in your project.
state on the session status read before you show a listen button.