Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

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)

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.


Transcription Properties

Property nameTypePIIDescription
account_sidSID<AC>
Not PII

The SID of the Account that created the Transcription resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

api_versionstring

The API version used to create the transcription.


date_createdstring<date-time-rfc-2822>

The date and time in GMT that the resource was created specified in RFC 2822 format.


date_updatedstring<date-time-rfc-2822>

The date and time in GMT that the resource was last updated specified in RFC 2822 format.


durationstring

The duration of the transcribed audio in seconds.


pricenumber

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_unitstring<currency>

The currency in which price is measured, in ISO 4127 format (e.g. usd, eur, jpy).


recording_sidSID<RE>

The SID of the Recording from which the transcription was created.

Pattern: ^RE[0-9a-fA-F]{32}$Min length: 34Max length: 34

sidSID<TR>

The unique string that that we created to identify the Transcription resource.

Pattern: ^TR[0-9a-fA-F]{32}$Min length: 34Max length: 34

statusenum<string>

The status of the transcription. Can be: in-progress, completed, failed.

Possible values:
in-progresscompletedfailed

transcription_textstring
PII MTL: 30 days

The text content of the transcription.


typestring

The transcription type. Can only be: fast.


uristring

The URI of the resource, relative to https://api.twilio.com.


Fetch a Transcription resource

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

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that created the Transcription resource to fetch.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

SidSID<TR>required

The Twilio-provided string that uniquely identifies the Transcription resource to fetch.

Pattern: ^TR[0-9a-fA-F]{32}$Min length: 34Max length: 34

Fetch a specific Transcription

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_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
_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
_18
async function fetchTranscription() {
_18
const transcription = await client
_18
.transcriptions("TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
_18
.fetch();
_18
_18
console.log(transcription.accountSid);
_18
}
_18
_18
fetchTranscription();

Output

_15
{
_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
"duration": "1",
_15
"price": "-0.05000",
_15
"price_unit": "USD",
_15
"recording_sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_15
"sid": "TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15
"status": "failed",
_15
"transcription_text": "(blank)",
_15
"type": "fast",
_15
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
_15
}


Read multiple Transcription resources

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.

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that created the Transcription resources to read.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

Query parameters

Property nameTypeRequiredPIIDescription
PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

Read: List all Transcriptions

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_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
_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
_16
async function listTranscription() {
_16
const transcriptions = await client.transcriptions.list({ limit: 20 });
_16
_16
transcriptions.forEach((t) => console.log(t.accountSid));
_16
}
_16
_16
listTranscription();

Output

_30
{
_30
"end": 0,
_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
"num_pages": 4,
_30
"page": 0,
_30
"page_size": 1,
_30
"previous_page_uri": null,
_30
"start": 0,
_30
"total": 4,
_30
"transcriptions": [
_30
{
_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
"duration": "10",
_30
"price": "0.00000",
_30
"price_unit": "USD",
_30
"recording_sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_30
"sid": "TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_30
"status": "completed",
_30
"transcription_text": null,
_30
"type": "fast",
_30
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
_30
}
_30
],
_30
"uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0"
_30
}

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 a Transcription resource

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.

Path parameters

Property nameTypeRequiredPIIDescription
AccountSidSID<AC>required

The SID of the Account that created the Transcription resources to delete.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

SidSID<TR>required

The Twilio-provided string that uniquely identifies the Transcription resource to delete.

Pattern: ^TR[0-9a-fA-F]{32}$Min length: 34Max length: 34

Delete a Transcription

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_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
_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
_14
async function deleteTranscription() {
_14
await client.transcriptions("TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").remove();
_14
}
_14
_14
deleteTranscription();


Rate this page: