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) .
Resource properties The API version used to create the transcription.
date_created
type: string<DATE TIME RFC 2822> Not PIIdate_updated
type: string<DATE TIME RFC 2822> Not PIIThe 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
type: string<CURRENCY> Not PIIThe unique string that that we created to identify the Transcription resource.
The status of the transcription. Can be: in-progress
, completed
, failed
.
Possible values:
in-progress
completed
failed
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
URI parameters Path Parameter
The Twilio-provided string that uniquely identifies the Transcription resource to fetch.
_10 // Download the helper library from https://www.twilio.com/docs/node/install
_10 // Find your Account SID and Auth Token at twilio.com/console
_10 // and set the environment variables. See http://twil.io/secure
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.transcriptions('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10 .then(transcription => console.log(transcription.dateCreated));
_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": "REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "transcription_text": "(blank)",
_15 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Transcriptions/TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.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 .
URI parameters Query Parameter
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Query Parameter
The page index. This value is simply for client state.
Query Parameter
The page token. This is provided by the API.
_10 // Download the helper library from https://www.twilio.com/docs/node/install
_10 // Find your Account SID and Auth Token at twilio.com/console
_10 // and set the environment variables. See http://twil.io/secure
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.transcriptions.list({limit: 20})
_10 .then(transcriptions => transcriptions.forEach(t => console.log(t.sid)));
_30 "first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Transcriptions.json?PageSize=1&Page=0",
_30 "last_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Transcriptions.json?PageSize=1&Page=3",
_30 "next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Transcriptions.json?PageSize=1&Page=1",
_30 "previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Transcriptions.json?PageSize=1&Page=0",
_30 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_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": "REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_30 "sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_30 "status": "completed",
_30 "transcription_text": null,
_30 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Transcriptions/TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_30 "uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/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.
URI parameters Path Parameter
The Twilio-provided string that uniquely identifies the Transcription resource to delete.
_10 // Download the helper library from https://www.twilio.com/docs/node/install
_10 // Find your Account SID and Auth Token at twilio.com/console
_10 // and set the environment variables. See http://twil.io/secure
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.transcriptions('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove();