<Record> element records audio from the call and returns the URL of the recording file. Use it for voicemail, call logging, or quality monitoring.
Basic Usage
Attributes
Basic Settings
| Attribute | Type | Default | Description |
|---|---|---|---|
action | URL | - | URL to receive recording data |
method | string | POST | HTTP method for action (GET, POST) |
fileFormat | string | mp3 | Recording format (mp3, wav) |
redirect | boolean | true | Redirect to action URL when complete |
Timing
| Attribute | Type | Default | Description |
|---|---|---|---|
timeout | integer | 15 | Seconds of silence before stopping |
maxLength | integer | 60 | Maximum recording duration in seconds |
finishOnKey | string | # | Key to stop recording (digit, #, *, or none) |
playBeep | boolean | true | Play beep before recording |
Session Recording
| Attribute | Type | Default | Description |
|---|---|---|---|
recordSession | boolean | false | Record entire call in background |
startOnDialAnswer | boolean | false | Start recording when B-leg answers |
recordChannelType | string | stereo | Channel type (mono, stereo) |
Transcription
| Attribute | Type | Default | Description |
|---|---|---|---|
transcriptionType | string | - | Set to auto for transcription |
transcriptionUrl | URL | - | URL to receive transcription |
Callbacks
| Attribute | Type | Default | Description |
|---|---|---|---|
callbackUrl | URL | - | URL notified when recording is ready |
callbackMethod | string | POST | HTTP method for callback |
Voicemail
Record Entire Session
Record the complete call in the background:- Recording starts immediately and continues until the call ends
timeout,finishOnKey, andplayBeepare ignored- Recording is sent to
callbackUrlwhen complete
Record Dial Conversation
Record both parties after the dial connects:Stereo vs Mono Recording
Stereo (default): Each party on separate audio channels - useful for call analytics. Mono: Both parties on single channel - smaller file size.With Transcription
Get automatic speech-to-text:- English only
- Duration: 500ms to 4 hours
- File size: under 2GB
Action URL Parameters
Sent when recording completes:| Parameter | Description |
|---|---|
RecordUrl | URL of the recording file |
RecordingID | Unique recording identifier |
RecordingDuration | Duration in seconds |
RecordingDurationMs | Duration in milliseconds |
RecordingStartMs | Start time (epoch ms) |
RecordingEndMs | End time (epoch ms) |
Digits | Key pressed to stop (if any) |
recordSession or startOnDialAnswer is true, duration values are -1 in the initial request. Final values are sent to callbackUrl.
Callback URL Parameters
Sent when recording file is ready:| Parameter | Description |
|---|---|
RecordUrl | URL of the recording file |
RecordingID | Recording identifier |
RecordingDuration | Duration in seconds |
RecordingDurationMs | Duration in milliseconds |
RecordingStartMs | Start time (epoch ms) |
RecordingEndMs | End time (epoch ms) |
Transcription URL Parameters
| Parameter | Description |
|---|---|
transcription | Transcribed text |
transcription_charge | Cost of transcription |
transcription_rate | Rate per minute |
duration | Recording duration |
call_uuid | Call identifier |
recording_id | Recording identifier |
error | Error message (if failed) |
Best Practices
- Inform callers - Always notify that the call is being recorded (legal requirement in many jurisdictions)
- Set appropriate limits - Use
maxLengthto prevent very long recordings - Use callbacks - Use
callbackUrlfor reliable notification when recording is ready - Choose format wisely - MP3 for smaller files, WAV for highest quality
- Handle storage - Download recordings from Plivo; they’re deleted after 30 days
Related
- Conference - Record conference calls
- Recordings API - Manage recordings
- Play - Play recorded audio