Skip to contentSkip to navigationSkip to topbar
On this page

Voice Intelligence - Transcript Sentence Subresource


A Transcript Sentence subresource represents a transcribed sentence from a given Voice Intelligence Transcript.


Transcript Sentence properties

transcript-sentence-properties page anchor
Property nameTypeRequiredDescriptionChild properties
media_channelinteger

Optional

Not PII

The channel number.

Default: 0

sentence_indexinteger

Optional

The index of the sentence in the transcript.

Default: 0

start_timenumber

Optional

Offset from the beginning of the transcript when this sentence starts.


end_timenumber

Optional

Offset from the beginning of the transcript when this sentence ends.


transcriptstring

Optional

PII MTL: 30 days

Transcript text.


sidSID<GX>

Optional

A 34 character string that uniquely identifies this Sentence.

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

confidencenumber

Optional


wordsarray

Optional

Detailed information for each of the words of the given Sentence.


Retrieve all Transcript Sentences for a given Transcript

retrieve-all-transcript-sentences-for-a-given-transcript page anchor
GET https://intelligence.twilio.com/v2/Transcripts/{TranscriptSid}/Sentences

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
TranscriptSidSID<GT>required

The unique SID identifier of the Transcript.

Pattern: ^GT[0-9a-fA-F]{32}$Min length: 34Max length: 34
Property nameTypeRequiredPIIDescription
Redactedboolean

Optional

Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is true to access redacted sentences.


WordTimestampsboolean

Optional

Returns word level timestamps information, if word_timestamps is enabled. The default is false.


PageSizeinteger<int64>

Optional

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

Minimum: 1Maximum: 1000

Pageinteger

Optional

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

Minimum: 0

PageTokenstring

Optional

The page token. This is provided by the API.

The GET request shown below returns a list of Transcript Sentences for a given Transcript, with the WordTimestamps query parameter set to true.

Retrieve all Transcript Sentences for a TranscriptLink to code sample: Retrieve all Transcript Sentences for a Transcript
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listSentence() {
11
const sentences = await client.intelligence.v2
12
.transcripts("GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.sentences.list({ limit: 20 });
14
15
sentences.forEach((s) => console.log(s.mediaChannel));
16
}
17
18
listSentence();

Output

1
{
2
"sentences": [
3
{
4
"media_channel": 1,
5
"sentence_index": 0,
6
"start_time": null,
7
"end_time": null,
8
"transcript": "test test",
9
"sid": "GXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
10
"confidence": null,
11
"words": [
12
{
13
"word": "test",
14
"start_time": null,
15
"end_time": null
16
},
17
{
18
"word": "test",
19
"start_time": null,
20
"end_time": null
21
}
22
]
23
}
24
],
25
"meta": {
26
"key": "sentences",
27
"page": 0,
28
"page_size": 50,
29
"first_page_url": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sentences?PageSize=50&Page=0",
30
"url": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sentences?PageSize=50&Page=0",
31
"next_page_url": null,
32
"previous_page_url": null
33
}
34
}

Show redacted Transcript Sentences

show-redacted-transcript-sentences page anchor

If PII redaction was enabled at the time the associated Transcript was created, you can retrieve the redacted or unredacted Sentences.

If Redacted is true (the default value), the redacted Sentences are returned.

If Redacted is false , the original, unredacted Sentences are returned.

Retrieve unredacted Sentences for a TranscriptLink to code sample: Retrieve unredacted Sentences for a Transcript
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listSentence() {
11
const sentences = await client.intelligence.v2
12
.transcripts("GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.sentences.list({
14
redacted: false,
15
limit: 20,
16
});
17
18
sentences.forEach((s) => console.log(s.mediaChannel));
19
}
20
21
listSentence();

Output

1
{
2
"sentences": [
3
{
4
"media_channel": 1,
5
"sentence_index": 0,
6
"start_time": null,
7
"end_time": null,
8
"transcript": "test test",
9
"sid": "GXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
10
"confidence": null,
11
"words": [
12
{
13
"word": "test",
14
"start_time": null,
15
"end_time": null
16
},
17
{
18
"word": "test",
19
"start_time": null,
20
"end_time": null
21
}
22
]
23
}
24
],
25
"meta": {
26
"key": "sentences",
27
"page": 0,
28
"page_size": 50,
29
"first_page_url": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sentences?PageSize=50&Page=0",
30
"url": "https://intelligence.twilio.com/v2/Transcripts/GTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sentences?PageSize=50&Page=0",
31
"next_page_url": null,
32
"previous_page_url": null
33
}
34
}