Record
Record audio from the caller.
Record
The Record verb records audio from the caller and sends the recording URL to your server.
Example
{
"voxml_version": "1.0",
"instructions": [
{
"verb": "Say",
"text": "Please leave a message after the beep."
},
{
"verb": "Record",
"action_url": "https://example.com/handle-recording",
"max_length": 120,
"finish_on_key": "#"
}
]
}Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| action_url | string | yes | — | URL to POST recording data to |
| max_length | integer | no | 3600 | Maximum recording duration in seconds |
| timeout | integer | no | 5 | Seconds of silence to end recording |
| finish_on_key | string | no | 1234567890*# | Any key to finish recording |
| trim | string | no | trim-silence | "trim-silence" or "do-not-trim" |
| play_beep | boolean | no | true | Play beep before recording |
| transcribe | boolean | no | false | Transcribe the recording |
| transcription_url | string | no | — | URL to POST transcription to |
Basic Recording
{
"verb": "Record",
"action_url": "https://example.com/voicemail",
"max_length": 180
}Transcription
Enable automatic transcription:
{
"verb": "Record",
"action_url": "https://example.com/voicemail",
"transcribe": true,
"transcription_url": "https://example.com/transcription"
}When transcribe is enabled, TryVox will:
- POST the recording URL to
action_urlimmediately - POST the transcription to
transcription_urlwhen ready (async)
Finishing Recording
Recording ends when:
max_lengthis reached- Silence exceeds
timeoutduration - Any key specified in
finish_on_keyis pressed - The caller hangs up
Disabling Keys
To disable finishing on key press:
{
"verb": "Record",
"action_url": "https://example.com/recording",
"finish_on_key": ""
}Silence Trimming
By default, silence at the beginning and end is trimmed:
{
"verb": "Record",
"action_url": "https://example.com/recording",
"trim": "trim-silence"
}To keep all audio including silence:
{
"verb": "Record",
"action_url": "https://example.com/recording",
"trim": "do-not-trim"
}Disabling Beep
{
"verb": "Record",
"action_url": "https://example.com/recording",
"play_beep": false
}Callback Payload
When recording completes, TryVox POSTs to action_url:
{
"call_uuid": "abc-123",
"account_id": "acc_xyz",
"recording_url": "https://recordings.tryvox.ai/rec_xyz.mp3",
"recording_duration": 45,
"recording_size": 720000,
"from": "+919876543210",
"to": "+911234567890"
}Transcription Callback
If transcribe is enabled, TryVox POSTs to transcription_url:
{
"call_uuid": "abc-123",
"recording_url": "https://recordings.tryvox.ai/rec_xyz.mp3",
"transcription_text": "Hello, this is a test message.",
"transcription_confidence": 0.98
}Response to Callback
Your action_url should return new VoxML instructions:
{
"voxml_version": "1.0",
"instructions": [
{
"verb": "Say",
"text": "Thank you for your message. Goodbye."
},
{
"verb": "Hangup"
}
]
}Best Practices
- Set reasonable
max_lengthvalues (2-3 minutes for voicemail) - Use
timeoutto detect when caller stops speaking (3-5 seconds) - Enable
transcribefor voicemail systems - Store recording URLs securely
- Consider implementing recording retention policies