Recipes← all recipesView on GitHub

Record a call

Voicecall recording

Start a recording and pick it up from the completion webhook.

recording

The claim

record_call starts a background recording and returns immediately, so the verbs after it, including the connect that brings in the agent, run inside the recording. The recording URL is not in the SWML response and not in the call; it arrives at status_url when the recording finishes.

How it works

- answer: {}
- record_call:
    format: wav
    stereo: true        # caller on one channel, agent on the other
    direction: both
    status_url: "https://<your-host>/recording-status"
- play: { url: "say:This call is recorded for quality purposes." }
- connect: { to: "+1555..." }

Order matters: record_call before connect. The Python surface builds the same document with SWMLService and adds a Flask route for status_url that stores the URL only when state is finished.

Stopping early is stop_record_call; recordings are listed and deleted over REST (/api/relay/rest/recordings). To send recordings to your own storage instead of SignalWire’s, see export-recordings-and-enforce-retention. That path exists only in the Compatibility API’s <Record storageUrl>.

What to change first

Add get-recording-consent-before-recording in front: move record_call into a tool result so recording starts only after the caller agrees.