Transcript Resource
Public Beta
Voice Intelligence is currently available as a public beta release. Some features are not yet implemented and others may be changed before the product is declared as Generally Available. Beta products are not covered by a Twilio SLA.
Learn more about beta product support.
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.
Transcript properties
Resource Properties in REST API format | |
---|---|
account_sid
|
The unique SID identifier of the Account. |
service_sid
|
The unique SID identifier of the Service. |
sid
|
A 34 character string that uniquely identifies this Transcript. |
date_created
|
The date that this Transcript was created, given in ISO 8601 format. |
date_updated
|
The date that this Transcript was updated, given in ISO 8601 format. |
status
|
The Status of this Transcript. One of |
channel
|
Media Channel describing Transcript Source and Participant Mapping |
data_logging
|
Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. |
language_code
|
The default language code of the audio. |
customer_key
|
|
media_start_time
|
The date that this Transcript's media was started, given in ISO 8601 format. |
duration
|
The duration of this Transcript's source |
url
|
The URL of this resource. |
redaction
|
If the transcript has been redacted, a redacted alternative of the transcript will be available. |
links
|
|
Create a new Transcript
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:
- Use a recording SID
If you’ve made a recording on Twilio and you are storing that recording on Twilio, you can make aPOST
request to theTranscript
API and include the recording’s SID as aRecordingSID
parameter. Voice Intelligence will retrieve the recording from Twilio’s storage and transcribe it. - Use a media URL
If you’re storing a recording outside of Twilio — for example, in your own S3 bucket — or if you’re transcribing a dual-channel recording that was made on another system, such as another contact center product like Amazon Connect, you can transcribe the recording by making aPOST
request to theTranscript
API and including theMediaUrl
parameter with the recording’s location as its value. The URL must be accessible, either publicly or through a mechanism like a pre-signed URL.
Transcripts cannot be created for recordings made by projects with Voice Recording Encryption enabled, as Voice Intelligence is unable to decrypt those resources. We recommend offloading those recordings to your own storage and generating a pre-signed URL to supply them to the Transcript
API.
Supported media formats
We support the following media formats for recordings ingested via MediaUrl
:
- PCM-encoded WAV (mono and stereo)
- MP3 (mono and stereo)
- FLAC
Parameters
Parameters in REST API format | |
---|---|
service_sid
Required
|
The unique SID identifier of the Service. |
channel
Required
|
JSON object describing Media Channel including Source and Participants |
customer_key
Optional
|
Used to store client provided metadata. Maximum of 64 double-byte UTF8 characters. |
media_start_time
Optional
|
The date that this Transcript's media was started, given in ISO 8601 format. |
Specifying channel information
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.
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "object",
"items": {
"$ref": "#/definitions/Channel"
},
"definitions": {
"Channel": {
"type": "object",
"additionalProperties": false,
"properties": {
"media_properties": {
"type": "object",
"properties": {
"source_sid": {
"type": "string",
"$comment": "Twilio Recording Sid"
},
"media_url": {
"type": "string",
"format": "uri",
"$comment": "url to the 3rd party recording"
}
},
"$comment": "Either source_sid or media_url is required"
},
"participants": {
"type": "array"
}
},
"title": "Channel"
}
}
}
If the Transcript
was generated from an external recording, the Channel
information would look like the following:
{
"media_properties":{
"source_sid": null,
"media_url": "http://www.example.com/recording/call.wav"
},
"participants":[
]
}
Specifying participant information
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:
{
"$schema": "http://json-schema.org/draft-06/schema#",
"type": "array",
"maxItems": 2,
"items": {
"$ref": "#/definitions/Participant"
},
"definitions": {
"Participant": {
"type": "object",
"additionalProperties": false,
"properties": {
"channel_participant": {
"type": "integer",
"enum": [
1,
2
],
"$comment": "You can only specify one participant per channel"
},
"user_id": {
"type": "string"
},
"media_participant_id": {
"type": "string"
},
"role": {
"type": "string"
},
"full_name": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
},
"image_url": {
"type": "string",
"format": "uri"
}
},
"required": [
"channel_participant"
],
"title": "Participant"
}
}
}
Specifying both participants
[
{
"user_id" : "id1",
"channel_participant": 1,
"media_participant_id": "+1505959545",
"email": "veronica.meyer@example.com",
"full_name": "Veronica Meyer",
"image_url": "https://images.unsplash.com/photo-1438761681033-6461ffad8d80",
"role": "Agent"
},
{
"user_id" : "id2",
"channel_participant": 2,
"media_participant_id": "+1505959505",
"email": "lauryn.trujillo@example.com",
"full_name": "Lauryn Trujillo",
"image_url": "https://images.unsplash.com/photo-1554384645-13eab165c24b",
"role": "Customer"
}
]
Example 1
Fetch an existing Transcript
https://intelligence.twilio.com/v2/Transcripts/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
A 34 character string that uniquely identifies this Transcript. |
redacted
Optional
|
Grant access to PII Redacted/Unredacted Transcript. The default is |
Example 1
Fetch multiple Transcripts
https://intelligence.twilio.com/v2/Transcripts
Parameters
Parameters in REST API format | |
---|---|
service_sid
Optional
|
The unique SID identifier of the Service. |
before_start_time
Optional
|
Filter by before StartTime. |
after_start_time
Optional
|
Filter by after StartTime. |
before_date_created
Optional
|
Filter by before DateCreated. |
after_date_created
Optional
|
Filter by after DateCreated. |
status
Optional
|
Filter by status. |
language_code
Optional
|
Filter by Language Code. |
source_sid
Optional
|
Filter by SourceSid. |
Example 1
Delete an existing Transcript
https://intelligence.twilio.com/v2/Transcripts/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
A 34 character string that uniquely identifies this Transcript. |