Overview
Twilio offers multiple recording methods. Choosing the wrong one is the #1 developer mistake in voice — using <Record> when you mean <Dial record> produces voicemail behavior instead of call recording.
Prerequisites
- Twilio account with a voice-capable phone number — see
twilio-account-setup TWILIO_ACCOUNT_SIDandTWILIO_AUTH_TOKEN— seetwilio-iam-auth-setup- SDK:
pip install twilio/npm install twilio - A webhook endpoint for recording status callbacks
- Compliance check: Recording consent requirements vary by jurisdiction — see
twilio-compliance-traffic
Quickstart
Record a Two-Party Call (Most Common)
Use <Dial record> — NOT <Record>.
Python (Flask)
Node.js (Express)
Handle the Recording Status Callback
Security: Validate
X-Twilio-Signatureon recording callbacks in production. Without validation, attackers could POST fake recording URLs to your endpoint.
Python (Flask)
Key Patterns
Recording Modes for <Dial record>
Always use dual for QA and analytics. Dual-channel lets speech analytics tools (like Conversation Intelligence) distinguish agent from caller.
Conference Recording
Record multi-party calls via the Conference:
Python
Note: Conference recording captures the main audio mix. Coach/whisper audio is NOT included. See twilio-conference-calls.
ConversationRelay Recording
Critical: record:true on the REST API call is silently ignored with ConversationRelay. No error. No recording.
Correct approach: Use <Start><Recording> in TwiML before <Connect>:
Python
Node.js
Mid-Call Pause for PCI Compliance
Pause recording when a customer provides payment information:
Python
Node.js
PCI DSS: Never record card numbers. Use Twilio's <Pay> verb when possible. If collecting verbally, pause recording for the duration. PCI Mode is IRREVERSIBLE and account-wide — use a sub-account if only some calls need PCI.
Accessing Recordings
Python
Recording Storage & Retention
Common Errors
CANNOT
recordingTrackhas no observable effect via TwiML — The<Start><Recording>TwiML parameterrecordingTrackdoes not isolate tracks. Use the Recordings REST API withrecordingTrackfor actual track isolation.- Cannot start API recordings on ConversationRelay calls — REST API
record:trueis silently ignored ("not eligible for recording"). Must use<Start><Recording>before<Connect>in TwiML. - Cannot pause/resume recordings via TwiML — Only available via the REST API (
updatewithstatus="paused"orstatus="in-progress"). - Cannot get dual-channel conference recordings — Conference recording is always mono (mixed).
- Cannot get dual-channel from Calls API without explicit param —
Record=truedefaults to mono. Must specifyrecordingChannels: 'dual'. - Cannot transcribe PCI-mode recordings — Recordings created while PCI mode was enabled cannot be transcribed, even after PCI is disabled.
- Cannot use
<Record>verb for call recording —<Record>captures the caller only (voicemail-style). Use<Dial record>or<Start><Recording>for call recording. - Cannot capture coach/whisper audio in conference recordings — Supervisor whisper is excluded from the mix
- Cannot reverse PCI Mode — PCI Mode is irreversible and account-wide. Once enabled, all recordings are encrypted.
- Cannot auto-delete recordings without configuration — Recordings are retained indefinitely unless you configure auto-deletion
- Cannot avoid larger file sizes with dual-channel — Dual-channel recordings are ~2x the size of mono. Factor into storage costs.
Next Steps
- Conference calls:
twilio-conference-calls - Agent routing:
twilio-taskrouter-routing - Compliance:
twilio-compliance-traffic - Debug recording issues:
twilio-debugging-observability
