A Transcript resource represents a voice conversation that has automatically been converted to text through Voice Intelligence. The Transcript resource is a container and includes links to individual transcribed Sentence, Media, and OperatorResults resources.
The unique SID identifier of the Account.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique SID identifier of the Service.
^GA[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
A 34 character string that uniquely identifies this Transcript.
^GT[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The date that this Transcript was created, given in ISO 8601 format.
The date that this Transcript was updated, given in ISO 8601 format.
The Status of this Transcript. One of queued
, in-progress
, completed
, failed
or canceled
.
queued
in-progress
completed
failed
canceled
Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent.
The date that this Transcript's media was started, given in ISO 8601 format.
If the transcript has been redacted, a redacted alternative of the transcript will be available.
POST https://intelligence.twilio.com/v2/Transcripts
You can only create one Transcript per RecordingSid
. To re-transcribe a recording, you will need to delete the original Transcript resource and create a new one.
This limitation does not apply if you are supplying a MediaUrl
to create a Transcript.
Transcripts can be created in one of two ways:
POST
request to the Transcript resource and include the Recording's SID as the
SourceSid
in the
Channel
object (see
Specifying channel information
below for an example).
POST
request to the Transcript API and including the
MediaUrl
parameter with the recording's location as its value in the
Channel
object (see
Specifying channel information
below for an example). The URL must be accessible, either publicly or through a mechanism like a pre-signed URL.
If both MediaUrl
and SourceSid
are present in the Transcript creation request, MediaUrl
takes precedence over SourceSid
.
Transcripts cannot be created for recordings made by projects with Voice Recording Encryption enabled, as Voice Intelligence is unable to decrypt those resources. Twilio recommends offloading those recordings to your own storage and generating a pre-signed URL to supply them to the Transcript API.
Twilio's Transcript resource using the MediaUrl
parameter supports the following audio formats:
All these formats support both mono
and stereo
audio channels.
stereo
/
dual-channel
recordings.
MediaUrl
parameter. The
SourceSid
parameter is not supported for externally-stored Twilio Recordings.
application/x-www-form-urlencoded
The unique SID identifier of the Service.
^GA[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Used to store client provided metadata. Maximum of 64 double-byte UTF8 characters.
The date that this Transcript's media was started, given in ISO 8601 format.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createTranscript() {11const transcript = await client.intelligence.v2.transcripts.create({12channel: {},13serviceSid: "GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14});1516console.log(transcript.accountSid);17}1819createTranscript();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"service_sid": "GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"sid": "GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"date_created": "2010-08-31T20:36:28Z",6"date_updated": "2010-08-31T20:36:28Z",7"status": "queued",8"channel": {9"media_properties": {10"media_url": "http://foobar.test/ClusterTests/call1.wav"11}12},13"data_logging": false,14"language_code": "en-US",15"media_start_time": null,16"duration": 0,17"customer_key": "aaaaaaaa",18"url": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",19"redaction": true,20"links": {21"sentences": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sentences",22"media": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media",23"operator_results": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OperatorResults"24}25}
Channel
is the object representing the media channel. It has information about the source of the media, either a Twilio recording or a 3rd party recording, and the participants information.
1{2"$schema": "https://json-schema.org/draft/2019-09/schema",3"type": "object",4"items": {5"$ref": "#/definitions/Channel"6},7"definitions": {8"Channel": {9"type": "object",10"additionalProperties": false,11"properties": {12"media_properties": {13"type": "object",14"properties": {15"source_sid": {16"type": "string",17"$comment": "Twilio Recording Sid"18},19"media_url": {20"type": "string",21"format": "uri",22"$comment": "url to the 3rd party recording"23}24},25"$comment": "Either source_sid or media_url is required"26},27"participants": {28"type": "array"29}30},31"title": "Channel"32}33}34}
If the Transcript was generated from a Twilio Recording, the Channel
information would look like the following:
1{2"media_properties":{3"source_sid": "REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"4}5}
If the Transcript was generated from an external recording, the Channel
information would look like the following:
1{2"media_properties":{3"media_url": "http://www.example.com/recording/call.wav"4}5}
By default, Voice Intelligence assumes that the left channel (channel One) is the agent and the right channel (channel Two) is the customer. The order of these channels may be inverted, depending on how your call flow works and which call leg is being recorded.
You can specify information about channel structure, as well as information about who each participant is, by passing in a URL-encoded JSON array containing information about each participant into the Participants
parameter in the Channel
object. The Participants
array follows this JSON schema:
1{2"$schema": "http://json-schema.org/draft-06/schema#",3"type": "array",4"maxItems": 2,5"items": {6"$ref": "#/definitions/Participant"7},8"definitions": {9"Participant": {10"type": "object",11"additionalProperties": false,12"properties": {13"channel_participant": {14"type": "integer",15"enum": [161,17218],19"$comment": "You can only specify one participant per channel"20},21"user_id": {22"type": "string"23},24"media_participant_id": {25"type": "string"26},27"role": {28"type": "string"29},30"full_name": {31"type": "string"32},33"email": {34"type": "string",35"format": "email"36},37"image_url": {38"type": "string",39"format": "uri"40}41},42"required": [43"channel_participant"44],45"title": "Participant"46}47}48}
1[2{3"user_id" : "id1",4"channel_participant": 1,5"media_participant_id": "+1505959545",6"email": "veronica.meyer@example.com",7"full_name": "Veronica Meyer",8"image_url": "https://images.unsplash.com/photo-1438761681033-6461ffad8d80",9"role": "Agent"10},11{12"user_id" : "id2",13"channel_participant": 2,14"media_participant_id": "+1505959505",15"email": "lauryn.trujillo@example.com",16"full_name": "Lauryn Trujillo",17"image_url": "https://images.unsplash.com/photo-1554384645-13eab165c24b",18"role": "Customer"19}20]21
GET https://intelligence.twilio.com/v2/Transcripts/{Sid}
A 34 character string that uniquely identifies this Transcript.
^GT[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchTranscript() {11const transcript = await client.intelligence.v212.transcripts("GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.fetch();1415console.log(transcript.accountSid);16}1718fetchTranscript();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"service_sid": "GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"sid": "GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"date_created": "2010-08-31T20:36:28Z",6"date_updated": "2010-08-31T20:36:28Z",7"status": "queued",8"channel": {},9"data_logging": false,10"language_code": "en-US",11"media_start_time": null,12"duration": 0,13"customer_key": null,14"url": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"redaction": true,16"links": {17"sentences": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sentences",18"media": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media",19"operator_results": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OperatorResults"20}21}
GET https://intelligence.twilio.com/v2/Transcripts
The unique SID identifier of the Service.
^GA[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listTranscript() {11const transcripts = await client.intelligence.v2.transcripts.list({12limit: 20,13});1415transcripts.forEach((t) => console.log(t.accountSid));16}1718listTranscript();
1{2"transcripts": [3{4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"service_sid": "GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"sid": "GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",7"date_created": "2010-08-31T20:36:28Z",8"date_updated": "2010-08-31T20:36:28Z",9"status": "queued",10"channel": {},11"data_logging": false,12"language_code": "en-US",13"media_start_time": null,14"duration": 0,15"customer_key": null,16"url": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",17"redaction": true,18"links": {19"sentences": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sentences",20"media": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media",21"operator_results": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OperatorResults"22}23}24],25"meta": {26"key": "transcripts",27"page": 0,28"page_size": 50,29"first_page_url": "https://intelligence.twilio.com/v2/Transcripts?LanguageCode=en-US&SourceSid=REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&ServiceSid=GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AfterDateCreated=2019-11-22T23%3A46%3A00Z&PageSize=50&Page=0",30"next_page_url": null,31"previous_page_url": null,32"url": "https://intelligence.twilio.com/v2/Transcripts?LanguageCode=en-US&SourceSid=REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&ServiceSid=GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AfterDateCreated=2019-11-22T23%3A46%3A00Z&PageSize=50&Page=0"33}34}
DELETE https://intelligence.twilio.com/v2/Transcripts/{Sid}
A 34 character string that uniquely identifies this Transcript.
^GT[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteTranscript() {11await client.intelligence.v212.transcripts("GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.remove();14}1516deleteTranscript();