Call Recording

Enable call recording, retrieve recording details and audio, and understand recording availability.

Enable recording

Outbound calls

To request recording when creating an outbound call, include:

{
  "Record": true
}

Include this alongside the other required call fields. See Making Voice Calls for the calling workflow.

Calls connected using Dial

To request recording when connecting a call to another phone number, use the record attribute:

<Response>
  <Dial record="true">+12025550100</Dial>
</Response>

Replace the example number with your destination.

The standalone <Record> verb is not currently supported for starting a recording.

Start recording an active call

Use Start Call Recording to begin recording a call already in progress:

POST https://api.textgrid.com/2010-04-01/Accounts/YOUR_ACCOUNT_SID/Calls/YOUR_CALL_SID/Recordings.json
Content-Type: application/json

Authenticate using your TextGrid credentials and submit an empty JSON object:

{}

Save the returned Sid, which identifies the recording. It differs from the call SID.

HTTP 200 confirms recording started, not that the audio is ready to download. Recording cannot be started after the call has ended.

HTTP statusMeaning
404The call could not be found or is no longer available for recording.
406The call is not in progress.
502Recording could not be started.

Retrieve recording details

Use the account SID and recording SID to retrieve metadata:

GET https://api.textgrid.com/2010-04-01/Accounts/YOUR_ACCOUNT_SID/Recordings/YOUR_RECORDING_SID.json

The response includes the recording identifier, associated call identifier, duration, and media URL.

Use the recording SID for recording requests; it is different from the call SID.

Download the audio

The recording audio route is:

GET https://api.textgrid.com/2010-04-01/Accounts/YOUR_ACCOUNT_SID/Recordings/YOUR_RECORDING_SID

Authenticate the download request using your TextGrid credentials.

Audio will only be returned in the WAV format.

Allow time for recording availability

Recording audio may not be available immediately when the call ends. Allow time for the recording to become available before downloading it.

If retrieval fails, confirm the account SID and recording SID and retry after a delay. Persistent failures should be reported to support with the call SID, recording SID, and approximate call time.

Protect recordings

Keep recording URLs and downloaded audio accessible only to authorized users. Make authenticated downloads from your server rather than exposing your Auth Token in browser code.

Apply your organization’s recording notice, consent, access, and retention requirements.


Did this page help you?