Recording Transcription
A Transcription represents the transcribed text and metadata from a transcribed recording of a voice call.
The transcription text itself is the result of converting an audio recording to readable text. To generate transcriptions from call recordings, use the TwiML <Record>
verb and set transcribe="true"
. Note that
Warning Your account will be charged if you request transcription for a recording, as this is a paid feature. Additionally, transcription is currently limited to recordings initiated with the TwiML <Record> verb and are at most two minutes in length.
For pricing information, see the transcriptions pricing page(link takes you to an external page) .
Property name Type Required Description Child properties
account_sid SID<AC> Optional The SID of the Account that created the Transcription resource.
Pattern: ^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
api_version string Optional The API version used to create the transcription.
date_created string<date-time-rfc-2822> Optional date_updated string<date-time-rfc-2822> Optional The duration of the transcribed audio in seconds.
The charge for the transcript in the currency associated with the account. This value is populated after the transcript is complete so it may not be available immediately.
price_unit string<currency> Optional recording_sid SID<RE> Optional The SID of the Recording from which the transcription was created.
Pattern: ^RE[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique string that that we created to identify the Transcription resource.
Pattern: ^TR[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
status enum<string> Optional The status of the transcription. Can be: in-progress
, completed
, failed
.
Possible values: in-progress
completed
failed
transcription_text string Optional The text content of the transcription.
The transcription type. Can only be: fast
.
The URI of the resource, relative to https://api.twilio.com
.
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Transcriptions/{Sid}.json
Twilio will respond with the JSON metadata for the Transcription. If you append ".txt
" to the end of the Transcription resource's URI, Twilio will return only the text of the transcription:
_10 /2010-04-01/Accounts/{AccountSid}/Transcriptions/{TranscriptionSid}.txt
Property name Type Required PII Description
AccountSid SID<AC> required The SID of the Account that created the Transcription resource to fetch.
Pattern: ^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the Transcription resource to fetch.
Pattern: ^TR[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
_18 // Download the helper library from https://www.twilio.com/docs/node/install
_18 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18 // Find your Account SID and Auth Token at twilio.com/console
_18 // and set the environment variables. See http://twil.io/secure
_18 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18 const authToken = process.env.TWILIO_AUTH_TOKEN;
_18 const client = twilio(accountSid, authToken);
_18 async function fetchTranscription() {
_18 const transcription = await client
_18 .transcriptions("TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_18 console.log(transcription.accountSid);
_15 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "api_version": "2008-08-01",
_15 "date_created": "Sun, 13 Feb 2011 02:12:08 +0000",
_15 "date_updated": "Sun, 13 Feb 2011 02:30:01 +0000",
_15 "recording_sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_15 "sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "transcription_text": "(blank)",
_15 "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Transcriptions.json
Returns the full set of Transcriptions generated from all recordings in an account.
The list Twilio returns includes paging information .
Property name Type Required PII Description
AccountSid SID<AC> required The SID of the Account that created the Transcription resources to read.
Pattern: ^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Property name Type Required PII Description
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum: 1
Maximum: 1000
The page index. This value is simply for client state.
Minimum: 0
The page token. This is provided by the API.
_16 // Download the helper library from https://www.twilio.com/docs/node/install
_16 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16 // Find your Account SID and Auth Token at twilio.com/console
_16 // and set the environment variables. See http://twil.io/secure
_16 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16 const authToken = process.env.TWILIO_AUTH_TOKEN;
_16 const client = twilio(accountSid, authToken);
_16 async function listTranscription() {
_16 const transcriptions = await client.transcriptions.list({ limit: 20 });
_16 transcriptions.forEach((t) => console.log(t.accountSid));
_30 "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0",
_30 "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=3",
_30 "next_page_uri": null,
_30 "previous_page_uri": null,
_30 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_30 "api_version": "2008-08-01",
_30 "date_created": "Thu, 25 Aug 2011 20:59:45 +0000",
_30 "date_updated": "Thu, 25 Aug 2011 20:59:45 +0000",
_30 "recording_sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_30 "sid": "TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_30 "status": "completed",
_30 "transcription_text": null,
_30 "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
_30 "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0"
You can also access a full list of Transcriptions directly from a given Recording by passing the RecordingSid
to the Recording resource :
_10 /2010-04-01/Accounts/{YourAccountSid}/Recordings/{RecordingSid}/Transcriptions.json
The cURL command to fetch Transcriptions from a Recording looks like this:
_10 curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Transcriptions.json \
_10 -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
If you prefer that Twilio responds with XML, change .json
to .xml
.
DELETE https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Transcriptions/{Sid}.json
Delete a transcription from your account.
If the request is successful, Twilio will return HTTP 204 (No Content) with no body.
Property name Type Required PII Description
AccountSid SID<AC> required The SID of the Account that created the Transcription resources to delete.
Pattern: ^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The Twilio-provided string that uniquely identifies the Transcription resource to delete.
Pattern: ^TR[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
_14 // Download the helper library from https://www.twilio.com/docs/node/install
_14 const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_14 // Find your Account SID and Auth Token at twilio.com/console
_14 // and set the environment variables. See http://twil.io/secure
_14 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14 const authToken = process.env.TWILIO_AUTH_TOKEN;
_14 const client = twilio(accountSid, authToken);
_14 async function deleteTranscription() {
_14 await client.transcriptions("TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").remove();
_14 deleteTranscription();