Menu

Expand
Rate this page:

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
sid<AC> Not PII

The unique SID identifier of the Account.

service_sid
sid<GA> Not PII

The unique SID identifier of the Service.

sid
sid<GT> Not PII

A 34 character string that uniquely identifies this Transcript.

date_created
date_time<iso8601> Not PII

The date that this Transcript was created, given in ISO 8601 format.

date_updated
date_time<iso8601> Not PII

The date that this Transcript was updated, given in ISO 8601 format.

status
enum:status Not PII

The Status of this Transcript. One of queued, in-progress, completed, failed or canceled.

channel
object Not PII

Media Channel describing Transcript Source and Participant Mapping

data_logging
boolean Not PII

Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models.

language_code
string Not PII

The default language code of the audio.

customer_key
string Not PII

media_start_time
date_time<iso8601> Not PII

The date that this Transcript's media was started, given in ISO 8601 format.

duration
integer Not PII

The duration of this Transcript's source

url
url Not PII

The URL of this resource.

redaction
boolean Not PII

If the transcript has been redacted, a redacted alternative of the transcript will be available.

links
uri_map Not PII

Create a new Transcript

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:

  • Use a recording SID
    If you’ve made a recording on Twilio and you are storing that recording on Twilio, you can make a POST request to the Transcript API and include the recording’s SID as a RecordingSID 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 a POST request to the Transcript API and including the MediaUrl 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
post sid<GA> Not PII

The unique SID identifier of the Service.

channel
Required
post object Not PII

JSON object describing Media Channel including Source and Participants

customer_key
Optional
post string Not PII

Used to store client provided metadata. Maximum of 64 double-byte UTF8 characters.

media_start_time
Optional
post date_time<iso8601> Not PII

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
Loading Code Sample...
        
        

        Create Transcript

        Fetch an existing Transcript

        get
        https://intelligence.twilio.com/v2/Transcripts/{Sid}
        Parameters
        Parameters in REST API format
        sid
        Path
        get sid<GT> Not PII

        A 34 character string that uniquely identifies this Transcript.

        redacted
        Optional
        get boolean Not PII

        Grant access to PII Redacted/Unredacted Transcript. The default is true to access redacted Transcript.

        Example 1
        Loading Code Sample...
              
              

              Fetch Transcript

              Fetch multiple Transcripts

              get
              https://intelligence.twilio.com/v2/Transcripts
              Parameters
              Parameters in REST API format
              service_sid
              Optional
              get sid<GA> Not PII

              The unique SID identifier of the Service.

              before_start_time
              Optional
              get string Not PII

              Filter by before StartTime.

              after_start_time
              Optional
              get string Not PII

              Filter by after StartTime.

              before_date_created
              Optional
              get string Not PII

              Filter by before DateCreated.

              after_date_created
              Optional
              get string Not PII

              Filter by after DateCreated.

              status
              Optional
              get string Not PII

              Filter by status.

              language_code
              Optional
              get string Not PII

              Filter by Language Code.

              source_sid
              Optional
              get string Not PII

              Filter by SourceSid.

              Example 1
              Loading Code Sample...
                    
                    

                    Read Transcript

                    Delete an existing Transcript

                    delete
                    https://intelligence.twilio.com/v2/Transcripts/{Sid}
                    Parameters
                    Parameters in REST API format
                    sid
                    Path
                    delete sid<GT> Not PII

                    A 34 character string that uniquely identifies this Transcript.

                    Example 1
                    Loading Code Sample...
                          
                          

                          Delete Transcript

                          Rate this page:
                          Loading Code Sample...
                                
                                
                                

                                Thank you for your feedback!

                                Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                Sending your feedback...
                                🎉 Thank you for your feedback!
                                Something went wrong. Please try again.

                                Thanks for your feedback!

                                thanks-feedback-gif