Webhooks
Handle Twilio recording status
Recording-completed callback posted by Twilio once a call recording finishes. Downloads the audio from the Twilio recording URL, uploads it to R2, and attaches the storage key + duration to the parent Call record.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
text/plain
application/json
curl -X POST "https://example.com/api/webhook/calls/twilio/recording" \ -H "Content-Type: application/json" \ -d '{ "CallSid": "CA5f7b1c2e8a1d4e0012c3b4a5", "RecordingSid": "RE9c2d4e0b1f3a4e5b6c7d8e9f0", "RecordingUrl": "https://api.twilio.com/2010-04-01/Accounts/AC.../Recordings/RE9c2d4e0b1f3a4e5b6c7d8e9f0", "RecordingStatus": "completed", "RecordingDuration": "42" }'"OK"