Recording Status Callback
curl --request POST \
--url https://api.example.com/recording-statusimport requests
url = "https://api.example.com/recording-status"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/recording-status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/recording-status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/recording-status"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/recording-status")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/recording-status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyWebhooks & System
Recording Status Webhook
Handle Twilio recording status callbacks. This endpoint is called by Twilio when a recording is completed or failed.
POST
/
recording-status
Recording Status Callback
curl --request POST \
--url https://api.example.com/recording-statusimport requests
url = "https://api.example.com/recording-status"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/recording-status', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/recording-status",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/recording-status"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/recording-status")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/recording-status")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyThis webhook is designed to receive status updates from Twilio about call recordings. When you enable call recording on your Twilio account or for a specific call, Twilio will automatically make a
POST request to this endpoint once the recording is processed and available.
Its primary function is to receive the recording metadata from Twilio and update the corresponding call record in your database with the recording URL, duration, and other details.
Request from Twilio
This endpoint consumesapplication/x-www-form-urlencoded data sent by Twilio. The following are the key parameters:
CallSid(string): The unique identifier of the call that was recorded. This is used to look up the call in your database.RecordingSid(string): A unique identifier for the recording itself.RecordingUrl(string): The URL where the recording’s audio file can be accessed. This URL will be stored in your database.RecordingDuration(string): The duration of the recording in seconds.RecordingStatus(string): The status of the recording, typicallycompleted.
Response to Twilio
The endpoint responds with a200 OK status and a simple confirmation message to acknowledge receipt of the data. The response body is not typically used by Twilio.
Response
{
"message": "Recording status updated"
}
Response
200 - application/json
Successful Response